gipm-help-2.doap: make schumaml and myself additional maintainers
[gimp-help-2.git] / stylesheets / plainhtml.xsl.in
blob7ad691eb9e079d4756d29997f135c0035fd3b5f8
1 <?xml version="1.0" encoding="utf-8"?>
2 <!-- This file is part of the gimp-help-2 project and is
3 (C) 2002-2012 Daniel Egger, RĂ³man Joost
4 You may use this file in accordance to the GNU General Public License
5 Version 2 which is available from http://www.gnu.org.
6 -->
7 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
8 xmlns="http://www.w3.org/1999/xhtml">
10 <xsl:import href="@STYLEBASE@/xhtml/chunk.xsl" />
11 <xsl:import href="languageMenu.xsl" />
12 <xsl:import href="float-images.xsl" />
13 <xsl:include href="htmlalternate.xsl" />
15 <xsl:param name="admon.graphics" select="1" />
16 <xsl:param name="admon.graphics.path">images/</xsl:param>
17 <xsl:param name="callout.graphics.path">images/callouts/</xsl:param>
18 <xsl:param name="collect.xref.targets" select="'yes'" />
20 <xsl:param name="chunk.section.depth" select="2" />
21 <!-- doesn't work correctly currently
22 <xsl:param name="chunk.tocs.and.lots" select="1" />
23 <xsl:param name="chunk.seperate.lots" select="1" />
24 -->
25 <xsl:param name="chunker.output.indent" select="'yes'" />
27 <xsl:param name="generate.index">1</xsl:param>
28 <xsl:param name="generate.toc">
29 appendix toc,title
30 article/appendix nop
31 article toc,title
32 book toc,title
33 chapter toc,title
34 part toc,title
35 preface toc,title
36 qandadiv toc
37 qandaset toc
38 reference toc,title
39 sect1 toc
40 sect2 toc
41 sect3 toc
42 sect4 toc
43 sect5 toc
44 section toc
45 set toc,title
46 </xsl:param>
48 <xsl:param name="html.stylesheet">
49 gimp-help-plain.css gimp-help-screen.css gimp-help-custom.css
50 </xsl:param>
51 <xsl:param name="html.stylesheet.alternate">
52 gimp22.css
53 </xsl:param>
54 <xsl:param name="id.warnings" select="0" />
55 <xsl:param name="make.valid.html" select="1" />
56 <xsl:param name="segmentedlist.as.table" select="1" />
57 <xsl:param name="glossary.sort" select="1" />
59 <xsl:param name="navig.showtitles" select="1" />
60 <xsl:param name="navig.graphics" select="1" />
61 <xsl:param name="navig.graphics.extension">.png</xsl:param>
62 <xsl:param name="navig.graphics.path">images/</xsl:param>
64 <xsl:param name="section.autolabel" select="1" />
65 <xsl:param name="targets.filename" select="'gimp-xrefs.xml'" />
66 <xsl:param name="toc.section.depth" select="2" />
67 <xsl:param name="use.id.as.filename">1</xsl:param>
68 <xsl:param name="gimp.help.languageselector">0</xsl:param>
69 <xsl:param name="gimp.help.all_linguas">@ALL_LINGUAS@</xsl:param>
70 <!-- Quick access to report bugs in our Bugzilla Bug: 711318 -->
71 <xsl:param name="gimphelp.reportbug" select="//ulink[@id='reportbug']" />
73 <!-- Add NotInToc role to simplesect, which is using in fdl.xml to
74 deal with FDL-In-TOC issue.
75 also omit title 'image' if the links in header and footer
76 pointing to the images
77 -->
78 <xsl:template match="simplesect[@role = 'NotInToc']" mode="toc"/>
80 <!-- suppress all elements which have the 'tex' role, because we don't
81 want to process elements which are obviously for PDF generation
82 -->
83 <xsl:template match="*[@role='tex']" />
85 <!-- ==================================================================== -->
87 <!-- This is a customized version of the docbook-xsl-1.75.2 template -->
88 <xsl:template name="header.navigation">
89 <xsl:param name="prev" select="/foo"/>
90 <xsl:param name="next" select="/foo"/>
91 <xsl:param name="nav.context"/>
93 <xsl:variable name="home" select="/*[1]"/>
94 <xsl:variable name="up" select="parent::*"/>
96 <!--XXX: workaround for a weird runtime error ("unregistered variable")-->
97 <xsl:variable name="direction.align.start">left</xsl:variable>
99 <xsl:variable name="row1" select="$navig.showtitles != 0"/>
100 <xsl:variable name="row2" select="count($prev) &gt; 0
101 or (count($up) &gt; 0
102 and generate-id($up) != generate-id($home)
103 and $navig.showtitles != 0)
104 or count($next) &gt; 0"/>
106 <xsl:if test="$suppress.navigation = '0' and $suppress.header.navigation = '0'">
107 <div class="navheader">
108 <xsl:if test="$row1 or $row2">
109 <table width="100%" summary="Navigation header">
110 <xsl:if test="$row1">
111 <tr>
112 <th colspan="3" align="center">
113 <xsl:apply-templates select="." mode="object.title.markup"/>
114 </th>
115 </tr>
116 </xsl:if>
118 <xsl:if test="$row2">
119 <tr>
120 <td width="20%" align="{$direction.align.start}">
121 <xsl:choose>
122 <xsl:when test="count($prev)>0">
123 <a accesskey="p">
124 <xsl:attribute name="href">
125 <xsl:call-template name="href.target">
126 <xsl:with-param name="object" select="$prev"/>
127 </xsl:call-template>
128 </xsl:attribute>
129 <xsl:call-template name="navig.content">
130 <xsl:with-param name="direction" select="'prev'"/>
131 </xsl:call-template>
132 </a>
133 </xsl:when>
134 <!-- PATCH: if prev is empty, add a link to www.gimp.org -->
135 <xsl:otherwise>
137 <xsl:attribute name="href">http://www.gimp.org</xsl:attribute>
138 <img>
139 <xsl:attribute name="src">
140 <xsl:value-of select="$navig.graphics.path"/>
141 <xsl:value-of select="'gimp-org'"/>
142 <xsl:value-of select="$navig.graphics.extension"/>
143 </xsl:attribute>
144 <xsl:attribute name="alt">gimp.org</xsl:attribute>
145 </img>
146 </a>
147 </xsl:otherwise>
148 </xsl:choose>
149 </td>
150 <th width="60%" align="center">
151 <xsl:choose>
152 <xsl:when test="count($up) > 0
153 and generate-id($up) != generate-id($home)
154 and $navig.showtitles != 0">
155 <xsl:apply-templates select="$up" mode="object.title.markup"/>
156 </xsl:when>
157 <xsl:otherwise>&#160;</xsl:otherwise>
158 </xsl:choose>
159 </th>
160 <td width="20%" align="{$direction.align.end}">
161 <xsl:text>&#160;</xsl:text>
162 <xsl:if test="count($next)>0">
163 <a accesskey="n">
164 <xsl:attribute name="href">
165 <xsl:call-template name="href.target">
166 <xsl:with-param name="object" select="$next"/>
167 </xsl:call-template>
168 </xsl:attribute>
169 <xsl:call-template name="navig.content">
170 <xsl:with-param name="direction" select="'next'"/>
171 </xsl:call-template>
172 </a>
173 </xsl:if>
174 </td>
175 </tr>
176 </xsl:if>
177 </table>
178 </xsl:if>
179 <xsl:if test="$header.rule != 0">
180 <hr/>
181 </xsl:if>
182 <xsl:if test="$gimp.help.languageselector != 0">
183 <div class="show_other_language">
184 <xsl:variable name="filename">
185 <xsl:call-template name="href.target" />
186 </xsl:variable>
187 <xsl:call-template name="gimp.help.linguas.tokenize">
188 <xsl:with-param name="linguas" select="normalize-space($gimp.help.all_linguas)"/>
189 <xsl:with-param name="filename" select="$filename" />
190 </xsl:call-template>
191 </div>
192 </xsl:if>
193 </div>
194 </xsl:if>
195 </xsl:template>
197 <xsl:template name="footer.navigation">
198 <xsl:param name="prev" select="/foo"/>
199 <xsl:param name="next" select="/foo"/>
200 <xsl:param name="nav.context"/>
202 <xsl:variable name="home" select="/*[1]"/>
203 <xsl:variable name="up" select="parent::*"/>
205 <xsl:variable name="row1" select="count($prev) &gt; 0 or count($up) &gt; 0
206 or count($next) &gt; 0"/>
208 <xsl:variable name="row2" select="($prev and $navig.showtitles != 0)
209 or (generate-id($home) != generate-id(.)
210 or $nav.context = 'toc')
211 or ($chunk.tocs.and.lots != 0
212 and $nav.context != 'toc')
213 or ($next and $navig.showtitles != 0)"/>
215 <xsl:if test="$suppress.navigation = '0' and $suppress.footer.navigation = '0'">
216 <div class="navfooter">
217 <xsl:if test="$footer.rule != 0">
218 <hr/>
219 </xsl:if>
221 <xsl:if test="$row1 or $row2">
222 <table width="100%" summary="Navigation footer">
223 <xsl:if test="$row1">
224 <tr>
225 <td width="40%" align="left">
226 <xsl:if test="count($prev)&gt;0">
227 <a accesskey="p">
228 <xsl:attribute name="href">
229 <xsl:call-template name="href.target">
230 <xsl:with-param name="object" select="$prev"/>
231 </xsl:call-template>
232 </xsl:attribute>
233 <xsl:call-template name="navig.content">
234 <xsl:with-param name="direction" select="'prev'"/>
235 </xsl:call-template>
236 </a>
237 </xsl:if>
238 <xsl:text>&#160;</xsl:text>
239 </td>
240 <td width="20%" align="center">
241 <xsl:choose>
242 <xsl:when test="count($up)&gt;0 and generate-id($up) != generate-id($home)">
243 <a accesskey="u">
244 <xsl:attribute name="href">
245 <xsl:call-template name="href.target">
246 <xsl:with-param name="object" select="$up"/>
247 </xsl:call-template>
248 </xsl:attribute>
249 <xsl:call-template name="navig.content">
250 <xsl:with-param name="direction" select="'up'"/>
251 </xsl:call-template>
252 </a>
253 </xsl:when>
254 <xsl:otherwise>&#160;</xsl:otherwise>
255 </xsl:choose>
256 </td>
257 <td width="40%" align="right">
258 <xsl:text>&#160;</xsl:text>
259 <xsl:if test="count($next)&gt;0">
260 <a accesskey="n">
261 <xsl:attribute name="href">
262 <xsl:call-template name="href.target">
263 <xsl:with-param name="object" select="$next"/>
264 </xsl:call-template>
265 </xsl:attribute>
266 <xsl:call-template name="navig.content">
267 <xsl:with-param name="direction" select="'next'"/>
268 </xsl:call-template>
269 </a>
270 </xsl:if>
271 </td>
272 </tr>
273 </xsl:if>
275 <xsl:if test="$row2">
276 <tr>
277 <td width="40%" align="left" valign="top">
278 <xsl:if test="$navig.showtitles != 0 and count($prev)&gt;0">
279 <a accesskey="p">
280 <xsl:attribute name="href">
281 <xsl:call-template name="href.target">
282 <xsl:with-param name="object" select="$prev"/>
283 </xsl:call-template>
284 </xsl:attribute>
285 <xsl:apply-templates select="$prev" mode="object.title.markup"/>
286 </a>
287 </xsl:if>
288 <xsl:text>&#160;</xsl:text>
289 </td>
290 <td width="20%" align="center">
291 <xsl:choose>
292 <xsl:when test="$home != . or $nav.context = 'toc'">
293 <a accesskey="h">
294 <xsl:attribute name="href">
295 <xsl:call-template name="href.target">
296 <xsl:with-param name="object" select="$home"/>
297 </xsl:call-template>
298 </xsl:attribute>
299 <xsl:call-template name="navig.content">
300 <xsl:with-param name="direction" select="'home'"/>
301 </xsl:call-template>
302 </a>
303 <xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
304 <xsl:text>&#160;|&#160;</xsl:text>
305 </xsl:if>
306 </xsl:when>
307 <xsl:otherwise>&#160;</xsl:otherwise>
308 </xsl:choose>
310 <xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
311 <a accesskey="t">
312 <xsl:attribute name="href">
313 <xsl:apply-templates select="/*[1]" mode="recursive-chunk-filename"/>
314 <xsl:text>-toc</xsl:text>
315 <xsl:value-of select="$html.ext"/>
316 </xsl:attribute>
317 <xsl:call-template name="gentext">
318 <xsl:with-param name="key" select="'nav-toc'"/>
319 </xsl:call-template>
320 </a>
321 </xsl:if>
322 </td>
323 <td width="40%" align="right" valign="top">
324 <xsl:text>&#160;</xsl:text>
325 <xsl:if test="$navig.showtitles != 0 and count($next) &gt; 0">
326 <a accesskey="n">
327 <xsl:attribute name="href">
328 <xsl:call-template name="href.target">
329 <xsl:with-param name="object" select="$next"/>
330 </xsl:call-template>
331 </xsl:attribute>
332 <xsl:apply-templates select="$next" mode="object.title.markup"/>
333 </a>
334 </xsl:if>
335 </td>
336 </tr>
337 </xsl:if>
338 </table>
339 </xsl:if>
341 <xsl:attribute name="href">
342 <xsl:value-of select="$gimphelp.reportbug/@url"/>
343 </xsl:attribute>
344 <xsl:attribute name="class">
345 <xsl:value-of select="$gimphelp.reportbug/@id"/>
346 </xsl:attribute>
347 <xsl:value-of select="$gimphelp.reportbug" />
348 </a>
349 </div>
350 </xsl:if>
351 </xsl:template>
353 <!-- ==================================================================== -->
355 <!-- For unknown reasons the original version of the template starting
356 from August 2004 would unwind the path of the sourcecode several
357 times into the processing of the fileref thus prepending the path
358 a few times into the src attribute of the img tag -->
359 <xsl:template name="mediaobject.filename">
360 <xsl:param name="object"></xsl:param>
362 <xsl:variable name="data" select="$object/videodata
363 |$object/imagedata
364 |$object/audiodata
365 |$object"/>
367 <xsl:variable name="filename">
368 <xsl:choose>
369 <xsl:when test="$data[@fileref]">
370 <xsl:value-of select="$data/@fileref"/>
371 </xsl:when>
372 <xsl:when test="$data[@entityref]">
373 <xsl:value-of select="unparsed-entity-uri($data/@entityref)"/>
374 </xsl:when>
375 <xsl:otherwise></xsl:otherwise>
376 </xsl:choose>
377 </xsl:variable>
379 <xsl:variable name="real.ext">
380 <xsl:call-template name="filename-extension">
381 <xsl:with-param name="filename" select="$filename"/>
382 </xsl:call-template>
383 </xsl:variable>
385 <xsl:variable name="ext">
386 <xsl:choose>
387 <xsl:when test="$real.ext != ''">
388 <xsl:value-of select="$real.ext"/>
389 </xsl:when>
390 <xsl:otherwise>
391 <xsl:value-of select="$graphic.default.extension"/>
392 </xsl:otherwise>
393 </xsl:choose>
394 </xsl:variable>
396 <xsl:variable name="graphic.ext">
397 <xsl:call-template name="is.graphic.extension">
398 <xsl:with-param name="ext" select="$ext"/>
399 </xsl:call-template>
400 </xsl:variable>
402 <xsl:choose>
403 <xsl:when test="$real.ext = ''">
404 <xsl:choose>
405 <xsl:when test="$ext != ''">
406 <xsl:value-of select="$filename"/>
407 <xsl:text>.</xsl:text>
408 <xsl:value-of select="$ext"/>
409 </xsl:when>
410 <xsl:otherwise>
411 <xsl:value-of select="$filename"/>
412 </xsl:otherwise>
413 </xsl:choose>
414 </xsl:when>
415 <xsl:when test="not($graphic.ext)">
416 <xsl:choose>
417 <xsl:when test="$graphic.default.extension != ''">
418 <xsl:value-of select="$filename"/>
419 <xsl:text>.</xsl:text>
420 <xsl:value-of select="$graphic.default.extension"/>
421 </xsl:when>
422 <xsl:otherwise>
423 <xsl:value-of select="$filename"/>
424 </xsl:otherwise>
425 </xsl:choose>
426 </xsl:when>
427 <xsl:otherwise>
428 <xsl:value-of select="$filename"/>
429 </xsl:otherwise>
430 </xsl:choose>
431 </xsl:template>
432 </xsl:stylesheet>