doc: Add asciidoc.conf
authorToni Gundogdu <legatvs@gmail.com>
Mon, 25 Mar 2013 20:53:30 +0000 (25 22:53 +0200)
committerToni Gundogdu <legatvs@gmail.com>
Mon, 25 Mar 2013 21:02:45 +0000 (25 23:02 +0200)
This file adds the linkman macro. See the comment field for the
instructions. This is a modified version from the pacman (of Arch Linux)
source tree uses to produce the manpages: this macro does not insert
<date>.

Signed-off-by: Toni Gundogdu <legatvs@gmail.com>
doc/Makefile.am
doc/asciidoc.conf [new file with mode: 0644]

index 5dffbec..58755e0 100644 (file)
@@ -1,3 +1,5 @@
+EXTRA_DIST=asciidoc.conf
+
 SUBDIRS=
 if WITH_MANUAL
 SUBDIRS+=man7
diff --git a/doc/asciidoc.conf b/doc/asciidoc.conf
new file mode 100644 (file)
index 0000000..4411572
--- /dev/null
@@ -0,0 +1,64 @@
+## linkman: macro
+# Inspired by/borrowed from the pacman source tree at doc/asciidoc.conf
+#
+# Usage: linkman:command[manpage-section]
+#
+# Note, {0} is the manpage section, while {target} is the command.
+#
+# Show man link as: <command>(<section>); if section is defined, else just show
+# the command.
+
+[macros]
+(?su)[\\]?(?P<name>linkman):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
+
+[attributes]
+asterisk=&#42;
+plus=&#43;
+caret=&#94;
+startsb=&#91;
+endsb=&#93;
+backslash=&#92;
+tilde=&#126;
+apostrophe=&#39;
+backtick=&#96;
+litdd=&#45;&#45;
+
+ifdef::backend-docbook[]
+[linkman-inlinemacro]
+{0%{target}}
+{0#<citerefentry>}
+{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
+{0#</citerefentry>}
+endif::backend-docbook[]
+
+ifdef::backend-docbook[]
+ifndef::docbook-xsl-172[]
+# "unbreak" docbook-xsl v1.68 for manpages. v1.69 works with or without this.
+# v1.72 breaks with this because it replaces dots not in roff requests.
+[listingblock]
+<example><title>{title}</title>
+<literallayout>
+|
+</literallayout>
+{title#}</example>
+endif::docbook-xsl-172[]
+endif::backend-docbook[]
+
+ifdef::doctype-manpage[]
+ifdef::backend-docbook[]
+[header]
+template::[header-declarations]
+<refentry>
+<refmeta>
+<refentrytitle>{mantitle}</refentrytitle>
+<manvolnum>{manvolnum}</manvolnum>
+<refmiscinfo class="source">libquvi-scripts</refmiscinfo>
+<refmiscinfo class="version">{pkg_version}</refmiscinfo>
+<refmiscinfo class="manual">libquvi-scripts Manual</refmiscinfo>
+</refmeta>
+<refnamediv>
+  <refname>{manname}</refname>
+  <refpurpose>{manpurpose}</refpurpose>
+</refnamediv>
+endif::backend-docbook[]
+endif::doctype-manpage[]