From b8059bdf1ef8f7e215ec5010fcf6c3bd9c491eef Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Tue, 4 Apr 2023 21:10:46 -0700 Subject: [PATCH] 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 Discussion: https://postgr.es/m/3fc3bb9b-f7f8-d442-35c1-ec82280c564a@enterprisedb.com --- doc/src/sgml/Makefile | 3 +-- doc/src/sgml/meson.build | 2 +- doc/src/sgml/stylesheet-html-common.xsl | 8 ++++++++ doc/src/sgml/stylesheet-html-nochunk.xsl | 3 +++ doc/src/sgml/stylesheet.css.xml | 8 ++++++++ doc/src/sgml/stylesheet.xsl | 11 ----------- 6 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 doc/src/sgml/stylesheet.css.xml diff --git a/doc/src/sgml/Makefile b/doc/src/sgml/Makefile index 11ecdaf717..71cbef230f 100644 --- a/doc/src/sgml/Makefile +++ b/doc/src/sgml/Makefile @@ -39,7 +39,7 @@ ifndef FOP FOP = $(missing) fop endif -XMLINCLUDE = --path . +XMLINCLUDE = --path . --path $(srcdir) ifdef XMLLINT XMLLINT := $(XMLLINT) --nonet @@ -144,7 +144,6 @@ html: html-stamp html-stamp: stylesheet.xsl postgres-full.xml $(ALL_IMAGES) $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) $(XSLTPROC_HTML_FLAGS) $(wordlist 1,2,$^) - cp $(srcdir)/stylesheet.css html/ touch $@ # single-page HTML diff --git a/doc/src/sgml/meson.build b/doc/src/sgml/meson.build index f293eca612..539865da8d 100644 --- a/doc/src/sgml/meson.build +++ b/doc/src/sgml/meson.build @@ -96,7 +96,7 @@ if xsltproc_bin.found() xsltproc_flags = [ '--nonet', '--stringparam', 'pg.version', pg_version, - '--path', '@OUTDIR@', + '--path', '@OUTDIR@', '--path', '@CURRENT_SOURCE_DIR@', ] xsltproc = xmltools_wrapper + [ diff --git a/doc/src/sgml/stylesheet-html-common.xsl b/doc/src/sgml/stylesheet-html-common.xsl index 9df2782ce4..bb6429ef7c 100644 --- a/doc/src/sgml/stylesheet-html-common.xsl +++ b/doc/src/sgml/stylesheet-html-common.xsl @@ -18,6 +18,14 @@ pgsql-docs@lists.postgresql.org 2 + + + stylesheet.css.xml + + + https://www.postgresql.org/media/css/docs-complete.css + + + + diff --git a/doc/src/sgml/stylesheet.css.xml b/doc/src/sgml/stylesheet.css.xml new file mode 100644 index 0000000000..a21fcca576 --- /dev/null +++ b/doc/src/sgml/stylesheet.css.xml @@ -0,0 +1,8 @@ + + +]> + diff --git a/doc/src/sgml/stylesheet.xsl b/doc/src/sgml/stylesheet.xsl index c492dc38e5..363cc93e6b 100644 --- a/doc/src/sgml/stylesheet.xsl +++ b/doc/src/sgml/stylesheet.xsl @@ -17,17 +17,6 @@ - - - - - stylesheet.css - - https://www.postgresql.org/media/css/docs-complete.css - - - -