Skip to content

Commit b8059bd

Browse files
committed
docs: html: load stylesheet via custom.css.source
Until now the meson built docs did not have a working reference to the css stylesheet, it was copied in the make target. Instead of duplicating that for meson, use the docbook-xsl parameter custom.css.source to reference it. An additional benefit of that approach is that the stylesheet is now included in the single-file HTML documentation. Reported-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com> Discussion: https://postgr.es/m/3fc3bb9b-f7f8-d442-35c1-ec82280c564a@enterprisedb.com
1 parent 0012979 commit b8059bd

File tree

6 files changed

+21
-14
lines changed

6 files changed

+21
-14
lines changed

doc/src/sgml/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ ifndef FOP
3939
FOP = $(missing) fop
4040
endif
4141

42-
XMLINCLUDE = --path .
42+
XMLINCLUDE = --path . --path $(srcdir)
4343

4444
ifdef XMLLINT
4545
XMLLINT := $(XMLLINT) --nonet
@@ -144,7 +144,6 @@ html: html-stamp
144144

145145
html-stamp: stylesheet.xsl postgres-full.xml $(ALL_IMAGES)
146146
$(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) $(XSLTPROC_HTML_FLAGS) $(wordlist 1,2,$^)
147-
cp $(srcdir)/stylesheet.css html/
148147
touch $@
149148

150149
# single-page HTML

doc/src/sgml/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ if xsltproc_bin.found()
9696
xsltproc_flags = [
9797
'--nonet',
9898
'--stringparam', 'pg.version', pg_version,
99-
'--path', '@OUTDIR@',
99+
'--path', '@OUTDIR@', '--path', '@CURRENT_SOURCE_DIR@',
100100
]
101101

102102
xsltproc = xmltools_wrapper + [

doc/src/sgml/stylesheet-html-common.xsl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818
<xsl:param name="make.graphic.viewport" select="0"/>
1919
<xsl:param name="link.mailto.url">pgsql-docs@lists.postgresql.org</xsl:param>
2020
<xsl:param name="toc.max.depth">2</xsl:param>
21+
<xsl:param name="website.stylesheet" select="0"/>
22+
<xsl:param name="custom.css.source">
23+
<xsl:if test="$website.stylesheet = 0">stylesheet.css.xml</xsl:if>
24+
</xsl:param>
25+
<xsl:param name="html.stylesheet">
26+
<xsl:if test="not($website.stylesheet = 0)">https://www.postgresql.org/media/css/docs-complete.css</xsl:if>
27+
</xsl:param>
28+
2129

2230
<!--
2331
The below allows the stylesheets provided by the website to be applied fully

doc/src/sgml/stylesheet-html-nochunk.xsl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
<xsl:include href="stylesheet-html-common.xsl" />
88
<xsl:include href="stylesheet-speedup-xhtml.xsl" />
99

10+
<!-- except when referencing the online stylesheet, embed stylesheet -->
11+
<xsl:param name="generate.css.header" select="$website.stylesheet = 0"/>
12+
1013
<!-- embed SVG images into output file -->
1114
<xsl:template match="imagedata[@format='SVG']">
1215
<xsl:variable name="filename">

doc/src/sgml/stylesheet.css.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!--
2+
wrapper around stylesheet.css.xml to allow it to be loaded via docbook-xsl's
3+
generate.css.header parameter.
4+
-->
5+
<!DOCTYPE style [
6+
<!ENTITY css SYSTEM "stylesheet.css">
7+
]>
8+
<style>&css;</style>

doc/src/sgml/stylesheet.xsl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,6 @@
1717
<xsl:param name="chunk.quietly" select="1"></xsl:param>
1818
<xsl:param name="admon.style"></xsl:param> <!-- handled by CSS stylesheet -->
1919

20-
<xsl:param name="website.stylesheet" select="0"/>
21-
22-
<xsl:param name="html.stylesheet">
23-
<xsl:choose>
24-
<xsl:when test="$website.stylesheet = 0">stylesheet.css</xsl:when>
25-
<xsl:otherwise>
26-
https://www.postgresql.org/media/css/docs-complete.css
27-
</xsl:otherwise>
28-
</xsl:choose>
29-
</xsl:param>
30-
3120

3221
<!-- copy images to the output directory, so the output is self contained -->
3322
<xsl:template match="imageobject">

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy