source: doc/user-guide/help.xsl @ c572dd6

Last change on this file since c572dd6 was b7d3cc34, checked in by Wilmer van der Gaast <wilmer@…>, at 2005-11-06T18:23:18Z

Initial repository (0.99 release tree)

  • Property mode set to 100644
File size: 5.3 KB
Line 
1<?xml version='1.0'?>
2<!--
3        Convert DocBook documentation to help.txt file used by bitlbee
4        (C) 2004 Jelmer Vernooij
5-->
6<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
7        version="1.1">
8
9        <xsl:output method="text" encoding="iso-8859-1" standalone="yes"/>
10        <xsl:strip-space elements="*"/>
11
12        <xsl:template match="text()">
13                <xsl:if test="starts-with(.,' ') and preceding-sibling::* and
14                        not(preceding-sibling::*[1]/node()[1][self::text() and contains(concat(.,'^$%'),' ^$%')])">
15                        <xsl:text> </xsl:text>
16                </xsl:if>
17       
18                <xsl:value-of select="normalize-space(.)"/>
19                <xsl:if test="contains(concat(.,'^$%'),' ^$%') and following-sibling::* and
20                        not(following-sibling::*[1]/node()[1][self::text() and starts-with(.,' ')])">
21                        <xsl:text> </xsl:text>
22                </xsl:if>
23        </xsl:template>
24
25        <xsl:template match="para">
26                <xsl:apply-templates/><xsl:text>&#10;</xsl:text>
27                <xsl:if test="$extraparanewline = '1'">
28                        <xsl:text>&#10;</xsl:text>
29                </xsl:if>
30        </xsl:template>
31
32        <xsl:template name="subject">
33                <xsl:message><xsl:text>Processing: </xsl:text><xsl:value-of select="$id"/></xsl:message>
34                <xsl:text>?</xsl:text><xsl:value-of select="$id"/><xsl:text>&#10;</xsl:text>
35
36                <xsl:for-each select="para|variablelist|simplelist|command-list|ircexample">
37                        <xsl:if test="title != ''">
38                                <xsl:value-of select="title"/><xsl:text>&#10;</xsl:text>
39                        </xsl:if>
40                        <xsl:apply-templates select="."/>
41                </xsl:for-each>
42                <xsl:text>%&#10;</xsl:text>
43
44                <xsl:for-each select="sect1|sect2">
45                        <xsl:call-template name="subject">
46                                <xsl:with-param name="id" select="@id"/>
47                        </xsl:call-template>
48                </xsl:for-each>
49
50                <xsl:for-each select="bitlbee-command">
51                        <xsl:call-template name="cmd">
52                                <xsl:with-param name="prefix" select="''"/>
53                        </xsl:call-template>
54                </xsl:for-each>
55
56                <xsl:for-each select="bitlbee-setting">
57                        <xsl:message><xsl:text>Processing setting '</xsl:text><xsl:value-of select="@name"/><xsl:text>'</xsl:text></xsl:message>
58                        <xsl:text>?set </xsl:text><xsl:value-of select="@name"/><xsl:text>&#10;</xsl:text>
59                        <xsl:text>_b_Type:_b_ </xsl:text><xsl:value-of select="@type"/><xsl:text>&#10;</xsl:text>
60                        <xsl:text>_b_Default:_b_ </xsl:text><xsl:value-of select="default"/><xsl:text>&#10;</xsl:text>
61                        <xsl:if test="possible-values">
62                                <xsl:text>_b_Possible Values:_b_ </xsl:text><xsl:value-of select="possible-values"/><xsl:text>&#10;</xsl:text>
63                        </xsl:if>
64                        <xsl:text>&#10;</xsl:text>
65                        <xsl:apply-templates select="description"/>
66                        <xsl:text>%&#10;</xsl:text>
67                </xsl:for-each>
68        </xsl:template>
69
70        <xsl:template match="command-list">
71                <xsl:for-each select="../bitlbee-command">
72                        <xsl:text> * _b_</xsl:text><xsl:value-of select="@name"/><xsl:text>_b_ - </xsl:text><xsl:value-of select="short-description"/><xsl:text>&#10;</xsl:text>
73                </xsl:for-each>
74                <xsl:text>&#10;</xsl:text>
75        </xsl:template>
76
77        <xsl:template match="preface|chapter|sect1|sect2">
78                <xsl:call-template name="subject">
79                        <xsl:with-param name="id" select="@id"/>
80                </xsl:call-template>
81        </xsl:template>
82
83        <xsl:template match="emphasis">
84                <xsl:text>_b_</xsl:text>
85                <xsl:apply-templates/>
86                <xsl:text>_b_</xsl:text>
87        </xsl:template>
88
89        <xsl:template match="book">
90                <xsl:apply-templates/>
91        </xsl:template>
92
93        <xsl:template match="variablelist">
94                <xsl:for-each select="varlistentry">
95                        <xsl:text> _b_</xsl:text><xsl:value-of select="term"/><xsl:text>_b_ - </xsl:text><xsl:value-of select="listitem/para"/><xsl:text>&#10;</xsl:text>
96                </xsl:for-each>
97                <xsl:text>&#10;</xsl:text>
98        </xsl:template>
99
100        <xsl:template match="simplelist">
101                <xsl:for-each select="member">
102                        <xsl:text> - </xsl:text><xsl:apply-templates/><xsl:text>&#10;</xsl:text>
103                </xsl:for-each>
104                <xsl:text>&#10;</xsl:text>
105        </xsl:template>
106
107        <xsl:template match="ircline">
108                <xsl:text>_b_&lt;</xsl:text><xsl:value-of select="@nick"/><xsl:text>&gt;_b_ </xsl:text><xsl:value-of select="."/><xsl:text>&#10;</xsl:text>
109        </xsl:template>
110
111        <xsl:template match="ircaction">
112                <xsl:text>_b_* </xsl:text><xsl:value-of select="@nick"/><xsl:text>_b_ </xsl:text><xsl:value-of select="."/><xsl:text>&#10;</xsl:text>
113        </xsl:template>
114
115        <xsl:template match="ircexample">
116                <xsl:apply-templates/>
117                <xsl:text>&#10;</xsl:text>
118        </xsl:template>
119
120        <xsl:template name="cmd">
121                <xsl:variable name="thiscmd"><xsl:value-of select="$prefix"/><xsl:value-of select="@name"/></xsl:variable>
122                <xsl:message><xsl:text>Processing command '</xsl:text><xsl:value-of select="$thiscmd"/><xsl:text>'</xsl:text></xsl:message>
123                <xsl:text>?</xsl:text><xsl:value-of select="$thiscmd"/><xsl:text>&#10;</xsl:text>
124                <xsl:for-each select="syntax">
125                        <xsl:text>_b_Syntax:_b_ </xsl:text><xsl:value-of select="."/><xsl:text>&#10;</xsl:text>
126                </xsl:for-each>
127                <xsl:text>&#10;</xsl:text>
128
129                <xsl:apply-templates select="description"/>
130
131                <xsl:for-each select="ircexample">
132                        <xsl:text>_b_Example:_b_&#10;</xsl:text>
133                        <xsl:apply-templates select="."/>
134                </xsl:for-each>
135
136                <!--
137                <xsl:if test="bitlbee-command != ''">
138                        <xsl:text>Subcommands: </xsl:text>
139                        <xsl:for-each select="bitlbee-command">
140                                <xsl:value-of select="@name"/><xsl:text>, </xsl:text>
141                        </xsl:for-each>
142                        <xsl:text>&#10;</xsl:text>
143                </xsl:if>
144                -->
145
146                <xsl:text>%&#10;</xsl:text>
147
148                <xsl:for-each select="bitlbee-command">
149                        <xsl:call-template name="cmd">
150                                <xsl:with-param name="prefix"><xsl:value-of select="$thiscmd"/><xsl:text> </xsl:text></xsl:with-param>
151                        </xsl:call-template>
152                </xsl:for-each>
153
154        </xsl:template>
155
156</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.