git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] Documentation: Add asciidoc.conf file and gitlink: macro

From
Sergey Vlasov <vsu@altlinux.ru>
Date
Sep 19, 2005, 10:10 UTC
Message-ID
<20050919101014.GB28095@master.mivlgu.local>
In-Reply-To
<20050919100914.GA28095@master.mivlgu.local>

Introduce an asciidoc.conf file with the purpose of adding a gitlink: macro which will improve the manpage output.

Original cogito patch by Jonas Fonseca <fonseca@diku.dk>; asciidoc.conf from that patch was further enhanced to use the proper DocBook tag <citerefentry> for references to man pages.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
---
 Documentation/Makefile      |    4 ++--
 Documentation/asciidoc.conf |   21 +++++++++++++++++++++
 2 files changed, 23 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/asciidoc.conf
9cd024949ba411edbb041faf03bdc03c825e76b4
diff --git a/Documentation/Makefile b/Documentation/Makefile
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -57,13 +57,13 @@ clean:
 	rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html
 
 %.html : %.txt
-	asciidoc -b xhtml11 -d manpage $<
+	asciidoc -b xhtml11 -d manpage -f asciidoc.conf $<
 
 %.1 %.7 : %.xml
 	xmlto man $<
 
 %.xml : %.txt
-	asciidoc -b docbook -d manpage $<
+	asciidoc -b docbook -d manpage -f asciidoc.conf $<
 
 git.html: git.txt ../README
 
diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf
new file mode 100644
--- /dev/null
+++ b/Documentation/asciidoc.conf
@@ -0,0 +1,21 @@
+## gitlink: macro
+#
+# Usage: gitlink: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.
+
+ifdef::backend-docbook[]
+[gitlink-inlinemacro]
+{0%{target}}
+{0#<citerefentry>}
+{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
+{0#</citerefentry>}
+endif::backend-docbook[]
+
+ifdef::backend-xhtml11[]
+[gitlink-inlinemacro]
+<a href="{target}.html">{target}{0?({0})}</a>
+endif::backend-xhtml11[]
Previous: Sergey VlasovNext: Sergey Vlasov
Message 2 of 3 in “Improve man pages formatting”
  1. 0/2 Improve man pages formattingSergey Vlasov, Sep 19, 2005
  2. 1/2 Documentation: Add asciidoc.conf file and gitlink: macroSergey Vlasov, Sep 19, 2005
  3. 2/2 Documentation: Update all files to use the new gitlink: macroSergey Vlasov, Sep 19, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.