1 <?xml version='
1.0'
?> <!--*- mode: xml -*-->
2 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
5 <!-- import the chunked XSL stylesheet -->
6 <xsl:import href=
"http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
7 <xsl:include href=
"version-greater-or-equal.xsl"/>
9 <xsl:key name=
"acronym.key"
10 match=
"glossentry/glossterm"
12 <xsl:key name=
"gallery.key"
13 match=
"para[@role='gallery']/link"
16 <!-- change some parameters -->
17 <xsl:param name=
"toc.section.depth">2</xsl:param>
18 <xsl:param name=
"generate.toc">
25 <xsl:param name=
"default.encoding" select=
"'UTF-8'"/>
26 <xsl:param name=
"chapter.autolabel" select=
"0"/>
27 <xsl:param name=
"use.id.as.filename" select=
"1"/>
28 <xsl:param name=
"html.ext" select=
"'.html'"/>
29 <xsl:param name=
"refentry.generate.name" select=
"0"/>
30 <xsl:param name=
"refentry.generate.title" select=
"1"/>
32 <!-- use index filtering (if available) -->
33 <xsl:param name=
"index.on.role" select=
"1"/>
35 <!-- display variablelists as tables -->
36 <xsl:param name=
"variablelist.as.table" select=
"1"/>
38 <!-- this gets set on the command line ... -->
39 <xsl:param name=
"gtkdoc.version" select=
"''"/>
40 <xsl:param name=
"gtkdoc.bookname" select=
"''"/>
42 <!-- ========================================================= -->
43 <!-- template to create the index.sgml anchor index -->
45 <xsl:template match=
"book|article">
46 <xsl:variable name=
"tooldver">
47 <xsl:call-template name=
"version-greater-or-equal">
48 <xsl:with-param name=
"ver1" select=
"$VERSION" />
49 <xsl:with-param name=
"ver2">1.36</xsl:with-param>
52 <xsl:if test=
"$tooldver = 0">
53 <xsl:message terminate=
"yes">
54 FATAL-ERROR: You need the DocBook XSL Stylesheets version
1.36 or higher
55 to build the documentation.
56 Get a newer version at http://docbook.sourceforge.net/projects/xsl/
61 <!-- generate the index.sgml href index -->
62 <xsl:call-template name=
"generate.index"/>
65 <xsl:template name=
"generate.index">
66 <xsl:call-template name=
"write.text.chunk">
67 <xsl:with-param name=
"filename" select=
"'index.sgml'"/>
68 <xsl:with-param name=
"content">
69 <xsl:apply-templates select=
"//releaseinfo/ulink"
70 mode=
"generate.index.mode"/>
71 <!-- check all anchor and refentry elements -->
73 The obvious way to write this is //anchor|//refentry|etc...
74 The obvious way is slow because it causes multiple traversals
75 in libxslt. This take about half the time.
77 <xsl:apply-templates select=
"//*[name()='anchor' or name()='refentry' or name()='refsect1' or
78 name() = 'refsect2' or name()='refsynopsisdiv']"
79 mode=
"generate.index.mode"/>
81 <xsl:with-param name=
"default.encoding" select=
"'UTF-8'"/>
82 <xsl:with-param name=
"chunker.output.indent" select=
"'no'"/>
86 <xsl:template match=
"*" mode=
"generate.index.mode">
87 <xsl:if test=
"not(@href) and count(@id) > 0">
88 <xsl:text><ANCHOR id=
"</xsl:text>
89 <xsl:value-of select=
"@id"/>
90 <xsl:text>" href=
"</xsl:text>
91 <xsl:if test=
"$gtkdoc.bookname">
92 <xsl:value-of select=
"$gtkdoc.bookname"/>
93 <xsl:text>/
</xsl:text>
95 <xsl:call-template name=
"href.target"/>
96 <xsl:text>"> </xsl:text>
100 <xsl:template match=
"//releaseinfo/ulink" mode=
"generate.index.mode">
101 <xsl:if test=
"@role='online-location'">
102 <xsl:text><ONLINE href=
"</xsl:text>
103 <xsl:value-of select=
"@url"/>
104 <xsl:text>"> </xsl:text>
108 <!-- ========================================================= -->
109 <!-- template to output gtkdoclink elements for the unknown targets -->
111 <xsl:template match=
"link">
113 <xsl:when test=
"id(@linkend)">
117 <GTKDOCLINK HREF=
"{@linkend}">
118 <xsl:apply-templates/>
124 <!-- ========================================================= -->
125 <!-- Below are the visual portions of the stylesheet. They provide
126 the normal gtk-doc output style. -->
128 <xsl:param name=
"shade.verbatim" select=
"0"/>
129 <xsl:param name=
"refentry.separator" select=
"0"/>
131 <xsl:template match=
"refsect2">
132 <xsl:if test=
"preceding-sibling::refsect2">
138 <xsl:template name=
"user.head.title">
139 <xsl:variable name=
"home" select=
"/*[1]"/>
141 <xsl:apply-templates select=
"$home" mode=
"object.title.markup"/>:
<xsl:copy-of select=
"$title"/>
145 <xsl:template name=
"user.head.content">
146 <xsl:if test=
"$gtkdoc.version">
147 <meta name=
"generator"
148 content=
"GTK-Doc V{$gtkdoc.version} (XML mode)"/>
150 <link rel=
"stylesheet" href=
"style.css" type=
"text/css"/>
152 <!-- copied from the html.head template in the docbook stylesheets
153 we don't want links for all refentrys, thats just too much
155 <xsl:variable name=
"this" select=
"."/>
156 <xsl:for-each select=
"//part
161 |//appendix[not(parent::article)]|appendix
162 |//glossary[not(parent::article)]|glossary
163 |//index[not(parent::article)]|index">
164 <link rel=
"{local-name(.)}">
165 <xsl:attribute name=
"href">
166 <xsl:call-template name=
"href.target">
167 <xsl:with-param name=
"context" select=
"$this"/>
168 <xsl:with-param name=
"object" select=
"."/>
171 <xsl:attribute name=
"title">
172 <xsl:apply-templates select=
"." mode=
"object.title.markup.textonly"/>
178 <xsl:template name=
"user.footer.content">
182 <xsl:when test=
"$gtkdoc.version">
183 Generated by GTK-Doc V
<xsl:copy-of select=
"$gtkdoc.version" />
192 <xsl:template match=
"title" mode=
"book.titlepage.recto.mode">
193 <table class=
"navigation" id=
"top" width=
"100%"
194 cellpadding=
"2" cellspacing=
"0">
197 <p class=
"{name(.)}">
198 <xsl:value-of select=
"."/>
205 <xsl:template name=
"header.navigation">
206 <xsl:param name=
"prev" select=
"/foo"/>
207 <xsl:param name=
"next" select=
"/foo"/>
208 <xsl:variable name=
"home" select=
"/*[1]"/>
209 <xsl:variable name=
"up" select=
"parent::*"/>
210 <xsl:variable name=
"sections" select=
"./refsect1[@role]"/>
211 <xsl:variable name=
"section_id" select=
"./@id"/>
212 <xsl:variable name=
"sect_object_hierarchy" select=
"./refsect1[@role='object_hierarchy']"/>
213 <xsl:variable name=
"sect_impl_interfaces" select=
"./refsect1[@role='impl_interfaces']"/>
214 <xsl:variable name=
"sect_prerequisites" select=
"./refsect1[@role='prerequisites']"/>
215 <xsl:variable name=
"sect_derived_interfaces" select=
"./refsect1[@role='derived_interfaces']"/>
216 <xsl:variable name=
"sect_implementations" select=
"./refsect1[@role='implementations']"/>
217 <xsl:variable name=
"sect_properties" select=
"./refsect1[@role='properties']"/>
218 <xsl:variable name=
"sect_child_properties" select=
"./refsect1[@role='child_properties']"/>
219 <xsl:variable name=
"sect_style_properties" select=
"./refsect1[@role='style_properties']"/>
220 <xsl:variable name=
"sect_signal_proto" select=
"./refsect1[@role='signal_proto']"/>
221 <xsl:variable name=
"sect_desc" select=
"./refsect1[@role='desc']"/>
222 <xsl:variable name=
"sect_synopsis" select=
"./refsynopsisdiv[@role='synopsis']"/>
224 <xsl:variable name="sect_details" select="./refsect1[@id='details']"/>
225 <xsl:variable name="sect_property_details" select="./refsect1[@id='property_details']"/>
226 <xsl:variable name="sect_child_property_details" select="./refsect1[@id='child_property_details']"/>
227 <xsl:variable name="sect_style_property_details" select="./refsect1[@id='style_property_details']"/>
228 <xsl:variable name="sect_signals" select="./refsect1[@id='signals']"/>
231 <xsl:if test=
"$suppress.navigation = '0' and $home != .">
232 <table class=
"navigation" id=
"top" width=
"100%"
233 summary =
"Navigation header" cellpadding=
"2" cellspacing=
"10">
235 <td width=
"100%" align=
"left">
236 <!--<xsl:if test="name()='refentry'"-->
237 <a href=
"#" class=
"shortcut">Top
</a>
238 <xsl:if test=
"count($sections) > 0">
239 <xsl:if test=
"count($sect_desc) > 0">
241 <a href=
"#{$section_id}.description" class=
"shortcut">
242 <xsl:value-of select=
"./refsect1[@role='desc']/title"/>
245 <xsl:if test=
"count($sect_object_hierarchy) > 0">
247 <a href=
"#{$section_id}.object-hierarchy" class=
"shortcut">
248 <xsl:value-of select=
"./refsect1[@role='object_hierarchy']/title"/>
251 <xsl:if test=
"count($sect_impl_interfaces) > 0">
253 <a href=
"#{$section_id}.implemented-interfaces" class=
"shortcut">
254 <xsl:value-of select=
"./refsect1[@role='impl_interfaces']/title"/>
257 <xsl:if test=
"count($sect_prerequisites) > 0">
259 <a href=
"#{$section_id}.prerequisites" class=
"shortcut">
260 <xsl:value-of select=
"./refsect1[@role='prerequisites']/title"/>
263 <xsl:if test=
"count($sect_derived_interfaces) > 0">
265 <a href=
"#{$section_id}.derived-interfaces" class=
"shortcut">
266 <xsl:value-of select=
"./refsect1[@role='derived_interfaces']/title"/>
269 <xsl:if test=
"count($sect_implementations) > 0">
271 <a href=
"#{$section_id}.implementations" class=
"shortcut">
272 <xsl:value-of select=
"./refsect1[@role='implementations']/title"/>
275 <xsl:if test=
"count($sect_properties) > 0">
277 <a href=
"#{$section_id}.properties" class=
"shortcut">
278 <xsl:value-of select=
"./refsect1[@role='properties']/title"/>
281 <xsl:if test=
"count($sect_child_properties) > 0">
283 <a href=
"#{$section_id}.child-properties" class=
"shortcut">
284 <xsl:value-of select=
"./refsect1[@role='child_properties']/title"/>
287 <xsl:if test=
"count($sect_style_properties) > 0">
289 <a href=
"#{$section_id}.style-properties" class=
"shortcut">
290 <xsl:value-of select=
"./refsect1[@role='style_properties']/title"/>
293 <xsl:if test=
"count($sect_signal_proto) > 0">
295 <a href=
"#{$section_id}.signals" class=
"shortcut">
296 <xsl:value-of select=
"./refsect1[@role='signal_proto']/title"/>
300 <xsl:if test="count($sect_details) > 0">
301 <a href="#details" class="shortcut">
302 <xsl:value-of select="./refsect1[@id='details']/title"/>
306 <xsl:if test="count($sect_property_details) > 0">
307 <a href="#property_details" class="shortcut">
308 <xsl:value-of select="./refsect1[@id='property_details']/title"/>
312 <xsl:if test="count($sect_child_property_details) > 0">
313 <a href="#child_property_details" class="shortcut">
314 <xsl:value-of select="./refsect1[@id='property_child_details']/title"/>
318 <xsl:if test="count($sect_style_property_details) > 0">
319 <a href="#style_property_details" class="shortcut">
320 <xsl:value-of select="./refsect1[@id='style_property_details']/title"/>
324 <xsl:if test="count($sect_signals) > 0">
325 <a href="#signals" class="shortcut">
326 <xsl:value-of select="./refsect1[@id='signals']/title"/>
334 <xsl:when test=
"$home != .">
337 <xsl:attribute name=
"href">
338 <xsl:call-template name=
"href.target">
339 <xsl:with-param name=
"object" select=
"$home"/>
342 <img src=
"home.png" width=
"16" height=
"16" border=
"0">
343 <xsl:attribute name=
"alt">
344 <xsl:call-template name=
"gentext">
345 <xsl:with-param name=
"key">nav-home
</xsl:with-param>
357 <xsl:when test=
"count($up) > 0 and $up != $home">
360 <xsl:attribute name=
"href">
361 <xsl:call-template name=
"href.target">
362 <xsl:with-param name=
"object" select=
"$up"/>
365 <img src=
"up.png" width=
"16" height=
"16" border=
"0">
366 <xsl:attribute name=
"alt">
367 <xsl:call-template name=
"gentext">
368 <xsl:with-param name=
"key">nav-up
</xsl:with-param>
376 <td><img src=
"up-insensitive.png" width=
"16" height=
"16" border=
"0"/></td>
380 <xsl:when test=
"count($prev) > 0">
383 <xsl:attribute name=
"href">
384 <xsl:call-template name=
"href.target">
385 <xsl:with-param name=
"object" select=
"$prev"/>
388 <img src=
"left.png" width=
"16" height=
"16" border=
"0">
389 <xsl:attribute name=
"alt">
390 <xsl:call-template name=
"gentext">
391 <xsl:with-param name=
"key">nav-prev
</xsl:with-param>
399 <td><img src=
"left-insensitive.png" width=
"16" height=
"16" border=
"0"/></td>
403 <xsl:when test=
"count($next) > 0">
406 <xsl:attribute name=
"href">
407 <xsl:call-template name=
"href.target">
408 <xsl:with-param name=
"object" select=
"$next"/>
411 <img src=
"right.png" width=
"16" height=
"16" border=
"0">
412 <xsl:attribute name=
"alt">
413 <xsl:call-template name=
"gentext">
414 <xsl:with-param name=
"key">nav-next
</xsl:with-param>
422 <td><img src=
"right-insensitive.png" width=
"16" height=
"16" border=
"0"/></td>
430 <xsl:template name=
"footer.navigation">
433 <!-- avoid creating multiple identical indices
434 if the stylesheets don't support filtered indices
436 <xsl:template match=
"index">
437 <xsl:variable name=
"has-filtered-index">
438 <xsl:call-template name=
"version-greater-or-equal">
439 <xsl:with-param name=
"ver1" select=
"$VERSION" />
440 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
443 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
448 <xsl:template match=
"index" mode=
"toc">
449 <xsl:variable name=
"has-filtered-index">
450 <xsl:call-template name=
"version-greater-or-equal">
451 <xsl:with-param name=
"ver1" select=
"$VERSION" />
452 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
455 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
460 <xsl:template match=
"para">
462 <xsl:when test=
"@role = 'gallery'">
463 <div class=
"container">
464 <div class=
"gallery-spacer"> </div>
465 <xsl:apply-templates mode=
"gallery.mode"/>
466 <div class=
"gallery-spacer"> </div>
475 <xsl:template match=
"link" mode=
"gallery.mode">
476 <div class=
"gallery-float">
477 <xsl:apply-templates select=
"."/>
481 <!-- add gallery handling to refnamediv template -->
482 <xsl:template match=
"refnamediv">
483 <div class=
"{name(.)}">
485 <tr><td valign=
"top">
486 <xsl:call-template name=
"anchor"/>
488 <xsl:when test=
"$refentry.generate.name != 0">
490 <xsl:call-template name=
"gentext">
491 <xsl:with-param name=
"key" select=
"'RefName'"/>
495 <xsl:when test=
"$refentry.generate.title != 0">
498 <xsl:when test=
"../refmeta/refentrytitle">
499 <xsl:apply-templates select=
"../refmeta/refentrytitle"/>
502 <xsl:apply-templates select=
"refname[1]"/>
509 <xsl:apply-templates/>
512 <td valign=
"top" align=
"right">
513 <!-- find the gallery image to use here
514 - determine the id of the enclosing refentry
515 - look for an inlinegraphic inside a link with linkend == refentryid inside a para with role == gallery
518 <xsl:variable name=
"refentryid" select=
"../@id"/>
519 <xsl:apply-templates select=
"key('gallery.key', $refentryid)/inlinegraphic"/>
525 <!-- Exterminate any trace of indexterms in the main flow -->
526 <xsl:template match=
"indexterm">
529 <!-- ==================================================================== -->
531 <xsl:template match=
"acronym">
532 <xsl:call-template name=
"generate.acronym.link"/>
535 <xsl:template name=
"generate.acronym.link">
536 <xsl:param name=
"acronym">
537 <xsl:apply-templates/>
540 We use for-each to change context to the database document because key()
541 only locates elements in the same document as the context node!
544 <xsl:param name=
"value" >
545 <xsl:value-of select=
"key('acronym.key', $acronym)/../glossdef/para[1]" />
548 <xsl:when test=
"$value=''">
551 In gtk-doc.xsl: For acronym (
<xsl:value-of select=
"$acronym"/>) no value found!
554 <xsl:attribute name=
"href">
555 <xsl:text>http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=
</xsl:text>
556 <xsl:value-of select=
"$acronym"/>
558 <xsl:call-template name=
"inline.charseq"/>
564 <xsl:attribute name=
"title">
565 <xsl:value-of select=
"$value"/>
567 <xsl:call-template name=
"inline.charseq"/>