Fix comparison between int and size_t
[apps/madmutt.git] / doc / madmutt-manual.xsl
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!-- written for mutt-ng by: -->
4 <!-- Felix Meinhold <felix.meinhold@gmx.net> -->
5
6 <!-- some more things were added/ajusted by: -->
7 <!-- Rocco Rutte <pdmef@cs.tu-berlin.de> -->
8
9 <!-- see "Hacking Documentation" chapter of the Fine Manual for -->
10 <!-- usage details -->
11   
12 <xsl:stylesheet version="1.0"
13   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
14   xmlns:madmutt-doc="http://mutt-ng.berlios.de/doc/#NS"
15   >
16   
17   <xsl:output 
18     method="xml" 
19     doctype-public="-//OASIS//DTD DocBook XML V4.3//EN"
20     doctype-system="http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
21     indent="yes"
22     output-encoding="utf-8"
23   />
24   
25   <xsl:strip-space elements="*"/>
26  
27   <!-- as default, copy each node -->
28   <xsl:template match="/ | node() | @* | comment() | processing-instruction()">
29     <xsl:copy>
30       <xsl:apply-templates select="@* | node()"/>
31     </xsl:copy>
32   </xsl:template>
33
34   <xsl:template match="madmutt-doc:man">
35     <literal>
36       <xsl:choose>
37         <xsl:when test="@sect">
38           <xsl:value-of select="concat(@name,'(',@sect,')')"/>
39         </xsl:when>
40         <xsl:otherwise>
41           <xsl:value-of select="concat(@name,'(1)')"/>
42         </xsl:otherwise>
43       </xsl:choose>
44     </literal>
45   </xsl:template>
46  
47   <xsl:template match="madmutt-doc:envvar">
48      <literal><xsl:value-of select="concat('$', @name)"/></literal>
49      <indexterm>
50        <primary sortas="{@name}"><literal>$<xsl:value-of select="@name"/></literal></primary>
51      </indexterm>
52   </xsl:template> 
53
54   <xsl:template match="madmutt-doc:hook">
55      <literal><link linkend="{concat(@name, '-hook')}"><xsl:value-of select="concat(@name, '-hook')"/></link></literal>
56      <indexterm>
57        <primary sortas="{@name}-hook"><literal><xsl:value-of select="concat(@name, '-hook')"/></literal></primary>
58      </indexterm>
59   </xsl:template>
60
61   <xsl:template match="madmutt-doc:cmddef">
62     <xsl:choose>
63       <xsl:when test="@noanchor='1'"/>
64       <xsl:otherwise>
65         <anchor id="command-{translate(@name,'_','-')}"/>
66       </xsl:otherwise>
67     </xsl:choose>
68     Usage: <literal><xsl:value-of select="@name"/></literal> <emphasis><xsl:apply-templates/></emphasis>
69     <indexterm>
70       <primary sortas="{@name}"><literal><xsl:value-of select="@name"/></literal></primary>
71      </indexterm>
72    </xsl:template>
73
74    <xsl:template match="madmutt-doc:cmdref">
75      <link linkend="command-{translate(@name,'_','-')}"><literal><xsl:value-of select="@name"/></literal></link>
76      <indexterm>
77        <primary sortas="{@name}"><literal><xsl:value-of select="@name"/></literal></primary>
78      </indexterm>
79    </xsl:template>
80  
81   <xsl:template match="madmutt-doc:pattern">
82     <literal>~<xsl:value-of select="@name"/></literal>
83     <xsl:if test="@full='1'">/<literal>=<xsl:value-of select="@name"/></literal></xsl:if>
84      <indexterm>
85        <primary sortas="~{@name}"><literal>~<xsl:value-of select="@name"/></literal>/
86          <literal>=<xsl:value-of select="@name"/></literal></primary>
87      </indexterm>
88   </xsl:template>
89
90   <xsl:template match="madmutt-doc:funcdef">
91      <literal>&lt;<xsl:value-of select="@name"/>&gt;</literal> (default: <xsl:apply-templates/>)
92      <anchor id="func-{@name}"/>
93      <indexterm>
94        <primary sortas="{@name}"><literal>&lt;<xsl:value-of select="@name"/>&gt;</literal></primary>
95      </indexterm>
96   </xsl:template>
97
98   <xsl:template match="madmutt-doc:funcref">
99     <!-- currently b0rken as not all defined via :funcdef yet ;-((
100     <link linkend="func-{@name}">
101     -->
102       <xsl:value-of select="concat('&lt;',@name,'&gt;')"/>
103     <!--
104     </link>
105     -->
106     <indexterm>
107       <primary sortas="{@name}"><literal>&lt;<xsl:value-of select="@name"/>&gt;</literal></primary>
108     </indexterm>
109   </xsl:template>
110
111   <xsl:template match="madmutt-doc:vardef">
112     <sect1 id="{translate(@name,'_','-')}">
113       <title><xsl:value-of select="concat('$',@name)"/></title>
114       <indexterm>
115         <primary sortas="{@name}"><literal>$<xsl:value-of select="@name"/></literal></primary>
116       </indexterm>
117       <xsl:apply-templates/>
118     </sect1>
119   </xsl:template>
120  
121   <xsl:template match="madmutt-doc:varref">
122     <link linkend="{@name}"><literal><xsl:value-of select="concat('$',translate(@name,'-','_'))"/></literal></link><indexterm>
123       <primary sortas="{@name}"><literal>$<xsl:value-of select="translate(@name,'-','_')"/></literal></primary>
124     </indexterm>
125   </xsl:template>
126
127   <xsl:template match="madmutt-doc:web">
128     <ulink url="{@url}"><literal>&lt;<xsl:value-of select="@url"/>&gt;</literal></ulink>
129   </xsl:template>
130
131   <xsl:template match="madmutt-doc:rfc">
132     <ulink url="{concat('http://www.faqs.org/rfcs/rfc', @num, '.html')}">RfC <xsl:value-of select="@num"/></ulink>
133     <indexterm><primary>RfC</primary><secondary><xsl:value-of select="@num"/></secondary></indexterm>
134   </xsl:template>
135
136   <xsl:template match="madmutt-doc:lstconf">
137     <screen>
138       <xsl:apply-templates/>
139     </screen>
140   </xsl:template>
141
142   <xsl:template match="madmutt-doc:lstmail">
143     <screen>
144       <xsl:apply-templates/>
145     </screen>
146   </xsl:template>
147
148   <xsl:template match="madmutt-doc:lstshell">
149     <screen>
150       <xsl:apply-templates/>
151     </screen>
152   </xsl:template>
153
154   <xsl:template match="madmutt-doc:key">
155     <literal>
156       <xsl:if test="@mod">
157         <xsl:value-of select="concat(@mod,'-')"/>
158       </xsl:if>
159       <xsl:apply-templates/>
160     </literal>
161   </xsl:template>
162
163   <xsl:template match="madmutt-doc:special">
164     <xsl:value-of select="@docbook"/>
165   </xsl:template>
166
167 </xsl:stylesheet>