5f2fcd5206d45bff7f2eb5757fe6a1ef6ab23aa2
[debian/amanda] / man / xslt / html.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@/html/docbook.xsl"/>
10
11 <xsl:import href="settings.xsl"/>
12
13 <xsl:param name="citerefentry.link" select="'1'"/>
14 <xsl:param name="css.decoration" select="1"/>
15 <xsl:param name="html.stylesheet" select="'amanda.css'"/>
16 <xsl:param name="html.stylesheet.type">text/css</xsl:param>
17 <xsl:param name="html.cleanup" select="1"/>
18 <xsl:param name="use.extensions" select="'0'"/>
19 <xsl:param name="use.id.as.filename" select="'0'"/>
20 <xsl:param name="use.local.olink.style" select="1"/>
21 <xsl:param name="use.role.as.xrefstyle" select="1"/>
22 <xsl:param name="refentry.generate.title" select="1"/>
23
24 <!-- generate correct links to other manpages -->
25 <xsl:template name="generate.citerefentry.link">
26   <xsl:value-of select="refentrytitle"/><xsl:text>.</xsl:text><xsl:value-of select="manvolnum"/><xsl:text>.html</xsl:text>
27 </xsl:template>
28
29 <!--  add missing AUTHOR(S) section -->
30 <!-- this section originated with fglrx_man:
31         http://vcs.wgdd.de/cvsweb/fglrx_man/fglrx_html.xsl?rev=1.5
32      License information from that file:
33         This file is free software. The copyright owner gives unlimited
34         permission to copy, distribute and modify it.
35   -->
36 <xsl:template match="refentry">
37   <div class="refentry">
38   <xsl:apply-templates/>
39   <xsl:choose>
40     <xsl:when test="refentryinfo//author">
41       <xsl:apply-templates select="refentryinfo" mode="authorsect"/>
42     </xsl:when>
43   </xsl:choose>
44   </div>
45 </xsl:template>
46
47 <xsl:template match="refentryinfo" mode="authorsect">
48   <div class="refsect1">
49     <h2>
50       <xsl:text>AUTHOR</xsl:text>
51       <xsl:if test="count(.//author)+count(.//othercredit)>1">
52         <xsl:text>S</xsl:text>
53       </xsl:if>
54     </h2>
55     <xsl:text>&#10;</xsl:text>
56     <xsl:if test="count(.//author)>0">
57       <p>
58         <xsl:text>This manual page was written by </xsl:text>
59         <xsl:for-each select=".//author">
60           <xsl:if test="position() > 1">
61             <xsl:choose>
62               <xsl:when test="position() = last()">
63                 <xsl:text> and </xsl:text>
64               </xsl:when>
65               <xsl:otherwise>
66                 <xsl:text>, </xsl:text>
67               </xsl:otherwise>
68             </xsl:choose>
69           </xsl:if>
70           <xsl:apply-templates select="." mode="authorsect"/>
71         </xsl:for-each>
72         <xsl:text>.</xsl:text>
73       </p>
74     </xsl:if>
75     <xsl:if test="count(.//othercredit)>0">
76       <p>
77         <xsl:text>Contributions were derived from </xsl:text>
78         <xsl:for-each select=".//othercredit">
79           <xsl:if test="position() > 1">
80             <xsl:choose>
81               <xsl:when test="position() = last()">
82                 <xsl:text> and </xsl:text>
83               </xsl:when>
84               <xsl:otherwise>
85                 <xsl:text>, </xsl:text>
86               </xsl:otherwise>
87             </xsl:choose>
88           </xsl:if>
89           <xsl:apply-templates select="." mode="authorsect"/>
90         </xsl:for-each>
91         <xsl:text>.</xsl:text>
92       </p>
93     </xsl:if>
94     <xsl:if test="count(.//editor)>0">
95       <p>
96         <xsl:text disable-output-escaping="yes">Edited by </xsl:text>
97         <xsl:for-each select=".//editor">
98           <xsl:if test="position() > 1">
99             <xsl:choose>
100               <xsl:when test="position() = last()">
101                 <xsl:text> and </xsl:text>
102               </xsl:when>
103               <xsl:otherwise>
104                 <xsl:text>, </xsl:text>
105               </xsl:otherwise>
106             </xsl:choose>
107           </xsl:if>
108           <xsl:apply-templates select="." mode="authorsect"/>
109         </xsl:for-each>
110         <xsl:text>.</xsl:text>
111       </p>
112     </xsl:if>
113   </div>
114 </xsl:template>
115
116 <xsl:template match="affiliation" mode="authorsect">
117   <xsl:choose>
118     <xsl:when test="./org/uri">
119       <a>
120        <xsl:attribute name="href">
121          <xsl:apply-templates select="./org/uri" />
122        </xsl:attribute>
123        <xsl:apply-templates select="./org/orgname" />
124       </a>
125     </xsl:when>
126     <xsl:otherwise>
127       <xsl:apply-templates select="./org/orgname" />
128     </xsl:otherwise>
129   </xsl:choose>
130 </xsl:template>
131
132 <xsl:template match="author|editor|othercredit" mode="authorsect">
133   <span class="{name(.)}">
134     <xsl:call-template name="anchor"/>
135     <xsl:call-template name="person.name"/>
136     <xsl:if test=".//email">
137       <xsl:text> </xsl:text>
138       <xsl:apply-templates select=".//email"/>
139     </xsl:if>
140     <xsl:if test=".//affiliation">
141       <xsl:text> (</xsl:text>
142       <xsl:apply-templates mode="authorsect" select="./affiliation"/>
143       <xsl:text>)</xsl:text>
144     </xsl:if>
145   </span>
146 </xsl:template>
147
148 </xsl:stylesheet>