]> git.ipfire.org Git - network.git/commitdiff
man: Add asciidoc configuration file
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 26 Sep 2018 22:22:59 +0000 (00:22 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 31 Mar 2019 12:47:04 +0000 (14:47 +0200)
This adds a short command to link to other man pages

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
man/asciidoc.conf [new file with mode: 0644]

index c4f8b453e5ddcb86d2f3582dba090734cf3d86c2..ebf3be7aa48544028b2f72d4b83e41630075eb22 100644 (file)
@@ -508,14 +508,18 @@ XSLTPROC_COMMAND_MAN = \
        $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
                http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
 
-man/%.xml: man/%.txt
-       $(AM_V_ASCIIDOC)$(ASCIIDOC) -d manpage -b docbook -o $@ $<
+man/%.xml: man/%.txt man/asciidoc.conf
+       $(AM_V_ASCIIDOC)$(ASCIIDOC) \
+               -f man/asciidoc.conf \
+               -d manpage -b docbook -o $@ $<
 
 man/%.8: man/%.xml
        $(XSLTPROC_COMMAND_MAN)
 
-man/%.html: man/%.txt
-       $(AM_V_ASCIIDOC)$(ASCIIDOC) -b html5 -a icons -a theme=flask -o $@ $<
+man/%.html: man/%.txt man/asciidoc.conf
+       $(AM_V_ASCIIDOC)$(ASCIIDOC) \
+               -f man/asciidoc.conf \
+               -b html5 -a icons -a theme=flask -o $@ $<
 
 # ------------------------------------------------------------------------------
 
diff --git a/man/asciidoc.conf b/man/asciidoc.conf
new file mode 100644 (file)
index 0000000..243f81f
--- /dev/null
@@ -0,0 +1,12 @@
+ifdef::backend-docbook[]
+[link-inlinemacro]
+{0%{target}}
+{0#<citerefentry>}
+{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
+{0#</citerefentry>}
+endif::backend-docbook[]
+
+ifdef::backend-html5[]
+[link-inlinemacro]
+<a href="{target}.html">{target}{0?({0})}</a>
+endif::backend-html5[]