| 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] |
| 11 | caret=^ |
| 12 | startsb=[ |
| 13 | endsb=] |
| 14 | tilde=~ |
| 15 | |
| 16 | ifdef::backend-docbook[] |
| 17 | [gitlink-inlinemacro] |
| 18 | {0%{target}} |
| 19 | {0#<citerefentry>} |
| 20 | {0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>} |
| 21 | {0#</citerefentry>} |
| 22 | endif::backend-docbook[] |
| 23 | |
| 24 | ifdef::backend-docbook[] |
| 25 | # "unbreak" docbook-xsl v1.68 for manpages. v1.69 works with or without this. |
| 26 | [listingblock] |
| 27 | <example><title>{title}</title> |
| 28 | <literallayout> |
| 29 | | |
| 30 | </literallayout> |
| 31 | {title#}</example> |
| 32 | endif::backend-docbook[] |
| 33 | |
| 34 | ifdef::backend-xhtml11[] |
| 35 | [gitlink-inlinemacro] |
| 36 | <a href="{target}.html">{target}{0?({0})}</a> |
| 37 | endif::backend-xhtml11[] |
| 38 | |
| 39 | # stglink |
| 40 | |
| 41 | ifdef::backend-docbook[] |
| 42 | [stglink-inlinemacro] |
| 43 | <citerefentry> |
| 44 | <refentrytitle>stg {target}</refentrytitle><manvolnum>1</manvolnum> |
| 45 | </citerefentry> |
| 46 | endif::backend-docbook[] |
| 47 | |
| 48 | ifdef::backend-xhtml11[] |
| 49 | [stglink-inlinemacro] |
| 50 | <a href="stg-{target}.html">stg {target}(1)</a> |
| 51 | endif::backend-xhtml11[] |
| 52 | |
| 53 | # stgdesc |
| 54 | [stgdesc-inlinemacro] |
| 55 | {sys:../stg help|grep " {target}" | tr -s ' '| cut -d' ' -f3-} |
| 56 | |
| 57 | [stgdesc-blockmacro] |
| 58 | stglink:{target}[]:: |
| 59 | stgdesc:{target}[] |