Imported Upstream version 2.6.1
[debian/amanda] / man / xslt / man.xsl.in
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 <!-- the @..@ is substituted by config.status to contain the XSL release selected
8      at configure time -->
9 <xsl:import href="http://docbook.sourceforge.net/release/xsl/@XSLREL@/manpages/docbook.xsl"/>
10
11 <xsl:import href="settings.xsl"/>
12
13 <xsl:param name="chunk.section.depth" select="0"/>
14 <xsl:param name="chunk.first.sections" select="1"/>
15 <xsl:param name="use.id.as.filename" select="0"/>
16 <xsl:param name="refentry.meta.get.quietly" select="1"/>  <!-- silence warnings -->
17
18 <!--
19     Our ulink stylesheet omits @url part if content was specified
20 -->
21 <xsl:template match="ulink">
22   <xsl:variable name="content">
23     <xsl:apply-templates/>
24   </xsl:variable>
25   <xsl:if test="$content = ''">
26     <xsl:text>: </xsl:text>
27   </xsl:if>
28   <xsl:if test="$content != ''">
29     <xsl:value-of select="$content" />
30   </xsl:if>
31   <xsl:if test="$content = ''">
32     <xsl:apply-templates mode="italic" select="@url" />
33   </xsl:if>
34 </xsl:template>
35
36 <xsl:template match="informalexample|screen|programlisting">
37   <xsl:text>.nf&#10;</xsl:text>
38   <xsl:apply-templates/>
39   <xsl:text>.fi&#10;</xsl:text>
40 </xsl:template>
41
42 <xsl:template match="para|simpara|remark" mode="list">
43   <xsl:variable name="foo">
44     <xsl:apply-templates/>
45   </xsl:variable>
46   <xsl:choose match="node()">
47     <!-- Don't normalize-space() for verbatim paragraphs        -->
48     <xsl:when test="informalexample|screen|programlisting">
49       <xsl:value-of select="$foo"/>
50     </xsl:when>
51     <xsl:otherwise>
52       <xsl:value-of select="normalize-space($foo)"/>
53       <xsl:text>&#10;</xsl:text>
54     </xsl:otherwise>
55   </xsl:choose>
56   <xsl:text>&#10;</xsl:text>
57   <xsl:if test="following-sibling::para or following-sibling::simpara or
58                 following-sibling::remark">
59     <!-- Make sure multiple paragraphs within a list item don't -->
60     <!-- merge together.                                        -->
61     <xsl:text>&#10;</xsl:text>
62   </xsl:if>
63 </xsl:template>
64
65 <xsl:template match="refsect3">
66   <xsl:text>&#10;.SS "</xsl:text>
67   <xsl:value-of select="title[1]"/>
68   <xsl:text>"&#10;</xsl:text>
69   <xsl:apply-templates/>
70 </xsl:template>
71
72 <!-- fix authors -->
73 <!-- a modified, simplified version of the docbook affiliation template -->
74 <xsl:template match="affiliation" mode="authorsect">
75   <xsl:if test="./org/orgname">
76     <xsl:text>.RS 4&#10;</xsl:text>
77     <xsl:apply-templates select="./org/orgname" />
78     <xsl:if test="./org/uri">
79       <xsl:text> (</xsl:text><xsl:apply-templates select="./org/uri" /><xsl:text>)</xsl:text>
80     </xsl:if>
81   </xsl:if>
82   <xsl:text>&#10;.RE&#10;</xsl:text>
83 </xsl:template>
84
85 <xsl:template name="attribution">
86 <!-- no attributions -->
87 </xsl:template>
88
89 </xsl:stylesheet>