1## linkgit: macro
2#
3# Usage: linkgit: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[macros]
11(?su)[\\]?(?P<name>linkgit):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
12
13[attributes]
14asterisk=*
15plus=+
16caret=^
17startsb=[
18endsb=]
19tilde=~
20
21ifdef::backend-docbook[]
22[linkgit-inlinemacro]
23{0%{target}}
24{0#<citerefentry>}
25{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
26{0#</citerefentry>}
27endif::backend-docbook[]
28
29ifdef::backend-docbook[]
30ifndef::docbook-xsl-172[]
31# "unbreak" docbook-xsl v1.68 for manpages. v1.69 works with or without this.
32# v1.72 breaks with this because it replaces dots not in roff requests.
33[listingblock]
34<example><title>{title}</title>
35<literallayout>
36ifdef::doctype-manpage[]
37 .ft C
38endif::doctype-manpage[]
39|
40ifdef::doctype-manpage[]
41 .ft
42endif::doctype-manpage[]
43</literallayout>
44{title#}</example>
45endif::docbook-xsl-172[]
46
47ifdef::docbook-xsl-172[]
48ifdef::doctype-manpage[]
49# The following two small workarounds insert a simple paragraph after screen
50[listingblock]
51<example><title>{title}</title>
52<screen>
53|
54</screen><simpara></simpara>
55{title#}</example>
56
57[verseblock]
58<formalpara{id? id="{id}"}><title>{title}</title><para>
59{title%}<literallayout{id? id="{id}"}>
60{title#}<literallayout>
61|
62</literallayout><simpara></simpara>
63{title#}</para></formalpara>
64endif::doctype-manpage[]
65endif::docbook-xsl-172[]
66endif::backend-docbook[]
67
68ifdef::doctype-manpage[]
69ifdef::backend-docbook[]
70[header]
71template::[header-declarations]
72<refentry>
73<refmeta>
74<refentrytitle>{mantitle}</refentrytitle>
75<manvolnum>{manvolnum}</manvolnum>
76<refmiscinfo class="source">Git</refmiscinfo>
77<refmiscinfo class="version">{git_version}</refmiscinfo>
78<refmiscinfo class="manual">Git Manual</refmiscinfo>
79</refmeta>
80<refnamediv>
81 <refname>{manname}</refname>
82 <refpurpose>{manpurpose}</refpurpose>
83</refnamediv>
84endif::backend-docbook[]
85endif::doctype-manpage[]
86
87ifdef::backend-xhtml11[]
88[linkgit-inlinemacro]
89<a href="{target}.html">{target}{0?({0})}</a>
90endif::backend-xhtml11[]