[tracker-miners/wip/carlosg/a2x] docs: Fix generation of manpages with asciidoc 10




commit cb87aa8d643af34805a69322088edf3fcac7e231
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Feb 16 11:31:54 2022 +0100

    docs: Fix generation of manpages with asciidoc 10
    
    We should use asciidoc's `a2x` driver instead of running xsltproc
    ourselves. asciidoc 10 ships its stylesheets in a private directory.
    Copied from a similar update in Tracker by Jan Alexander Steffens.
    
    Related: https://gitlab.gnome.org/GNOME/tracker/-/issues/347

 docs/manpages/meson.build                          | 57 ++++++++++------------
 ...ker-miner-fs.1.txt => tracker-miner-fs-3.1.txt} |  0
 ...r-miner-rss.1.txt => tracker-miner-rss-3.1.txt} |  0
 ...r-writeback.1.txt => tracker-writeback-3.1.txt} |  0
 ...{tracker-daemon.1.txt => tracker3-daemon.1.txt} |  0
 ...racker-extract.1.txt => tracker3-extract.1.txt} |  0
 .../{tracker-index.1.txt => tracker3-index.1.txt}  |  0
 .../{tracker-info.1.txt => tracker3-info.1.txt}    |  0
 .../{tracker-reset.1.txt => tracker3-reset.1.txt}  |  0
 ...{tracker-search.1.txt => tracker3-search.1.txt} |  0
 ...{tracker-status.1.txt => tracker3-status.1.txt} |  0
 .../{tracker-tag.1.txt => tracker3-tag.1.txt}      |  0
 meson.build                                        |  3 +-
 13 files changed, 26 insertions(+), 34 deletions(-)
---
diff --git a/docs/manpages/meson.build b/docs/manpages/meson.build
index 0b8a64863..992c446c9 100644
--- a/docs/manpages/meson.build
+++ b/docs/manpages/meson.build
@@ -1,50 +1,43 @@
 daemon_manpages = [
-    ['miner-fs', 'tracker-miner-fs-3', 1],
-    ['writeback', 'tracker-writeback-3', 1],
+    ['tracker-miner-fs-3', 1],
+    ['tracker-writeback-3', 1],
 ]
 
 if have_tracker_miner_rss
-  daemon_manpages += [['miner-rss', 'tracker-miner-rss-3', 1]]
+  daemon_manpages += [['tracker-miner-rss-3', 1]]
 endif
 
 cli_manpages = [
-  ['daemon', 'tracker3-daemon', 1],
-  ['extract', 'tracker3-extract', 1],
-  ['index', 'tracker3-index', 1],
-  ['info', 'tracker3-info', 1],
-  ['reset', 'tracker3-reset', 1],
-  ['search', 'tracker3-search', 1],
-  ['status', 'tracker3-status', 1],
-  ['tag', 'tracker3-tag', 1],
+  ['tracker3-daemon', 1],
+  ['tracker3-extract', 1],
+  ['tracker3-index', 1],
+  ['tracker3-info', 1],
+  ['tracker3-reset', 1],
+  ['tracker3-search', 1],
+  ['tracker3-status', 1],
+  ['tracker3-tag', 1],
 ]
 
 foreach m : daemon_manpages + cli_manpages
-  src = m[0]
-  dst = m[1]
-  section = m[2]
+  name = m[0]
+  section = m[1]
 
-  manpage_src = 'tracker-@0@.@1@.txt'.format(src, section)
-  manpage_xml = '@0@.@1@.xml'.format(dst, section)
-  manpage = '@0@.@1@'.format(dst, section)
+  manpage = '@0@.@1@'.format(name, section)
 
-  xml = custom_target(manpage_xml,
-    command: [asciidoc,
+  xml = custom_target(manpage,
+    command: [a2x,
               '--attribute=author=The Tracker developers',
               '--attribute=manversion=@0@'.format(meson.project_version()),
               '--attribute=manmanual=Tracker manual',
-              '--backend', 'docbook',
-              '--doctype', 'manpage',
-              '--out-file', '@OUTPUT@', '@INPUT@'],
-    input: manpage_src,
-    output: manpage_xml
-  )
-
-  custom_target(manpage,
-    command: [xsltproc,
-              '--output', '@OUTPUT@',
-              '--stringparam', 'man.authors.section.enabled', '0',
-              '/etc/asciidoc/docbook-xsl/manpage.xsl', '@INPUT@'],
-    input: xml,
+              '--doctype=manpage',
+              '--format=manpage',
+              '--no-xmllint',
+              '--xsltproc-opts=' + ' '.join([
+                '--stringparam', 'man.authors.section.enabled', '0',
+              ]),
+              '-D', '@OUTDIR@',
+              '@INPUT@'],
+    input: manpage + '.txt',
     output: manpage,
     install: true,
     install_dir: get_option('mandir') / 'man@0@'.format(section),
diff --git a/docs/manpages/tracker-miner-fs.1.txt b/docs/manpages/tracker-miner-fs-3.1.txt
similarity index 100%
rename from docs/manpages/tracker-miner-fs.1.txt
rename to docs/manpages/tracker-miner-fs-3.1.txt
diff --git a/docs/manpages/tracker-miner-rss.1.txt b/docs/manpages/tracker-miner-rss-3.1.txt
similarity index 100%
rename from docs/manpages/tracker-miner-rss.1.txt
rename to docs/manpages/tracker-miner-rss-3.1.txt
diff --git a/docs/manpages/tracker-writeback.1.txt b/docs/manpages/tracker-writeback-3.1.txt
similarity index 100%
rename from docs/manpages/tracker-writeback.1.txt
rename to docs/manpages/tracker-writeback-3.1.txt
diff --git a/docs/manpages/tracker-daemon.1.txt b/docs/manpages/tracker3-daemon.1.txt
similarity index 100%
rename from docs/manpages/tracker-daemon.1.txt
rename to docs/manpages/tracker3-daemon.1.txt
diff --git a/docs/manpages/tracker-extract.1.txt b/docs/manpages/tracker3-extract.1.txt
similarity index 100%
rename from docs/manpages/tracker-extract.1.txt
rename to docs/manpages/tracker3-extract.1.txt
diff --git a/docs/manpages/tracker-index.1.txt b/docs/manpages/tracker3-index.1.txt
similarity index 100%
rename from docs/manpages/tracker-index.1.txt
rename to docs/manpages/tracker3-index.1.txt
diff --git a/docs/manpages/tracker-info.1.txt b/docs/manpages/tracker3-info.1.txt
similarity index 100%
rename from docs/manpages/tracker-info.1.txt
rename to docs/manpages/tracker3-info.1.txt
diff --git a/docs/manpages/tracker-reset.1.txt b/docs/manpages/tracker3-reset.1.txt
similarity index 100%
rename from docs/manpages/tracker-reset.1.txt
rename to docs/manpages/tracker3-reset.1.txt
diff --git a/docs/manpages/tracker-search.1.txt b/docs/manpages/tracker3-search.1.txt
similarity index 100%
rename from docs/manpages/tracker-search.1.txt
rename to docs/manpages/tracker3-search.1.txt
diff --git a/docs/manpages/tracker-status.1.txt b/docs/manpages/tracker3-status.1.txt
similarity index 100%
rename from docs/manpages/tracker-status.1.txt
rename to docs/manpages/tracker3-status.1.txt
diff --git a/docs/manpages/tracker-tag.1.txt b/docs/manpages/tracker3-tag.1.txt
similarity index 100%
rename from docs/manpages/tracker-tag.1.txt
rename to docs/manpages/tracker3-tag.1.txt
diff --git a/meson.build b/meson.build
index 50f30f3b2..9432f19db 100644
--- a/meson.build
+++ b/meson.build
@@ -106,8 +106,7 @@ if have_tracker_miner_rss
 endif
 
 if get_option('man')
-  asciidoc = find_program('asciidoc')
-  xsltproc = find_program('xsltproc')
+  a2x = find_program('a2x')
 endif
 
 sha256sum = find_program('sha256sum')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]