diff options
author | David Robillard <d@drobilla.net> | 2021-10-09 15:48:18 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-01-28 21:57:29 -0500 |
commit | ea272b5e88c02117a2a3ef7e12d221bd196844dc (patch) | |
tree | 0ca284906b5c9678aee541e827a9ceb002d022c0 | |
parent | a9f6180de5124f699963bd007daa810868f2c75a (diff) | |
download | serd-ea272b5e88c02117a2a3ef7e12d221bd196844dc.tar.gz serd-ea272b5e88c02117a2a3ef7e12d221bd196844dc.tar.bz2 serd-ea272b5e88c02117a2a3ef7e12d221bd196844dc.zip |
Isolate man pages and build HTML versions with mandoc if possible
The HTML versions are mainly useful for generating the online documentation as
part of a CI pipeline. They are installed anyway, which is redundant for
systems with a man page reader, but handy elsewhere.
-rw-r--r-- | doc/man/mandoc.css (renamed from doc/mandoc.css) | 0 | ||||
-rw-r--r-- | doc/man/meson.build | 39 | ||||
-rw-r--r-- | doc/man/serd-filter.1 (renamed from doc/serd-filter.1) | 0 | ||||
-rw-r--r-- | doc/man/serd-pipe.1 (renamed from doc/serd-pipe.1) | 0 | ||||
-rw-r--r-- | doc/man/serd-sort.1 (renamed from doc/serd-sort.1) | 0 | ||||
-rw-r--r-- | doc/man/serd-validate.1 (renamed from doc/serd-validate.1) | 0 | ||||
-rw-r--r-- | doc/meson.build | 1 | ||||
-rw-r--r-- | meson.build | 9 |
8 files changed, 43 insertions, 6 deletions
diff --git a/doc/mandoc.css b/doc/man/mandoc.css index cebb50bf..cebb50bf 100644 --- a/doc/mandoc.css +++ b/doc/man/mandoc.css diff --git a/doc/man/meson.build b/doc/man/meson.build new file mode 100644 index 00000000..fe970889 --- /dev/null +++ b/doc/man/meson.build @@ -0,0 +1,39 @@ +if get_option('tools') + # Install tool man pages + install_man('serd-filter.1') + install_man('serd-pipe.1') + install_man('serd-sort.1') + install_man('serd-validate.1') + + # Build/install HTML man pages if mandoc is present + if mandoc.found() + configure_file(copy: true, + input: files('mandoc.css'), + output: 'mandoc.css', + # install: true, + install_dir: docdir / versioned_name / 'man') + + mandoc_html_command = [mandoc, + '-Thtml', + '-Wwarning', + '-Ostyle=mandoc.css,man=%N.html', + '@INPUT@'] + + page_names = [ + 'serd-filter', + 'serd-pipe', + 'serd-sort', + 'serd-validate', + ] + + foreach name : page_names + custom_target(name + '.1', + capture: true, + command: mandoc_html_command, + input: files(name + '.1'), + install: true, + install_dir: docdir / versioned_name / 'man', + output: name + '.html') + endforeach + endif +endif diff --git a/doc/serd-filter.1 b/doc/man/serd-filter.1 index e05559e2..e05559e2 100644 --- a/doc/serd-filter.1 +++ b/doc/man/serd-filter.1 diff --git a/doc/serd-pipe.1 b/doc/man/serd-pipe.1 index d94d4445..d94d4445 100644 --- a/doc/serd-pipe.1 +++ b/doc/man/serd-pipe.1 diff --git a/doc/serd-sort.1 b/doc/man/serd-sort.1 index 7fb02978..7fb02978 100644 --- a/doc/serd-sort.1 +++ b/doc/man/serd-sort.1 diff --git a/doc/serd-validate.1 b/doc/man/serd-validate.1 index 3d8c0035..3d8c0035 100644 --- a/doc/serd-validate.1 +++ b/doc/man/serd-validate.1 diff --git a/doc/meson.build b/doc/meson.build index 5555cfbb..870ff308 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -15,3 +15,4 @@ if not meson.is_subproject() and meson.version().version_compare('>=0.53.0') summary('Documentation', build_docs, bool_yn: true) endif +subdir('man') diff --git a/meson.build b/meson.build index 63a9ece5..352c1734 100644 --- a/meson.build +++ b/meson.build @@ -140,6 +140,9 @@ if host_machine.system() != 'windows' ] endif +# Programs used by the build +mandoc = find_program('mandoc', required: false) + # Determine library type and the flags needed to build it library_name = versioned_name if get_option('default_library') == 'both' @@ -243,12 +246,6 @@ pkg.generate( # Build command line tools if get_option('tools') subdir('tools') - - if not get_option('docs').disabled() - install_man('doc/serd-filter.1') - install_man('doc/serd-pipe.1') - install_man('doc/serd-sort.1') - endif endif # Install header to a versioned include directory |