@matheusbsbs / matheus-bagliano / commits / ae8d09b8fa
Fork 0

Documentation: use parametrized manpage-base.xsl with manpage-{1.72,normal}.xsl

Parametrize the backslash and dot characters that are used to generate roff control sequences in manpage-base.xsl. Testing done with asciidoc 8.3.1 and docbook-xsl 1.74.0. Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Chris Johnsen committed Mar 27, 2009 at 01:43 UTC ae8d09b8fa138aeb8ec3e20819360241dfb9f0b8
3 files changed +46 -52
Documentation/manpage-1.72.xsl
+13 -16
@@ -1,21 +1,18 @@
1 -<!-- Based on callouts.xsl. Fixes man page callouts for DocBook 1.72 XSL -->
2 -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
1 +<!-- manpage-1.72.xsl:
2 + special settings for manpages rendered from asciidoc+docbook
3 + handles peculiarities in docbook-xsl 1.72.0 -->
4 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5 + version="1.0">
6
7 +<xsl:import href="manpage-base.xsl"/>
8 +
9 +<!-- these are the special values for the roff control characters
10 + needed for docbook-xsl 1.72.0 -->
11 +<xsl:param name="git.docbook.backslash">&#x2593;</xsl:param>
12 +<xsl:param name="git.docbook.dot" >&#x2302;</xsl:param>
13 +
14 +<!-- these params silence some output from xmlto -->
15 <xsl:param name="man.output.quietly" select="1"/>
16 <xsl:param name="refentry.meta.get.quietly" select="1"/>
17
7 -<xsl:template match="co">
8 - <xsl:value-of select="concat('&#x2593;fB(',substring-after(@id,'-'),')&#x2593;fR')"/>
9 -</xsl:template>
10 -<xsl:template match="calloutlist">
11 - <xsl:text>&#x2302;sp&#10;</xsl:text>
12 - <xsl:apply-templates/>
13 - <xsl:text>&#10;</xsl:text>
14 -</xsl:template>
15 -<xsl:template match="callout">
16 - <xsl:value-of select="concat('&#x2593;fB',substring-after(@arearefs,'-'),'. &#x2593;fR')"/>
17 - <xsl:apply-templates/>
18 - <xsl:text>&#x2302;br&#10;</xsl:text>
19 -</xsl:template>
20 -
18 </xsl:stylesheet>
Documentation/manpage-base.xsl
+20 -19
@@ -1,30 +1,31 @@
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">
1 +<!-- manpage-base.xsl:
2 + special formatting for manpages rendered from asciidoc+docbook -->
3 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 + version="1.0">
5 +
6 +<!-- convert asciidoc callouts to man page format;
7 + git.docbook.backslash and git.docbook.dot params
8 + must be supplied by another XSL file or other means -->
9 <xsl:template match="co">
4 - <xsl:value-of select="concat('\fB(',substring-after(@id,'-'),')\fR')"/>
10 + <xsl:value-of select="concat(
11 + $git.docbook.backslash,'fB(',
12 + substring-after(@id,'-'),')',
13 + $git.docbook.backslash,'fR')"/>
14 </xsl:template>
15 <xsl:template match="calloutlist">
7 - <xsl:text>.sp&#10;</xsl:text>
16 + <xsl:value-of select="$git.docbook.dot"/>
17 + <xsl:text>sp&#10;</xsl:text>
18 <xsl:apply-templates/>
19 <xsl:text>&#10;</xsl:text>
20 </xsl:template>
21 <xsl:template match="callout">
12 - <xsl:value-of select="concat('\fB',substring-after(@arearefs,'-'),'. \fR')"/>
22 + <xsl:value-of select="concat(
23 + $git.docbook.backslash,'fB',
24 + substring-after(@arearefs,'-'),
25 + '. ',$git.docbook.backslash,'fR')"/>
26 <xsl:apply-templates/>
14 - <xsl:text>.br&#10;</xsl:text>
15 -</xsl:template>
16 -
17 -<!-- sorry, this is not about callouts, but attempts to work around
18 - spurious .sp at the tail of the line docbook stylesheets seem to add -->
19 -<xsl:template match="simpara">
20 - <xsl:variable name="content">
21 - <xsl:apply-templates/>
22 - </xsl:variable>
23 - <xsl:value-of select="normalize-space($content)"/>
24 - <xsl:if test="not(ancestor::authorblurb) and
25 - not(ancestor::personblurb)">
26 - <xsl:text>&#10;&#10;</xsl:text>
27 - </xsl:if>
27 + <xsl:value-of select="$git.docbook.dot"/>
28 + <xsl:text>br&#10;</xsl:text>
29 </xsl:template>
30
31 </xsl:stylesheet>
Documentation/manpage-normal.xsl
+13 -17
@@ -1,21 +1,17 @@
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>
1 +<!-- manpage-normal.xsl:
2 + special settings for manpages rendered from asciidoc+docbook
3 + handles anything we want to keep away from docbook-xsl 1.72.0 -->
4 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5 + version="1.0">
6 +
7 +<xsl:import href="manpage-base.xsl"/>
8 +
9 +<!-- these are the normal values for the roff control characters -->
10 +<xsl:param name="git.docbook.backslash">\</xsl:param>
11 +<xsl:param name="git.docbook.dot" >.</xsl:param>
12
17 -<!-- sorry, this is not about callouts, but attempts to work around
18 - spurious .sp at the tail of the line docbook stylesheets seem to add -->
13 +<!-- attempt to work around spurious .sp at the tail of the line
14 + that docbook stylesheets seem to add -->
15 <xsl:template match="simpara">
16 <xsl:variable name="content">
17 <xsl:apply-templates/>