aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-08-31 23:02:14 -0400
committerDavid Robillard <d@drobilla.net>2023-09-22 23:54:50 -0400
commit702830465ac87867fa4051a9be5036ef0b795c13 (patch)
treeb622b24311da2017d3f4904f9a099c467417c32c /doc
parentd28682c92d400d5eb5a2ef19d4b88c34bfcf5eea (diff)
downloadserd-702830465ac87867fa4051a9be5036ef0b795c13.tar.gz
serd-702830465ac87867fa4051a9be5036ef0b795c13.tar.bz2
serd-702830465ac87867fa4051a9be5036ef0b795c13.zip
Move man pages to their own directory
Diffstat (limited to 'doc')
-rw-r--r--doc/man/mandoc.css (renamed from doc/mandoc.css)0
-rw-r--r--doc/man/meson.build71
-rw-r--r--doc/man/serdi.1 (renamed from doc/serdi.1)0
-rw-r--r--doc/meson.build51
4 files changed, 77 insertions, 45 deletions
diff --git a/doc/mandoc.css b/doc/man/mandoc.css
index 9d255992..9d255992 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..323a8c4d
--- /dev/null
+++ b/doc/man/meson.build
@@ -0,0 +1,71 @@
+# Copyright 2020-2023 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+mandoc_css = files('mandoc.css')
+
+if get_option('lint')
+ stylelint = find_program('stylelint', required: get_option('tests'))
+ if stylelint.found()
+ test('stylelint', stylelint, args: [mandoc_css], suite: 'data')
+ endif
+endif
+
+if not get_option('tools').disabled()
+ # Install tool man pages
+ if not get_option('man').disabled()
+ if not meson.is_subproject()
+ summary(
+ 'Man pages',
+ get_option('prefix') / get_option('mandir'),
+ section: 'Directories',
+ )
+ endif
+
+ install_man(files('serdi.1'))
+ endif
+
+ # 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: mandoc_css,
+ output: 'mandoc.css',
+ install_dir: docdir / versioned_name / 'man',
+ )
+
+ mandoc_html_command = [
+ mandoc,
+ '-Kutf-8',
+ '-Ostyle=mandoc.css,man=%N.html',
+ '-Thtml',
+ '-Wwarning,stop',
+ '@INPUT@',
+ ]
+
+ page_names = [
+ 'serdi',
+ ]
+
+ html_mandir = docdir / versioned_name / 'man'
+ foreach name : page_names
+ 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
+endif
diff --git a/doc/serdi.1 b/doc/man/serdi.1
index f3e42756..f3e42756 100644
--- a/doc/serdi.1
+++ b/doc/man/serdi.1
diff --git a/doc/meson.build b/doc/meson.build
index b492483d..7180ec28 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -4,6 +4,12 @@
docdir = get_option('datadir') / 'doc'
#############
+# Man pages #
+#############
+
+subdir('man')
+
+#############
# Reference #
#############
@@ -65,48 +71,3 @@ if build_docs
endif
endforeach
endif
-
-#############
-# Man Pages #
-#############
-
-mandoc_css = files('mandoc.css')
-
-if get_option('lint')
- stylelint = find_program('stylelint', required: false)
- if stylelint.found()
- test('stylelint', stylelint, args: [mandoc_css], suite: 'data')
- endif
-endif
-
-mandoc = find_program('mandoc', required: false)
-if mandoc.found()
- configure_file(input: mandoc_css, output: '@PLAINNAME@', copy: true)
-
- serdi_html = custom_target(
- 'serdi.html',
- build_by_default: true,
- capture: true,
- command: [
- mandoc,
- '-Kutf-8',
- '-Ostyle=mandoc.css,man=%N.html',
- '-Thtml',
- '-Wwarning,stop',
- '@INPUT@',
- ],
- input: files('serdi.1'),
- output: 'serdi.html',
- )
-endif
-
-if not meson.is_subproject()
- summary(
- {
- 'HTML man pages': mandoc.found(),
- 'API documentation': build_docs,
- },
- bool_yn: true,
- section: 'Components',
- )
-endif