]> git.itanic.dy.fi Git - maemo-mapper/blob - data/help/tohtml.xsl
Added donation button.
[maemo-mapper] / data / help / tohtml.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet version="1.0"
3                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4
5 <!--
6  -
7  - Copyright (C) 2006, 2007 John Costigan.
8  -
9  - This file is part of Maemo Mapper.
10  -
11  - Maemo Mapper is free software: you can redistribute it and/or modify
12  - it under the terms of the GNU General Public License as published by
13  - the Free Software Foundation, either version 3 of the License, or
14  - (at your option) any later version.
15  -
16  - Maemo Mapper is distributed in the hope that it will be useful,
17  - but WITHOUT ANY WARRANTY; without even the implied warranty of
18  - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  - GNU General Public License for more details.
20  -
21  - You should have received a copy of the GNU General Public License
22  - along with Maemo Mapper.  If not, see <http://www.gnu.org/licenses/>.
23  -
24 -->
25
26 <xsl:output method="html"/>
27
28
29 <!-- Root element. -->
30
31 <xsl:template match="ossohelpsource">
32   <html>
33   <head><title><xsl:value-of select="folder/title"/></title></head>
34
35   <!-- Everything else -->
36   <body>
37   <xsl:apply-templates />
38   </body>
39
40   </html>
41 </xsl:template>
42
43
44 <!-- Sections (folder, topic) -->
45
46 <xsl:template match="folder">
47   <!-- Introduction -->
48   <xsl:apply-templates select="title"/>
49   <p>
50     This page is an HTML version of the built-in documentation that is
51     available within Maemo Mapper via the "Help" main menu item.
52   </p>
53
54   <p>
55     If you use Maemo Mapper and would like to show your appreciation for
56     it, or if you have a feature that you would like added to Maemo
57     Mapper, please consider donating money via PayPal.
58   </p>
59
60   <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
61     <p>
62       <input type="hidden" name="cmd" value="_s-xclick"/>
63       <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"/>
64       <img alt="" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"/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2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDYwNTEwMjAwMzI0WjAjBgkqhkiG9w0BCQQxFgQUS8mmmoO/csf0wOXxgMeHd/y6/HowDQYJKoZIhvcNAQEBBQAEgYB3UYQqHvJPPZ62FQlxW33p/7q4RAMffzUmXZlAMKIuX5ycakbq4FEJUGxX1HW03tl3Pj3En1EiUg5T+MGbsEDV49pV32QX3yvSjUKke26BIq0vrKYxxfTbwryPeqPHGLizIaCBfZOlffeKq0UDVDvS6iZ/fi7h1+r1qRC4UNvQ4A==-----END PKCS7-----"/>
66     </p>
67   </form>
68
69   <!-- Table of Contents -->
70   <h2 id="help_maemomapper_">Table of Contents</h2>
71   <ul>
72     <xsl:for-each select="topic">
73       <li>
74         <xsl:element name="a">
75           <xsl:attribute name="href">
76             <xsl:choose>
77               <xsl:when test="context/@contextUID">
78                 #<xsl:value-of select="context/@contextUID"/>
79               </xsl:when>
80               <xsl:otherwise>
81                 #<xsl:value-of select="translate(topictitle, ' ', '_')"/>
82                 <xsl:text>_topictitle</xsl:text>
83               </xsl:otherwise>
84             </xsl:choose>
85           </xsl:attribute>
86           <xsl:value-of select="topictitle"/>
87         </xsl:element>
88         <ul>
89           <xsl:for-each select="heading">
90             <li>
91             <xsl:element name="a">
92               <xsl:attribute name="href">
93                 #<xsl:value-of select="translate(../context/@contextUID, ' ', '_')"/>
94                 <xsl:text>_</xsl:text>
95                 <xsl:value-of select="translate(., ' ', '_')"/>
96                 <xsl:text>_heading</xsl:text>
97               </xsl:attribute>
98               <xsl:value-of select="."/>
99             </xsl:element>
100             </li>
101           </xsl:for-each>
102         </ul>
103       </li>
104     </xsl:for-each>
105   </ul>
106   <xsl:apply-templates select="topic"/>
107 </xsl:template>
108
109 <xsl:template match="topic">
110   <xsl:element name="div">
111     <xsl:attribute name="id">
112       <xsl:value-of select="context/@contextUID"/>
113     </xsl:attribute>
114     <xsl:apply-templates />
115   </xsl:element>
116 </xsl:template>
117
118
119 <!-- Headings (title = h1, topictitle = h2, heading = h3) -->
120
121 <xsl:template match="title">
122   <h1><xsl:apply-templates /></h1>
123 </xsl:template>
124
125 <xsl:template match="topictitle">
126   <xsl:element name="h2">
127     <xsl:attribute name="id">
128       <xsl:value-of select="translate(., ' ', '_')"/>
129       <xsl:text>_topictitle</xsl:text>
130     </xsl:attribute>
131     <xsl:apply-templates />
132   </xsl:element>
133 </xsl:template>
134
135 <xsl:template match="heading">
136   <xsl:element name="h3">
137     <xsl:attribute name="id">
138       <xsl:value-of select="translate(../context/@contextUID, ' ', '_')"/>_<xsl:value-of select="translate(., ' ', '_')"/>
139       <xsl:text>_heading</xsl:text>
140     </xsl:attribute>
141     <xsl:apply-templates />
142   </xsl:element>
143 </xsl:template>
144
145
146 <!-- Simple HTML elements. -->
147
148 <xsl:template match="para">
149   <p><xsl:apply-templates /></p>
150 </xsl:template>
151
152 <xsl:template match="list">
153   <ul><xsl:apply-templates /></ul>
154 </xsl:template>
155
156 <xsl:template match="listitem">
157   <li><xsl:apply-templates /></li>
158 </xsl:template>
159
160 <xsl:template match="task_seq">
161   <ul><xsl:apply-templates /></ul>
162 </xsl:template>
163
164 <xsl:template match="step">
165   <li><xsl:apply-templates /></li>
166 </xsl:template>
167
168 <xsl:template match="display_text">
169   <code><xsl:apply-templates /></code>
170 </xsl:template>
171
172 <xsl:template match="tip">
173   <p><strong>Tip: <xsl:apply-templates /></strong></p>
174 </xsl:template>
175
176 <xsl:template match="note">
177   <p><strong>Note: <xsl:apply-templates /></strong></p>
178 </xsl:template>
179
180 <xsl:template match="important">
181   <p><strong>Important: <xsl:apply-templates /></strong></p>
182 </xsl:template>
183
184 <xsl:template match="example">
185   <p>Example: <xsl:apply-templates /></p>
186 </xsl:template>
187
188 <xsl:template match="Warning">
189   <p><strong>Warning: <xsl:apply-templates /></strong></p>
190 </xsl:template>
191
192 <xsl:template match="emphasis">
193   <em><xsl:apply-templates /></em>
194 </xsl:template>
195
196 <xsl:template match="@*|node()">
197   <xsl:copy>
198     <xsl:apply-templates select="@*|node()"/>
199   </xsl:copy>
200 </xsl:template>
201
202
203 <!-- Images -->
204
205 <xsl:template match="graphic">
206   <xsl:element name="img">
207     <xsl:attribute name="src">
208       <xsl:text>http://maemo.org/forrest-images/4-x/maemo_4-0_tutorial/images/</xsl:text>
209       <xsl:choose>
210         <xsl:when test="@filename = '2686KEY_full_screen'">
211           <xsl:text>hkey_fullscreen.png</xsl:text>
212         </xsl:when>
213         <xsl:when test="@filename = '2686KEY_zoom_in'">
214           <xsl:text>hkey_zoomIn.png</xsl:text>
215         </xsl:when>
216         <xsl:when test="@filename = '2686KEY_zoom_out'">
217           <xsl:text>hkey_zoomOut.png</xsl:text>
218         </xsl:when>
219         <xsl:when test="@filename = '2686KEY_scroll_up'">
220           <xsl:text>hkey_up.png</xsl:text>
221         </xsl:when>
222         <xsl:when test="@filename = '2686KEY_scroll_down'">
223           <xsl:text>hkey_down.png</xsl:text>
224         </xsl:when>
225         <xsl:when test="@filename = '2686KEY_scroll_left'">
226           <xsl:text>hkey_left.png</xsl:text>
227         </xsl:when>
228         <xsl:when test="@filename = '2686KEY_scroll_right'">
229           <xsl:text>hkey_right.png</xsl:text>
230         </xsl:when>
231         <xsl:when test="@filename = '2686KEY_scroll_center'">
232           <xsl:text>hkey_enter.png</xsl:text>
233         </xsl:when>
234         <xsl:when test="@filename = '2686KEY_esc'">
235           <xsl:text>hkey_cancel.png</xsl:text>
236         </xsl:when>
237         <xsl:otherwise>
238           <xsl:text>???.png</xsl:text>
239         </xsl:otherwise>
240       </xsl:choose>
241     </xsl:attribute>
242     <xsl:attribute name="alt">
243       <xsl:value-of select="substring-after(@filename, '2686KEY_')"/>
244     </xsl:attribute>
245     <xsl:attribute name="style">
246       <xsl:text>height: 1.5em;</xsl:text>
247     </xsl:attribute>
248   </xsl:element>
249 </xsl:template>
250
251
252 <!-- Links and references. -->
253
254 <xsl:template match="ref">
255   <xsl:element name="a">
256     <xsl:attribute name="href">
257       #<xsl:value-of select="@refid"/>
258     </xsl:attribute>
259     <xsl:value-of select="@refdoc"/>
260   </xsl:element>
261 </xsl:template>
262
263 </xsl:stylesheet>
264