docs: add option to skip building HTML docs

Reorder meson targets to handle those all at the end, and exit early if
HTML documentation is disabled. This makes it possible to build just the
manpage, without hotdoc installed.
pull/11777/head
Eli Schwartz 12 months ago
parent 740d926eee
commit 6f78db93bf
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 71
      docs/meson.build
  2. 2
      docs/meson_options.txt

@ -2,19 +2,6 @@ project('Meson documentation', version: '1.0')
cur_bdir = meson.current_build_dir()
# Only the script knows which files are being generated
docs_gen = custom_target(
'gen_docs',
input: files('markdown/index.md'),
output: 'gen_docs.stamp',
command: [
files('../tools/regenerate_docs.py'),
'--output-dir', cur_bdir,
'--dummy-output-file', '@OUTPUT@',
],
build_by_default: true,
install: false)
sitemap = files('sitemap.txt')
yaml_loader = get_option('unsafe_yaml') ? 'fastyaml' : 'yaml'
@ -34,24 +21,6 @@ refman_binary = custom_target(
]
)
refman_md = custom_target(
'gen_refman_md',
input: refman_binary,
output: ['configured_sitemap.txt', 'refman_links.json'],
command: [
genrefman,
'-l', 'pickle',
'-g', 'md',
'-s', sitemap,
'-i', '@INPUT@',
'-o', '@OUTPUT0@',
'--link-defs', '@OUTPUT1@',
'--force-color',
'--no-modules',
],
)
sitemap = refman_md[0]
refman_json = custom_target(
'gen_refman_json',
build_by_default: true,
@ -66,6 +35,7 @@ refman_json = custom_target(
'--force-color',
],
)
test('validate_docs', find_program('./jsonvalidator.py'), args: [refman_json])
refman_man = custom_target(
'gen_refman_man',
@ -83,6 +53,43 @@ refman_man = custom_target(
],
)
# Everything past here is HTML resources.
if not get_option('html')
subdir_done()
endif
# Only the script knows which files are being generated
docs_gen = custom_target(
'gen_docs',
input: files('markdown/index.md'),
output: 'gen_docs.stamp',
command: [
files('../tools/regenerate_docs.py'),
'--output-dir', cur_bdir,
'--dummy-output-file', '@OUTPUT@',
],
build_by_default: true,
install: false,
)
refman_md = custom_target(
'gen_refman_md',
input: refman_binary,
output: ['configured_sitemap.txt', 'refman_links.json'],
command: [
genrefman,
'-l', 'pickle',
'-g', 'md',
'-s', sitemap,
'-i', '@INPUT@',
'-o', '@OUTPUT0@',
'--link-defs', '@OUTPUT1@',
'--force-color',
'--no-modules',
],
)
sitemap = refman_md[0]
genrelnotes = custom_target(
output: ['sitemap-genrelnotes.txt'],
build_always_stale: true,
@ -95,8 +102,6 @@ genrelnotes = custom_target(
)
sitemap = genrelnotes[0]
test('validate_docs', find_program('./jsonvalidator.py'), args: [refman_json])
hotdoc_prog = find_program('hotdoc', version: '>=0.13.7')
hotdoc = import('hotdoc')

@ -1,2 +1,4 @@
option('unsafe_yaml', type: 'boolean', value: false,
description: 'disable safety checks and use a faster, but less correct YAML loader')
option('html', type: 'boolean', value: true,
description: 'build the hotdoc-based HTML documentation')

Loading…
Cancel
Save