Refresh VERSION file when building distribution tarball in "make dist"
[tig] / manpage.xsl
1 <!-- manpage.xsl: various fixups to docbook -> manpage output
2   -
3   - For now converts it adds a newline after preformatted text enclosed
4   - in screen.
5   -
6   -->
7
8 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
9 <xsl:template match="screen">
10         <xsl:text>.sp&#10;.nf&#10;</xsl:text>
11         <xsl:apply-templates/>
12         <xsl:text>&#10;.fi&#10;.sp&#10;</xsl:text>
13 </xsl:template>
14
15 <xsl:template match="simpara">
16   <xsl:variable name="content">
17     <xsl:apply-templates/>
18   </xsl:variable>
19   <xsl:value-of select="normalize-space($content)"/>
20   <xsl:text>&#10;</xsl:text>
21   <xsl:text>.sp&#10;</xsl:text>
22 </xsl:template>
23
24 <xsl:template match="address|literallayout|programlisting|screen|synopsis">
25   <!-- * Yes, address and synopsis are verbatim environments. -->
26
27   <xsl:choose>
28     <!-- * Check to see if this verbatim item is within a parent element that -->
29     <!-- * allows mixed content. -->
30     <!-- * -->
31     <!-- * If it is within a mixed-content parent, then a line space is -->
32     <!-- * already added before it by the mixed-block template, so we don't -->
33     <!-- * need to add one here. -->
34     <!-- * -->
35     <!-- * If it is not within a mixed-content parent, then we need to add a -->
36     <!-- * line space before it. -->
37     <xsl:when test="parent::caption|parent::entry|parent::para|
38                     parent::td|parent::th" /> <!-- do nothing -->
39     <xsl:otherwise>
40   <xsl:text>&#10;</xsl:text>
41       <xsl:text>.sp&#10;</xsl:text>
42     </xsl:otherwise>
43   </xsl:choose>
44   <xsl:text>.nf&#10;</xsl:text>
45   <xsl:apply-templates/>
46   <xsl:text>&#10;</xsl:text>
47   <xsl:text>&#10;&#10;.fi&#10;</xsl:text>
48   <!-- * if first following sibling node of this verbatim -->
49   <!-- * environment is a text node, output a line of space before it -->
50   <xsl:if test="following-sibling::node()[1][name(.) = '']">
51     <xsl:text>&#10;</xsl:text>
52     <xsl:text>.sp&#10;</xsl:text>
53   </xsl:if>
54 </xsl:template>
55 </xsl:stylesheet>