3 # Usage: linkgit:command[manpage-section]
5 # Note, {0} is the manpage section, while {target} is the command.
7 # Show Git link as: <command>(<section>); if section is defined, else just show
11 (?su)[\\]?(?P<name>linkgit):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
25 ifdef::backend-docbook[]
29 {0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
31 endif::backend-docbook[]
33 ifdef::backend-docbook[]
34 ifndef::git-asciidoc-no-roff[]
35 # "unbreak" docbook-xsl v1.68 for manpages. v1.69 works with or without this.
36 # v1.72 breaks with this because it replaces dots not in roff requests.
38 <example><title>{title}</title>
39 <literallayout class="monospaced">
40 ifdef::doctype-manpage[]
42 endif::doctype-manpage[]
44 ifdef::doctype-manpage[]
46 endif::doctype-manpage[]
49 endif::git-asciidoc-no-roff[]
51 ifdef::git-asciidoc-no-roff[]
52 ifdef::doctype-manpage[]
53 # The following two small workarounds insert a simple paragraph after screen
55 <example><title>{title}</title>
56 <literallayout class="monospaced">
58 </literallayout><simpara></simpara>
62 <formalpara{id? id="{id}"}><title>{title}</title><para>
63 {title%}<literallayout{id? id="{id}"}>
64 {title#}<literallayout>
67 {title#}</para></formalpara>
68 {title%}<simpara></simpara>
69 endif::doctype-manpage[]
70 endif::git-asciidoc-no-roff[]
71 endif::backend-docbook[]
73 ifdef::doctype-manpage[]
74 ifdef::backend-docbook[]
76 template::[header-declarations]
79 <refentrytitle>{mantitle}</refentrytitle>
80 <manvolnum>{manvolnum}</manvolnum>
81 <refmiscinfo class="source">Git</refmiscinfo>
82 <refmiscinfo class="version">{git_version}</refmiscinfo>
83 <refmiscinfo class="manual">Git Manual</refmiscinfo>
86 <refname>{manname}</refname>
87 <refpurpose>{manpurpose}</refpurpose>
89 endif::backend-docbook[]
90 endif::doctype-manpage[]
92 ifdef::backend-xhtml11[]
94 git-relative-html-prefix=
96 <a href="{git-relative-html-prefix}{target}.html">{target}{0?({0})}</a>
97 endif::backend-xhtml11[]