From: Andres Freund Date: Fri, 24 Mar 2023 00:13:53 -0700 Subject: [PATCH v3 2/4] docs: load stylesheet via custom.css.source --- doc/src/sgml/Makefile | 4 +--- doc/src/sgml/meson.build | 12 ++++++------ doc/src/sgml/stylesheet-common.xsl | 14 ++++++++++++++ doc/src/sgml/stylesheet-hh.xsl | 1 - doc/src/sgml/stylesheet-html-nochunk.xsl | 3 +++ doc/src/sgml/stylesheet.css.xml | 8 ++++++++ doc/src/sgml/stylesheet.xsl | 11 ----------- 7 files changed, 32 insertions(+), 21 deletions(-) create mode 100644 doc/src/sgml/stylesheet.css.xml diff --git a/doc/src/sgml/Makefile b/doc/src/sgml/Makefile index 1b098f983ec..9be480613b4 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,14 +144,12 @@ 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 $@ htmlhelp: htmlhelp-stamp htmlhelp-stamp: stylesheet-hh.xsl postgres-full.xml $(ALL_IMAGES) $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) $(wordlist 1,2,$^) - cp $(srcdir)/stylesheet.css htmlhelp/ touch $@ # single-page HTML diff --git a/doc/src/sgml/meson.build b/doc/src/sgml/meson.build index 157b8589e55..d9c46224dc9 100644 --- a/doc/src/sgml/meson.build +++ b/doc/src/sgml/meson.build @@ -104,7 +104,7 @@ if xsltproc_bin.found() xsltproc_flags = [ '--nonet', '--stringparam', 'pg.version', pg_version, - '--param', 'website.stylesheet', '1' + '--path', '@CURRENT_SOURCE_DIR@', '--path', '@OUTDIR@', ] xsltproc = xmltools_wrapper + [ @@ -140,7 +140,7 @@ if xsltproc_bin.found() output: 'htmlhelp', depfile: 'htmlhelp.d', depends: doc_generated, - command: [xsltproc, '--path', '@OUTDIR@', '-o', '@OUTDIR@/', xsltproc_flags, '@INPUT@'], + command: [xsltproc, '-o', '@OUTDIR@/', xsltproc_flags, '@INPUT@'], build_by_default: false, ) alldocs += htmlhelp @@ -152,7 +152,7 @@ if xsltproc_bin.found() output: 'postgres.html', depfile: 'postgres.html.d', depends: doc_generated, - command: [xsltproc, '--path', '@OUTDIR@', '-o', '@OUTPUT@', xsltproc_flags, '@INPUT@'], + command: [xsltproc, '-o', '@OUTPUT@', xsltproc_flags, '@INPUT@'], build_by_default: false, ) alldocs += postgres_html @@ -180,14 +180,14 @@ if xsltproc_bin.found() output: 'INSTALL.xml', depfile: 'INSTALL.xml.d', depends: doc_generated + [postgres_full_xml], - command: [xsltproc, '--path', '@OUTDIR@', '-o', '@OUTPUT@', xsltproc_flags, '--xinclude', '@INPUT@'], + command: [xsltproc, '-o', '@OUTPUT@', xsltproc_flags, '--xinclude', '@INPUT@'], build_by_default: false, ) install_html = custom_target('INSTALL.html', input: ['stylesheet-text.xsl', install_xml], output: 'INSTALL.html', depfile: 'INSTALL.html.d', - command: [xsltproc, '--path', '@OUTDIR@', '-o', '@OUTPUT@', xsltproc_flags, '@INPUT@'], + command: [xsltproc, '-o', '@OUTPUT@', xsltproc_flags, '@INPUT@'], build_by_default: false, ) alldocs += install_html @@ -216,7 +216,7 @@ if xsltproc_bin.found() output: ['man1', 'man3', 'man7'], depfile: 'man.d', depends: doc_generated, - command: [xsltproc, '--path', '@OUTDIR@', '-o', '@OUTDIR@/', xsltproc_flags, '@INPUT@'], + command: [xsltproc, '-o', '@OUTDIR@/', xsltproc_flags, '@INPUT@'], build_by_default: false, ) alldocs += man diff --git a/doc/src/sgml/stylesheet-common.xsl b/doc/src/sgml/stylesheet-common.xsl index d2928f86eb7..c1a7d46bcc6 100644 --- a/doc/src/sgml/stylesheet-common.xsl +++ b/doc/src/sgml/stylesheet-common.xsl @@ -42,6 +42,20 @@ + + + + + stylesheet.css.xml + + + + https://www.postgresql.org/media/css/docs-complete.css.xml + + diff --git a/doc/src/sgml/stylesheet-hh.xsl b/doc/src/sgml/stylesheet-hh.xsl index 568ccf36d2a..fb659d2ec38 100644 --- a/doc/src/sgml/stylesheet-hh.xsl +++ b/doc/src/sgml/stylesheet-hh.xsl @@ -9,7 +9,6 @@ - diff --git a/doc/src/sgml/stylesheet-html-nochunk.xsl b/doc/src/sgml/stylesheet-html-nochunk.xsl index 8167127b93a..fae8d5fbd96 100644 --- a/doc/src/sgml/stylesheet-html-nochunk.xsl +++ b/doc/src/sgml/stylesheet-html-nochunk.xsl @@ -7,6 +7,9 @@ + + + diff --git a/doc/src/sgml/stylesheet.css.xml b/doc/src/sgml/stylesheet.css.xml new file mode 100644 index 00000000000..a21fcca576f --- /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 f9163e7d946..65606ca3dbe 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 - - - - -- 2.38.0 --l5hiy5hty64mvsca Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v3-0003-docs-speed-up-docs-build-by-special-casing-the-ge.patch"