[PATCH/RFC 1/6] modified asciidoc macros for dashless git doc

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Michael J Gruber
Date: Friday, September 12, 2008 - 3:55 am

This introduces a new macro "link-git" which prepends "git-" or "git "
to the link target, depending on the backend. We keep the dash for the
docbook backend because some man viewers depend on it. There are no
dashes for the html backend.

This patch also renames the existing "linkgit" macro to "linkgitasis", in
preparation for the upcoming changes. This makes it easier to split the
changes into parts: dashed form for server type programmes, dashless
form for all other commands.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
 Documentation/asciidoc.conf |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf
index 40d43b7..efc8bd3 100644
--- a/Documentation/asciidoc.conf
+++ b/Documentation/asciidoc.conf
@@ -1,11 +1,15 @@
-## linkgit: macro
+## linkgitasis: macro
 #
-# Usage: linkgit:command[manpage-section]
+# Usage: linkgitasis:command[manpage-section]
 #
 # Note, {0} is the manpage section, while {target} is the command.
 #
 # Show GIT link as: <command>(<section>); if section is defined, else just show
 # the command.
+#
+## link-git: macro
+#
+# Like linkgitasis, but prepends "git " or "git -" to the target, depending on the backend.
 
 [attributes]
 asterisk=&#42;
@@ -16,11 +20,16 @@ endsb=&#93;
 tilde=&#126;
 
 ifdef::backend-docbook[]
-[linkgit-inlinemacro]
+[linkgitasis-inlinemacro]
 {0%{target}}
 {0#<citerefentry>}
 {0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
 {0#</citerefentry>}
+[link-git-inlinemacro]
+{0%{target}}
+{0#<citerefentry>}
+{0#<refentrytitle>git-{target}</refentrytitle><manvolnum>{0}</manvolnum>}
+{0#</citerefentry>}
 endif::backend-docbook[]
 
 ifdef::backend-docbook[]
@@ -62,6 +71,8 @@ endif::backend-docbook[]
 endif::doctype-manpage[]
 
 ifdef::backend-xhtml11[]
-[linkgit-inlinemacro]
+[linkgitasis-inlinemacro]
 <a href="{target}.html">{target}{0?({0})}</a>
+[link-git-inlinemacro]
+<a href="{target}.html">git {target}{0?({0})}</a>
 endif::backend-xhtml11[]
-- 
1.6.0.1.308.gede4c

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH/RFC 0/6] Documentation: use dashless links, Michael J Gruber, (Fri Sep 12, 3:55 am)
[PATCH/RFC 1/6] modified asciidoc macros for dashless git doc, Michael J Gruber, (Fri Sep 12, 3:55 am)
[PATCH/RFC 2/6] convert doc links for server type programmes, Michael J Gruber, (Fri Sep 12, 3:55 am)
[PATCH/RFC 3/6] convert doc links for non-dashed git commands, Michael J Gruber, (Fri Sep 12, 3:55 am)