From: Felix Meinhold <felix.meinhold@gmx.net>
[apps/madmutt.git] / doc / muttng-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:muttng-doc="http://mutt-ng.berlios.de/doc/#NS"
15   >
16   
17   <xsl:output 
18     method="xml" 
19     doctype-public="-//OASIS//DTD DocBook XML V4.2//EN"
20     doctype-system="http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
21     indent="yes"
22     output-encoding="utf-8"
23   />
24   
25   <xsl:strip-space elements="*"/>
26
27  
28   <!-- as default, copy each node -->
29   <xsl:template match="/ | node() | @* | comment() | processing-instruction()">
30     <xsl:copy>
31       <xsl:apply-templates select="@* | node()"/>
32     </xsl:copy>
33   </xsl:template>
34
35   <xsl:template match="muttng-doc:man">
36     <literal>
37       <xsl:choose>
38         <xsl:when test="@sect">
39           <xsl:value-of select="concat(@name,'(',@sect,')')"/>
40         </xsl:when>
41         <xsl:otherwise>
42           <xsl:value-of select="concat(@name,'(1)')"/>
43         </xsl:otherwise>
44       </xsl:choose>
45     </literal>
46   </xsl:template>
47  
48   <xsl:template match="muttng-doc:envvar">
49      <literal><xsl:value-of select="concat('$', @name)"/></literal>
50      <indexterm>
51        <primary>Environment Variables</primary>
52        <secondary><xsl:value-of select="concat('$', @name)"/></secondary>
53      </indexterm>
54   </xsl:template> 
55
56   <xsl:template match="muttng-doc:hook">
57      <literal><xsl:value-of select="concat(@name, '-hook')"/></literal>
58      <indexterm>
59        <primary>Hooks</primary>
60        <secondary><xsl:value-of select="concat(@name, '-hook')"/></secondary>
61      </indexterm>
62   </xsl:template>
63
64   <xsl:template match="muttng-doc:command">
65      <literal><xsl:value-of select="@name"/></literal>
66      <indexterm>
67        <primary>Configuration Commands</primary>
68        <secondary><xsl:value-of select="@name"/></secondary>
69      </indexterm>
70   </xsl:template>
71
72   <xsl:template match="muttng-doc:pattern">
73      <literal>~<xsl:value-of select="@name"/>/=<xsl:value-of select="@name"/></literal>
74      <indexterm>
75        <primary>Patterns</primary>
76        <secondary>~<xsl:value-of select="@name"/>/=<xsl:value-of select="@name"/></secondary>
77      </indexterm>
78   </xsl:template>
79
80   <xsl:template match="muttng-doc:funcdef">
81      <literal>&lt;<xsl:value-of select="@name"/>&gt;</literal> (default: <xsl:value-of select="@key"/>)
82      <anchor id="func-{@name}"/>
83      <indexterm>
84        <primary>Functions</primary>
85        <secondary><xsl:value-of select="@name"/></secondary>
86      </indexterm>
87   </xsl:template>
88
89   <xsl:template match="muttng-doc:funcref">
90     <!-- currently b0rken as not all defined via :funcdef yet ;-((
91     <link linkend="func-{@name}">
92     -->
93       <xsl:value-of select="concat('&lt;',@name,'&gt;')"/>
94     <!--
95     </link>
96     -->
97     <indexterm>
98       <primary>Functions</primary>
99       <secondary><xsl:value-of select="@name"/></secondary>
100     </indexterm>
101   </xsl:template>
102
103   <xsl:template match="muttng-doc:vardef">
104     <sect1 id="{@id}">
105       <title><xsl:value-of select="concat('$',@name)"/></title>
106       <indexterm>
107         <primary>Configuration Variables</primary>
108         <secondary><xsl:value-of select="@name"/></secondary>
109       </indexterm>
110       <xsl:value-of select="text()"/>
111     </sect1>
112   </xsl:template>
113  
114   <xsl:template match="muttng-doc:varref">
115     <link>
116       <xsl:choose>
117         <xsl:when test="@link">
118           <xsl:param name="linkend" value="@link"/>
119         </xsl:when>
120         <xsl:otherwise>
121           <xsl:param name="linkend" value="@name"/>
122         </xsl:otherwise>
123       </xsl:choose>
124       <xsl:value-of select="concat('$',@name)"/>
125     </link>
126     <indexterm>
127       <primary>Configuration Variables</primary>
128       <secondary><xsl:value-of select="@name"/></secondary>
129     </indexterm>
130   </xsl:template>
131
132   <xsl:template match="/">
133     <xsl:apply-templates select="*"/>
134   </xsl:template>
135
136 </xsl:stylesheet>