aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-05-05 13:29:20 -0400
committerDavid Robillard <d@drobilla.net>2023-05-05 13:40:29 -0400
commit5b1b8f450e882f7cd80f2ba2a44ee781cf599a20 (patch)
tree0ad40bf1754367ae461ad9b3aaffe64ec74d3a29
parent23434e047960f5bdb4fdc8e643daf5f4ad36dd5e (diff)
downloadserd-5b1b8f450e882f7cd80f2ba2a44ee781cf599a20.tar.gz
serd-5b1b8f450e882f7cd80f2ba2a44ee781cf599a20.tar.bz2
serd-5b1b8f450e882f7cd80f2ba2a44ee781cf599a20.zip
Add options to disable html or singlehtml documentation
-rw-r--r--NEWS3
-rw-r--r--doc/c/meson.build62
-rw-r--r--meson_options.txt6
3 files changed, 41 insertions, 30 deletions
diff --git a/NEWS b/NEWS
index 41289d06..49b437c8 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ serd (0.31.5) unstable; urgency=medium
* Add Windows path separator support to serd_node_new_file_uri()
* Add long "help" and "version" options to serdi
+ * Add options to disable html or singlehtml documentation
* Add serd_reader_skip_until_byte() to public API
* Allow SERD_API to be defined by the user
* Avoid creating test files in the current directory
@@ -29,7 +30,7 @@ serd (0.31.5) unstable; urgency=medium
* Test header for warnings more strictly
* Update standard test suites
- -- David Robillard <d@drobilla.net> Wed, 03 May 2023 19:48:35 +0000
+ -- David Robillard <d@drobilla.net> Fri, 05 May 2023 17:28:53 +0000
serd (0.30.16) stable; urgency=medium
diff --git a/doc/c/meson.build b/doc/c/meson.build
index 3a6a3923..f81a692a 100644
--- a/doc/c/meson.build
+++ b/doc/c/meson.build
@@ -15,13 +15,13 @@ endif
# Generate Sphinx configuration file
-config = configuration_data()
-config.set('SERD_VERSION', meson.project_version())
-config.set('SERD_SRCDIR', serd_src_root)
-config.set('SERD_TITLE', get_option('title'))
+conf_config = configuration_data()
+conf_config.set('SERD_SRCDIR', serd_src_root)
+conf_config.set('SERD_TITLE', get_option('title'))
+conf_config.set('SERD_VERSION', meson.project_version())
conf_py = configure_file(
- configuration: config,
+ configuration: conf_config,
input: files('../conf.py.in'),
output: 'conf.py',
)
@@ -57,28 +57,32 @@ endif
# TODO: Add install_tag: 'doc' after requiring meson 0.60.0
-custom_target(
- 'singlehtml',
- build_by_default: true,
- command: [
- sphinx_build,
- '-M', 'singlehtml', '@OUTDIR@', '@OUTDIR@', '-t', 'singlehtml',
- ] + sphinx_flags,
- input: [c_rst_files, c_serd_rst, c_index_xml, conf_py],
- install: true,
- install_dir: docdir / versioned_name,
- output: 'singlehtml',
-)
+if not get_option('singlehtml').disabled()
+ custom_target(
+ 'singlehtml',
+ build_by_default: true,
+ command: [
+ sphinx_build,
+ '-M', 'singlehtml', '@OUTDIR@', '@OUTDIR@', '-t', 'singlehtml',
+ ] + sphinx_flags,
+ input: [c_rst_files, c_serd_rst, c_index_xml, conf_py],
+ install: true,
+ install_dir: docdir / versioned_name,
+ output: 'singlehtml',
+ )
+endif
-custom_target(
- 'html',
- build_by_default: true,
- command: [
- sphinx_build,
- '-M', 'html', '@OUTDIR@', '@OUTDIR@', '-t', 'html',
- ] + sphinx_flags,
- input: [c_rst_files, c_serd_rst, c_index_xml, conf_py],
- install: true,
- install_dir: docdir / versioned_name,
- output: 'html',
-)
+if not get_option('html').disabled()
+ custom_target(
+ 'html',
+ build_by_default: true,
+ command: [
+ sphinx_build,
+ '-M', 'html', '@OUTDIR@', '@OUTDIR@', '-t', 'html',
+ ] + sphinx_flags,
+ input: [c_rst_files, c_serd_rst, c_index_xml, conf_py],
+ install: true,
+ install_dir: docdir / versioned_name,
+ output: 'html',
+ )
+endif
diff --git a/meson_options.txt b/meson_options.txt
index ebaaffa0..7fe112a4 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -7,9 +7,15 @@ option('checks', type: 'feature', value: 'enabled', yield: true,
option('docs', type: 'feature', value: 'auto', yield: true,
description: 'Build documentation')
+option('html', type: 'feature', value: 'auto', yield: true,
+ description: 'Build paginated HTML documentation')
+
option('lint', type: 'boolean', value: false, yield: true,
description: 'Run code quality checks')
+option('singlehtml', type: 'feature', value: 'auto', yield: true,
+ description: 'Build single-page HTML documentation')
+
option('static', type: 'boolean', value: false, yield: true,
description: 'Statically link executables')