Imported Upstream version 2.5.1p3
[debian/amanda] / man / xslt / man.xsl
1 <?xml version='1.0'?>
2 <!-- vim:set sts=2 shiftwidth=2 syntax=xml: -->
3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4                 version='1.0'>
5
6
7 <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/>
8
9 <xsl:import href="settings.xsl"/>
10
11 <xsl:param name="chunk.section.depth" select="0"/>
12 <xsl:param name="chunk.first.sections" select="1"/>
13 <xsl:param name="use.id.as.filename" select="1"/>
14
15 <!-- 
16     Our ulink stylesheet omits @url part if content was specified
17 -->
18 <xsl:template match="ulink">
19   <xsl:variable name="content">
20     <xsl:apply-templates/>
21   </xsl:variable>
22   <xsl:if test="$content = ''">
23     <xsl:text>: </xsl:text>
24   </xsl:if>
25   <xsl:if test="$content != ''">
26     <xsl:value-of select="$content" />
27   </xsl:if>
28   <xsl:if test="$content = ''">
29     <xsl:apply-templates mode="italic" select="@url" />
30   </xsl:if>
31 </xsl:template>
32
33 <xsl:template match="informalexample|screen|programlisting">
34   <xsl:text>.nf&#10;</xsl:text>
35   <xsl:apply-templates/>
36   <xsl:text>.fi&#10;</xsl:text>
37 </xsl:template>
38
39 <xsl:template match="para|simpara|remark" mode="list">
40   <xsl:variable name="foo">
41     <xsl:apply-templates/>
42   </xsl:variable>
43   <xsl:choose match="node()">
44     <!-- Don't normalize-space() for verbatim paragraphs        -->
45     <xsl:when test="informalexample|screen|programlisting">
46       <xsl:value-of select="$foo"/>
47     </xsl:when>
48     <xsl:otherwise>
49       <xsl:value-of select="normalize-space($foo)"/>
50       <xsl:text>&#10;</xsl:text>
51     </xsl:otherwise>
52   </xsl:choose>
53   <xsl:text>&#10;</xsl:text>
54   <xsl:if test="following-sibling::para or following-sibling::simpara or
55                 following-sibling::remark">
56     <!-- Make sure multiple paragraphs within a list item don't -->
57     <!-- merge together.                                        -->
58     <xsl:text>&#10;</xsl:text>
59   </xsl:if>
60 </xsl:template>
61
62 <xsl:template match="refsect3">
63   <xsl:text>&#10;.SS "</xsl:text>
64   <xsl:value-of select="title[1]"/>
65   <xsl:text>"&#10;</xsl:text>
66   <xsl:apply-templates/>
67 </xsl:template>
68
69
70 </xsl:stylesheet>