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.
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" />
25 <xsl:param name=
"chunker.output.indent" select=
"'yes'" />
27 <xsl:param name=
"generate.index">1</xsl:param>
28 <xsl:param name=
"generate.toc">
48 <xsl:param name=
"html.stylesheet">
49 gimp-help-plain.css gimp-help-screen.css gimp-help-custom.css
51 <xsl:param name=
"html.stylesheet.alternate">
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
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
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) > 0
101 or (count($up) > 0
102 and generate-id($up) != generate-id($home)
103 and $navig.showtitles != 0)
104 or count($next) > 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">
112 <th colspan=
"3" align=
"center">
113 <xsl:apply-templates select=
"." mode=
"object.title.markup"/>
118 <xsl:if test=
"$row2">
120 <td width=
"20%" align=
"{$direction.align.start}">
122 <xsl:when test=
"count($prev)>0">
124 <xsl:attribute name=
"href">
125 <xsl:call-template name=
"href.target">
126 <xsl:with-param name=
"object" select=
"$prev"/>
129 <xsl:call-template name=
"navig.content">
130 <xsl:with-param name=
"direction" select=
"'prev'"/>
134 <!-- PATCH: if prev is empty, add a link to www.gimp.org -->
137 <xsl:attribute name=
"href">http://www.gimp.org
</xsl:attribute>
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"/>
144 <xsl:attribute name=
"alt">gimp.org
</xsl:attribute>
150 <th width=
"60%" align=
"center">
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"/>
157 <xsl:otherwise> </xsl:otherwise>
160 <td width=
"20%" align=
"{$direction.align.end}">
161 <xsl:text> </xsl:text>
162 <xsl:if test=
"count($next)>0">
164 <xsl:attribute name=
"href">
165 <xsl:call-template name=
"href.target">
166 <xsl:with-param name=
"object" select=
"$next"/>
169 <xsl:call-template name=
"navig.content">
170 <xsl:with-param name=
"direction" select=
"'next'"/>
179 <xsl:if test=
"$header.rule != 0">
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" />
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" />
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) > 0 or count($up) > 0
206 or count($next) > 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">
221 <xsl:if test=
"$row1 or $row2">
222 <table width=
"100%" summary=
"Navigation footer">
223 <xsl:if test=
"$row1">
225 <td width=
"40%" align=
"left">
226 <xsl:if test=
"count($prev)>0">
228 <xsl:attribute name=
"href">
229 <xsl:call-template name=
"href.target">
230 <xsl:with-param name=
"object" select=
"$prev"/>
233 <xsl:call-template name=
"navig.content">
234 <xsl:with-param name=
"direction" select=
"'prev'"/>
238 <xsl:text> </xsl:text>
240 <td width=
"20%" align=
"center">
242 <xsl:when test=
"count($up)>0 and generate-id($up) != generate-id($home)">
244 <xsl:attribute name=
"href">
245 <xsl:call-template name=
"href.target">
246 <xsl:with-param name=
"object" select=
"$up"/>
249 <xsl:call-template name=
"navig.content">
250 <xsl:with-param name=
"direction" select=
"'up'"/>
254 <xsl:otherwise> </xsl:otherwise>
257 <td width=
"40%" align=
"right">
258 <xsl:text> </xsl:text>
259 <xsl:if test=
"count($next)>0">
261 <xsl:attribute name=
"href">
262 <xsl:call-template name=
"href.target">
263 <xsl:with-param name=
"object" select=
"$next"/>
266 <xsl:call-template name=
"navig.content">
267 <xsl:with-param name=
"direction" select=
"'next'"/>
275 <xsl:if test=
"$row2">
277 <td width=
"40%" align=
"left" valign=
"top">
278 <xsl:if test=
"$navig.showtitles != 0 and count($prev)>0">
280 <xsl:attribute name=
"href">
281 <xsl:call-template name=
"href.target">
282 <xsl:with-param name=
"object" select=
"$prev"/>
285 <xsl:apply-templates select=
"$prev" mode=
"object.title.markup"/>
288 <xsl:text> </xsl:text>
290 <td width=
"20%" align=
"center">
292 <xsl:when test=
"$home != . or $nav.context = 'toc'">
294 <xsl:attribute name=
"href">
295 <xsl:call-template name=
"href.target">
296 <xsl:with-param name=
"object" select=
"$home"/>
299 <xsl:call-template name=
"navig.content">
300 <xsl:with-param name=
"direction" select=
"'home'"/>
303 <xsl:if test=
"$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
304 <xsl:text> |
 </xsl:text>
307 <xsl:otherwise> </xsl:otherwise>
310 <xsl:if test=
"$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
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"/>
317 <xsl:call-template name=
"gentext">
318 <xsl:with-param name=
"key" select=
"'nav-toc'"/>
323 <td width=
"40%" align=
"right" valign=
"top">
324 <xsl:text> </xsl:text>
325 <xsl:if test=
"$navig.showtitles != 0 and count($next) > 0">
327 <xsl:attribute name=
"href">
328 <xsl:call-template name=
"href.target">
329 <xsl:with-param name=
"object" select=
"$next"/>
332 <xsl:apply-templates select=
"$next" mode=
"object.title.markup"/>
341 <xsl:attribute name=
"href">
342 <xsl:value-of select=
"$gimphelp.reportbug/@url"/>
344 <xsl:attribute name=
"class">
345 <xsl:value-of select=
"$gimphelp.reportbug/@id"/>
347 <xsl:value-of select=
"$gimphelp.reportbug" />
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
367 <xsl:variable name=
"filename">
369 <xsl:when test=
"$data[@fileref]">
370 <xsl:value-of select=
"$data/@fileref"/>
372 <xsl:when test=
"$data[@entityref]">
373 <xsl:value-of select=
"unparsed-entity-uri($data/@entityref)"/>
375 <xsl:otherwise></xsl:otherwise>
379 <xsl:variable name=
"real.ext">
380 <xsl:call-template name=
"filename-extension">
381 <xsl:with-param name=
"filename" select=
"$filename"/>
385 <xsl:variable name=
"ext">
387 <xsl:when test=
"$real.ext != ''">
388 <xsl:value-of select=
"$real.ext"/>
391 <xsl:value-of select=
"$graphic.default.extension"/>
396 <xsl:variable name=
"graphic.ext">
397 <xsl:call-template name=
"is.graphic.extension">
398 <xsl:with-param name=
"ext" select=
"$ext"/>
403 <xsl:when test=
"$real.ext = ''">
405 <xsl:when test=
"$ext != ''">
406 <xsl:value-of select=
"$filename"/>
407 <xsl:text>.
</xsl:text>
408 <xsl:value-of select=
"$ext"/>
411 <xsl:value-of select=
"$filename"/>
415 <xsl:when test=
"not($graphic.ext)">
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"/>
423 <xsl:value-of select=
"$filename"/>
428 <xsl:value-of select=
"$filename"/>