Skip to content

Commit d1c2e11

Browse files
sigprofJunio C Hamano
authored andcommitted
[PATCH] Documentation: Add asciidoc.conf file and gitlink: macro
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>
1 parent af61c6e commit d1c2e11

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

Documentation/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ clean:
5757
rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html
5858

5959
%.html : %.txt
60-
asciidoc -b xhtml11 -d manpage $<
60+
asciidoc -b xhtml11 -d manpage -f asciidoc.conf $<
6161

6262
%.1 %.7 : %.xml
6363
xmlto man $<
6464

6565
%.xml : %.txt
66-
asciidoc -b docbook -d manpage $<
66+
asciidoc -b docbook -d manpage -f asciidoc.conf $<
6767

6868
git.html: git.txt ../README
6969

Documentation/asciidoc.conf

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## gitlink: macro
2+
#
3+
# Usage: gitlink:command[manpage-section]
4+
#
5+
# Note, {0} is the manpage section, while {target} is the command.
6+
#
7+
# Show GIT link as: <command>(<section>); if section is defined, else just show
8+
# the command.
9+
10+
ifdef::backend-docbook[]
11+
[gitlink-inlinemacro]
12+
{0%{target}}
13+
{0#<citerefentry>}
14+
{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
15+
{0#</citerefentry>}
16+
endif::backend-docbook[]
17+
18+
ifdef::backend-xhtml11[]
19+
[gitlink-inlinemacro]
20+
<a href="{target}.html">{target}{0?({0})}</a>
21+
endif::backend-xhtml11[]

0 commit comments

Comments
 (0)