Re: doc: add missing "id" attributes to extension packaging page

Поиск
Список
Период
Сортировка
От Karl O. Pinc
Тема Re: doc: add missing "id" attributes to extension packaging page
Дата
Msg-id 20230414124123.7784ab00@slate.karlpinc.com
обсуждение исходный текст
Ответ на Re: doc: add missing "id" attributes to extension packaging page  ("Karl O. Pinc" <kop@karlpinc.com>)
Список pgsql-hackers
On Thu, 13 Apr 2023 10:53:31 -0500
"Karl O. Pinc" <kop@karlpinc.com> wrote:

> On Thu, 13 Apr 2023 16:01:35 +0200
> Brar Piening <brar@gmx.de> wrote:
>
> > On 13.04.2023 at 10:31, Peter Eisentraut wrote:

> > > Side project: I noticed that these new hover links don't appear in
> > > the single-page HTML output (make postgres.html), even though the
> > > generated HTML source code looks correct.  Maybe someone has an
> > > idea there.
> > I feel responsible for the feature to work for all use cases where
> > it makes sense. I'll investigate this and post back.
>
> Looks to me like the ">" in the CSS was transformed into the >
> HTML entity when the stylesheet was included into the single-file
> HTML.

The XSLT 1.0 spec says that characters in <style> elements should
not be escaped when outputting HTML.  [4]  But (I think) the
generate.css.header parameter method [1][2] of
inserting the CSS into the HTML expands the CSS content
in an XML context, not a HTML context.

I've played around with it, going so far as to make stylesheet.css
look like:

--------------<snip>--------
<!DOCTYPE  xsl:stylesheet [
<!ENTITY css SYSTEM "stylesheet.css">
]>
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  &css;
</xsl:stylesheet>
--------------<snip>--------

and even substituted the actual text of stylesheet.css in
place of the &css; entity reference.  In these cases the
"<" character is still entity expanded, resulting in broken CSS.

My conclusion is that this method is broken.

(The other possibility, I suppose, is that xsltproc is broken.)

I think the thing to try is the sagehill.net approach [4].
This overrides the user.head.content template.  My hope is
that because the &css; entity is seen in a <style> element
in the template, that xsltproc then recognizances style element
content in a HTML output context.

(I don't know how xsltproc is supposed to know that it is
in a HTML output context.  I suppose exploring this would
be another avenue should the above fail.)


1
https://docbook.sourceforge.net/release/xsl/current/doc/html/custom.css.source.html

2
https://docbook.sourceforge.net/release/xsl/current/doc/html/generate.css.header.html

3 http://sagehill.net/docbookxsl/HtmlHead.html#EmbedCSS

4 https://www.w3.org/TR/xslt-10/#section-HTML-Output-Method

Regards,

Karl <kop@karlpinc.com>
Free Software:  "You don't pay back, you pay forward."
                 -- Robert A. Heinlein



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jacob Champion
Дата:
Сообщение: Re: [PATCH] Add `verify-system` sslmode to use system CA pool for server cert
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Temporary tables versus wraparound... again