meson: docs: Allow configuring simple/website style
authorAndres Freund <[email protected]>
Wed, 5 Apr 2023 04:31:27 +0000 (21:31 -0700)
committerAndres Freund <[email protected]>
Wed, 5 Apr 2023 04:31:27 +0000 (21:31 -0700)
The meson docs generation hardcoded using the website style so far. Make it
configurable via a meson option.

Reviewed-by: Justin Pryzby <[email protected]>
Reported-by: Peter Eisentraut <[email protected]>
Discussion: https://postgr.es/m/3fc3bb9b-f7f8-d442-35c1-ec82280c564a@enterprisedb.com

doc/src/sgml/installation.sgml
doc/src/sgml/meson.build
meson_options.txt

index 0191add0301181636ecbd63746ef626fce94012a..f451204854c5f641a6b2361460c7083d6a093db8 100644 (file)
@@ -2923,6 +2923,18 @@ ninja install
       </listitem>
      </varlistentry>
 
+     <varlistentry id="configure-docs-html-style">
+      <term><option>-Ddocs_html_style={ simple | website }</option></term>
+      <listitem>
+       <para>
+        Controls which <acronym>CSS</acronym> stylesheet is used.  The default
+        is <literal>simple</literal>.  If set to <literal>website</literal>,
+        the HTML documentation will reference the stylesheet for <ulink
+        url="https://www.postgresql.org/docs/current/">postgresql.org</ulink>.
+       </para>
+      </listitem>
+     </varlistentry>
+
     </variablelist>
    </sect3>
 
index 539865da8d94aa7274c3f3c1f0b23a23f9f3380f..c6d77b5a1504c9f8b8d25aaac4db403064938dc5 100644 (file)
@@ -103,9 +103,10 @@ if xsltproc_bin.found()
     '--tool', xsltproc_bin, '--',
   ]
 
-  xsltproc_html_flags = xsltproc_flags + [
-    '--param', 'website.stylesheet', '1'
-  ]
+  xsltproc_html_flags = xsltproc_flags
+  if get_option('docs_html_style') == 'website'
+    xsltproc_html_flags += ['--param', 'website.stylesheet', '1']
+  endif
 endif
 
 
index c203dcce6fe45baf154eb0d569173720373b2c86..5b44a8829d30130bae4978e31fa404bc2906a1dd 100644 (file)
@@ -85,6 +85,9 @@ option('docs', type : 'feature', value: 'auto',
 option('docs_pdf', type : 'feature', value: 'auto',
   description: 'documentation in PDF format')
 
+option('docs_html_style', type : 'combo', choices: ['simple', 'website'],
+  description: 'CSS stylesheet for HTML documentation')
+
 option('dtrace', type : 'feature', value: 'disabled',
   description: 'DTrace support')