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[attributes]
11plus=+
12caret=^
13startsb=[
14endsb=]
15tilde=~
16
17ifdef::backend-docbook[]
18[gitlink-inlinemacro]
19{0%{target}}
20{0#<citerefentry>}
21{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
22{0#</citerefentry>}
23endif::backend-docbook[]
24
25ifdef::backend-docbook[]
26ifndef::docbook-xsl-172[]
27# "unbreak" docbook-xsl v1.68 for manpages. v1.69 works with or without this.
28# v1.72 breaks with this because it replaces dots not in roff requests.
29[listingblock]
30<example><title>{title}</title>
31<literallayout>
32ifdef::doctype-manpage[]
33 .ft C
34endif::doctype-manpage[]
35|
36ifdef::doctype-manpage[]
37 .ft
38endif::doctype-manpage[]
39</literallayout>
40{title#}</example>
41endif::docbook-xsl-172[]
42endif::backend-docbook[]
43
44ifdef::doctype-manpage[]
45ifdef::backend-docbook[]
46[header]
47template::[header-declarations]
48<refentry>
49<refmeta>
50<refentrytitle>{mantitle}</refentrytitle>
51<manvolnum>{manvolnum}</manvolnum>
52<refmiscinfo class="source">Git</refmiscinfo>
53<refmiscinfo class="version">{git_version}</refmiscinfo>
54<refmiscinfo class="manual">Git Manual</refmiscinfo>
55</refmeta>
56<refnamediv>
57 <refname>{manname}</refname>
58 <refpurpose>{manpurpose}</refpurpose>
59</refnamediv>
60endif::backend-docbook[]
61endif::doctype-manpage[]
62
63ifdef::backend-xhtml11[]
64[gitlink-inlinemacro]
65<a href="{target}.html">{target}{0?({0})}</a>
66endif::backend-xhtml11[]