{"thread":{"id":"1370","subject":"[PATCH] Documentation: Add asciidoc.conf file and gitlink: macro","startedAt":"2005-07-30T13:33:46Z","lastAt":"2005-07-30T13:33:46Z","messageCount":1,"participants":["Jonas Fonseca"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"6633","messageId":"20050730133346.GA23664@diku.dk","threadId":"1370","inReplyTo":null,"subject":"[PATCH] Documentation: Add asciidoc.conf file and gitlink: macro","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2005-07-30T13:33:46Z","receivedAt":"2005-07-30T13:33:46Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Introduce an asciidoc.conf file with the purpose of adding a gitlink: macro\nwhich will improve the manpage output. Most notably this changes the following\nin cogito.7\n\n   ...\n       cg-add: cg-add.html [-N] FILE...\n              Add files to the GIT repository.\n\n       cg-branch-add: cg-branch-add.html BRANCH_NAME LOCATION\n              Add new branch to the GIT repository.\n   ...\n\nto\n\n   ...\n       cg-add [-N] FILE...\n              Add files to the GIT repository.\n\n       cg-branch-add BRANCH_NAME LOCATION\n              Add new branch to the GIT repository.\n   ...\n\nSigned-off-by: Jonas Fonseca <fonseca@diku.dk>\n---\n\nI only did the Cogito part, since it was a lot easier. If this is\ndesirable for the GIT core manpages I'd be happy to provide a similar\npatch to remove the confusing .html links from GIT manpages.\n\n Documentation/Makefile             |    4 ++--\n Documentation/asciidoc.conf        |   18 ++++++++++++++++++\n Documentation/make-cg-asciidoc     |    6 +++---\n Documentation/make-cogito-asciidoc |   19 ++++++++++---------\n 4 files changed, 33 insertions(+), 14 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -48,13 +48,13 @@ clean:\n \trm -f *.xml *.html *.1 *.7 cg-*.txt cogito.txt\n \n %.html : %.txt\n-\tasciidoc -b xhtml11 -d manpage $<\n+\tasciidoc -b xhtml11 -d manpage -f asciidoc.conf $<\n \n %.1 %.7 : %.xml\n \txmlto man $<\n \n %.xml : %.txt\n-\tasciidoc -b docbook -d manpage $<\n+\tasciidoc -b docbook -d manpage -f asciidoc.conf $<\n \n cogito.txt : make-cogito-asciidoc\n \t./make-cogito-asciidoc > $@\ndiff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf\nnew file mode 100644\n--- /dev/null\n+++ b/Documentation/asciidoc.conf\n@@ -0,0 +1,18 @@\n+## gitlink: macro\n+#\n+# Usage: gitlink:command[manpage-section]\n+#\n+# Note, {0} is the manpage section, while {target} is the command.\n+#\n+# Show GIT link as: <command>(<section>); if section is defined, else just show\n+# the command.\n+\n+ifdef::backend-docbook[]\n+[gitlink-inlinemacro]\n+{target}{0?({0})}\n+endif::backend-docbook[]\n+\n+ifdef::backend-xhtml11[]\n+[gitlink-inlinemacro]\n+<a href=\"{target}.html\">{target}{0?({0})}</a>\n+endif::backend-xhtml11[]\ndiff --git a/Documentation/make-cg-asciidoc b/Documentation/make-cg-asciidoc\n--- a/Documentation/make-cg-asciidoc\n+++ b/Documentation/make-cg-asciidoc\n@@ -40,7 +40,7 @@ CAPTION=$(echo \"$HEADER\" | head -n 1 | t\n # were referenced as \"`cg-command`\". This way references from cg-* combos in\n # code listings will be ignored.\n BODY=$(echo \"$HEADER\" | sed '0,/^$/d' \\\n-\t\t      | sed 's/`\\(cg-[a-z-]\\+\\)`/link:\\1.html[\\1]/')\n+\t\t      | sed 's/`\\(cg-[a-z-]\\+\\)`/gitlink:\\1[1]/')\n \n DESCRIPTION=\n OPTIONS=\n@@ -108,6 +108,6 @@ $COPYRIGHT\n \n SEE ALSO\n --------\n-$COMMAND command is part of link:cogito.html[cogito(7)],\n-a toolkit for managing link:git.html[git(1)] trees.\n+$COMMAND command is part of gitlink:cogito[7],\n+a toolkit for managing gitlink:git[7] trees.\n __END__\ndiff --git a/Documentation/make-cogito-asciidoc b/Documentation/make-cogito-asciidoc\n--- a/Documentation/make-cogito-asciidoc\n+++ b/Documentation/make-cogito-asciidoc\n@@ -8,10 +8,11 @@ ADVANCED_COMMANDS=\"$(ls ../cg-admin-*)\"\n HELPER_COMMANDS=\"$(ls ../cg-X*) $(ls ../*-id | grep -v git-)\"\n \n # Shorthand for the link markup.\n-link()\n+man()\n {\n-\tcommand=\"$1\"\n-\techo \"link:$command.html['$command']\"\n+\tsection=\"$1\"\n+\tcommand=\"$2\"\n+\techo \"gitlink:$command[$section]\"\n }\n \n # Print description list entry.\n@@ -28,7 +29,7 @@ print_command_info()\n \t\t;;\n \tcg-*)\n \t\tusage=$(sed -n '/^USAGE=/,0s/.*cg-[^ ]*\\(.*\\)\"/\\1/p' < $command)\n-\t\techo \"link:$cmdname.html[$cmdname] $usage::\"\n+\t\techo \"gitlink:$cmdname[] $usage::\"\n \t\t;;\n \tesac\n \techo \"\t$caption\"\n@@ -62,7 +63,7 @@ storage system. Amongst some of the note\n for branching, tagging and multiple backends for distributing repositories\n (local files, rsync, HTTP, ssh).\n \n-'Cogito' is implemented as a series of 'bash(1)' scripts on top of $(link git)\n+'Cogito' is implemented as a series of 'bash(1)' scripts on top of $(man 7 git)\n (a content-tracking filesystem) with the goal of providing an interface for\n working with the 'GIT' database in a manner similar to other SCM tools (like\n 'CVS', 'BitKeeper' or 'Monotone').\n@@ -107,21 +108,21 @@ $(print_command_listing $HELPER_COMMANDS\n Command Identifiers\n -------------------\n BRANCH_NAME::\n-\tIndicates a branch name added with the $(link cg-branch-add) command.\n+\tIndicates a branch name added with the $(man 1 cg-branch-add) command.\n \n COMMAND::\n \tIndicates a 'Cogito' command. The \\`cg-\\` prefix is optional.\n \n LOCATION::\n-\tIndicates a local file path or a URI. See $(link cg-branch-add) for a\n+\tIndicates a local file path or a URI. See $(man 1 cg-branch-add) for a\n \tlist of supported URI schemes.\n \n COMMIT_ID, FROM_ID, TO_ID, BASE_COMMIT::\n \tIndicates an ID resolving to a commit. The following expressions can\n \tbe used interchangably as IDs:\n \t- empty string, 'this' or 'HEAD' (current HEAD)\n-\t- branch name (as registered with $(link cg-branch-add))\n-\t- tag name (as registered with $(link cg-tag))\n+\t- branch name (as registered with $(man 1 cg-branch-add))\n+\t- tag name (as registered with $(man 1 cg-tag))\n \t- date string (as recognized by the 'date' tool)\n \t- shortcut object hash (shorted unambiguous hash lead)\n \t- commit object hash (as returned by 'commit-id')\n\n-- \nJonas Fonseca\n"}]}