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

[PATCH] doc: remove custom callouts format

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Apr 18, 2023, 01:18 UTC
Message-ID
<20230418011828.47851-1-felipe.contreras@gmail.com>

The code to render callouts for manpages comes from 17 years ago: 776e994af5 (Properly render asciidoc "callouts" in git man pages., 2006-04-28), and it was needed back then, but DocBook Stylesheets added support for that in 2008 [1], since 1.74.0 it hasn't been necessary.

What's worse: the format of the upstream callouts is much nicer than our hacked version.

Compare this:
     $ git diff            (1)
     $ git diff --cached   (2)
     $ git diff HEAD       (3)
  1. Changes in the working tree not yet staged for the next
     commit.
  2. Changes between the index and your last commit; what you
     would be committing if you run git commit without -a
     option.
  3. Changes in the working tree since your last commit; what
     you would be committing if you run git commit -a
To this:
     $ git diff            (1)
     $ git diff --cached   (2)
     $ git diff HEAD       (3)
 1. Changes in the working tree not yet staged for the next commit.
 2. Changes between the index and your last commit; what you would
 be committing if you run git commit without -a option.
 3. Changes in the working tree since your last commit; what you
 would be committing if you run git commit -a

Let's drop our unnecessary inferior custom format and use the official one.

[1] https://sourceforge.net/p/docbook/code/7842/
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 Documentation/manpage-normal.xsl | 15 ---------------
 1 file changed, 15 deletions(-)
diff --git a/Documentation/manpage-normal.xsl b/Documentation/manpage-normal.xsl
index a9c7ec69f4..e4c5874ed3 100644
--- a/Documentation/manpage-normal.xsl
+++ b/Documentation/manpage-normal.xsl
@@ -8,19 +8,4 @@
 <xsl:param name="man.output.quietly" select="1"/>
 <xsl:param name="refentry.meta.get.quietly" select="1"/>
 
-<!-- convert asciidoc callouts to man page format -->
-<xsl:template match="co">
-	<xsl:value-of select="concat('\fB(',substring-after(@id,'-'),')\fR')"/>
-</xsl:template>
-<xsl:template match="calloutlist">
-	<xsl:text>.sp&#10;</xsl:text>
-	<xsl:apply-templates/>
-	<xsl:text>&#10;</xsl:text>
-</xsl:template>
-<xsl:template match="callout">
-	<xsl:value-of select="concat('\fB',substring-after(@arearefs,'-'),'. \fR')"/>
-	<xsl:apply-templates/>
-	<xsl:text>.br&#10;</xsl:text>
-</xsl:template>
-
 </xsl:stylesheet>
-- 
2.40.0+fc1
Next: Jeff King
Message 1 of 9 in “doc: remove custom callouts format”
  1. doc: remove custom callouts formatFelipe Contreras, Apr 18, 2023
  2. Jeff KingApr 18, 2023
  3. Jeff KingApr 18, 2023
  4. Felipe ContrerasApr 18, 2023
  5. Felipe ContrerasApr 18, 2023
  6. Jeff KingApr 18, 2023
  7. Felipe ContrerasApr 18, 2023
  8. Jeff KingApr 18, 2023
  9. Felipe ContrerasApr 18, 2023

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.