Skip to content

Commit 776e994

Browse files
loopsJunio C Hamano
authored andcommitted
Properly render asciidoc "callouts" in git man pages.
Adds an xsl fragment to render docbook callouts when converting to man page format. Update the Makefile to have "xmlto" use it when generating man pages. Signed-off-by: Sean Estabrooks <[email protected]>
1 parent 48aeecd commit 776e994

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

Documentation/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ clean:
7979
asciidoc -b xhtml11 -d manpage -f asciidoc.conf $<
8080

8181
%.1 %.7 : %.xml
82-
xmlto man $<
82+
xmlto -m callouts.xsl man $<
8383

8484
%.xml : %.txt
8585
asciidoc -b docbook -d manpage -f asciidoc.conf $<

Documentation/callouts.xsl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!-- callout.xsl: converts asciidoc callouts to man page format -->
2+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3+
<xsl:template match="co">
4+
<xsl:value-of select="concat('\fB(',substring-after(@id,'-'),')\fR')"/>
5+
</xsl:template>
6+
<xsl:template match="calloutlist">
7+
<xsl:text>.sp&#10;</xsl:text>
8+
<xsl:apply-templates/>
9+
<xsl:text>&#10;</xsl:text>
10+
</xsl:template>
11+
<xsl:template match="callout">
12+
<xsl:value-of select="concat('\fB',substring-after(@arearefs,'-'),'. \fR')"/>
13+
<xsl:apply-templates/>
14+
<xsl:text>.br&#10;</xsl:text>
15+
</xsl:template>
16+
</xsl:stylesheet>

0 commit comments

Comments
 (0)