Code

[PATCH] Documentation: Add asciidoc.conf file and gitlink: macro
authorSergey Vlasov <vsu@altlinux.ru>
Mon, 19 Sep 2005 10:10:14 +0000 (14:10 +0400)
committerJunio C Hamano <junkio@cox.net>
Tue, 20 Sep 2005 22:07:51 +0000 (15:07 -0700)
Introduce an asciidoc.conf file with the purpose of adding a gitlink:
macro which will improve the manpage output.

Original cogito patch by Jonas Fonseca <fonseca@diku.dk>;
asciidoc.conf from that patch was further enhanced to use the proper
DocBook tag <citerefentry> for references to man pages.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/Makefile
Documentation/asciidoc.conf [new file with mode: 0644]

index 37b7fcb97d659fd25246af4c124030d22554fc99..822098ad9ca24b84e3524787904c118874b2de79 100644 (file)
@@ -57,13 +57,13 @@ clean:
        rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html
 
 %.html : %.txt
-       asciidoc -b xhtml11 -d manpage $<
+       asciidoc -b xhtml11 -d manpage -f asciidoc.conf $<
 
 %.1 %.7 : %.xml
        xmlto man $<
 
 %.xml : %.txt
-       asciidoc -b docbook -d manpage $<
+       asciidoc -b docbook -d manpage -f asciidoc.conf $<
 
 git.html: git.txt ../README
 
diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf
new file mode 100644 (file)
index 0000000..baefb2f
--- /dev/null
@@ -0,0 +1,21 @@
+## gitlink: macro
+#
+# Usage: gitlink:command[manpage-section]
+#
+# Note, {0} is the manpage section, while {target} is the command.
+#
+# Show GIT link as: <command>(<section>); if section is defined, else just show
+# the command.
+
+ifdef::backend-docbook[]
+[gitlink-inlinemacro]
+{0%{target}}
+{0#<citerefentry>}
+{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
+{0#</citerefentry>}
+endif::backend-docbook[]
+
+ifdef::backend-xhtml11[]
+[gitlink-inlinemacro]
+<a href="{target}.html">{target}{0?({0})}</a>
+endif::backend-xhtml11[]