Documentation / asciidoc.confon commit Merge branch 'jk/maint-show-tag' (d0410af)
   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=&#42;
  15plus=&#43;
  16caret=&#94;
  17startsb=&#91;
  18endsb=&#93;
  19tilde=&#126;
  20backtick=&#96;
  21
  22ifdef::backend-docbook[]
  23[linkgit-inlinemacro]
  24{0%{target}}
  25{0#<citerefentry>}
  26{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
  27{0#</citerefentry>}
  28endif::backend-docbook[]
  29
  30ifdef::backend-docbook[]
  31ifndef::git-asciidoc-no-roff[]
  32# "unbreak" docbook-xsl v1.68 for manpages. v1.69 works with or without this.
  33# v1.72 breaks with this because it replaces dots not in roff requests.
  34[listingblock]
  35<example><title>{title}</title>
  36<literallayout>
  37ifdef::doctype-manpage[]
  38&#10;.ft C&#10;
  39endif::doctype-manpage[]
  40|
  41ifdef::doctype-manpage[]
  42&#10;.ft&#10;
  43endif::doctype-manpage[]
  44</literallayout>
  45{title#}</example>
  46endif::git-asciidoc-no-roff[]
  47
  48ifdef::git-asciidoc-no-roff[]
  49ifdef::doctype-manpage[]
  50# The following two small workarounds insert a simple paragraph after screen
  51[listingblock]
  52<example><title>{title}</title>
  53<literallayout>
  54|
  55</literallayout><simpara></simpara>
  56{title#}</example>
  57
  58[verseblock]
  59<formalpara{id? id="{id}"}><title>{title}</title><para>
  60{title%}<literallayout{id? id="{id}"}>
  61{title#}<literallayout>
  62|
  63</literallayout>
  64{title#}</para></formalpara>
  65{title%}<simpara></simpara>
  66endif::doctype-manpage[]
  67endif::git-asciidoc-no-roff[]
  68endif::backend-docbook[]
  69
  70ifdef::doctype-manpage[]
  71ifdef::backend-docbook[]
  72[header]
  73template::[header-declarations]
  74<refentry>
  75<refmeta>
  76<refentrytitle>{mantitle}</refentrytitle>
  77<manvolnum>{manvolnum}</manvolnum>
  78<refmiscinfo class="source">Git</refmiscinfo>
  79<refmiscinfo class="version">{git_version}</refmiscinfo>
  80<refmiscinfo class="manual">Git Manual</refmiscinfo>
  81</refmeta>
  82<refnamediv>
  83  <refname>{manname}</refname>
  84  <refpurpose>{manpurpose}</refpurpose>
  85</refnamediv>
  86endif::backend-docbook[]
  87endif::doctype-manpage[]
  88
  89ifdef::backend-xhtml11[]
  90[linkgit-inlinemacro]
  91<a href="{target}.html">{target}{0?({0})}</a>
  92endif::backend-xhtml11[]