aboutsummaryrefslogtreecommitdiffstats
path: root/doc/meson.build
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-11-28 09:58:22 -0500
committerDavid Robillard <d@drobilla.net>2024-12-19 19:55:39 -0500
commitb1c955b1e0e3ae6b4b0c74112ae68a2966a92d35 (patch)
treeadb35b8b9f9e310ea5de0437d791b26e2c574bb9 /doc/meson.build
parent5af9d9a0bff772f232d8a232a138c903ca5ba100 (diff)
downloadjalv-b1c955b1e0e3ae6b4b0c74112ae68a2966a92d35.tar.gz
jalv-b1c955b1e0e3ae6b4b0c74112ae68a2966a92d35.tar.bz2
jalv-b1c955b1e0e3ae6b4b0c74112ae68a2966a92d35.zip
Rewrite man pages in mdoc
Diffstat (limited to 'doc/meson.build')
-rw-r--r--doc/meson.build60
1 files changed, 54 insertions, 6 deletions
diff --git a/doc/meson.build b/doc/meson.build
index be25581..9a00094 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -1,12 +1,60 @@
-# Copyright 2022-2023 David Robillard <d@drobilla.net>
+# Copyright 2022-2024 David Robillard <d@drobilla.net>
# SPDX-License-Identifier: 0BSD OR ISC
-install_man(files('jalv.1'))
+docdir = get_option('datadir') / 'doc'
-if not get_option('gtk3').disabled()
- install_man(files('jalv.gtk3.1'))
+if not get_option('man').disabled()
+ install_man(files('jalv.1'))
+
+ if not get_option('gtk3').disabled()
+ install_man(files('jalv.gtk3.1'))
+ endif
+
+ if not get_option('qt5').disabled()
+ install_man(files('jalv.qt5.1'))
+ endif
+
+ if not get_option('qt6').disabled()
+ install_man(files('jalv.qt6.1'))
+ endif
endif
-if not get_option('qt5').disabled()
- install_man(files('jalv.qt5.1'))
+# Build/install HTML man pages if mandoc is present
+mandoc = find_program('mandoc', required: get_option('man_html'))
+if mandoc.found()
+ configure_file(
+ copy: true,
+ input: files('mandoc.css'),
+ output: 'mandoc.css',
+ install_dir: docdir / meson.project_name() / 'man',
+ )
+
+ mandoc_html_command = [
+ mandoc,
+ '-Kutf-8',
+ '-Ostyle=mandoc.css,man=%N.html',
+ '-Thtml',
+ '-Wwarning,stop', '@INPUT@',
+ ]
+
+ html_mandir = docdir / meson.project_name() / 'man'
+ foreach name : ['jalv', 'jalv.gtk3', 'jalv.qt5', 'jalv.qt6']
+ custom_target(
+ name + '.html',
+ capture: true,
+ command: mandoc_html_command,
+ input: files(name + '.1'),
+ install: true,
+ install_dir: html_mandir,
+ output: name + '.html',
+ )
+ endforeach
+
+ if not meson.is_subproject()
+ summary(
+ 'HTML man pages',
+ get_option('prefix') / html_mandir,
+ section: 'Directories',
+ )
+ endif
endif