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/chunk.xsl"/>
7 <xsl:include href=
"devhelp.xsl"/>
8 <xsl:include href=
"devhelp2.xsl"/>
9 <xsl:include href=
"version-greater-or-equal.xsl"/>
11 <!-- change some parameters -->
12 <!-- http://docbook.sourceforge.net/release/xsl/current/doc/html/index.html -->
13 <xsl:param name=
"toc.section.depth">2</xsl:param>
14 <xsl:param name=
"generate.toc">
21 <xsl:param name=
"chunker.output.encoding" select=
"'UTF-8'"/>
22 <xsl:param name=
"chunker.output.indent" select=
"'yes'"/>
23 <xsl:param name=
"chunker.output.doctype-public" select=
"'-//W3C//DTD HTML 4.01 Transitional//EN'"/>
24 <xsl:param name=
"chunk.fast" select=
"1"/>
26 <xsl:param name=
"default.encoding" select=
"'UTF-8'"/>
27 <xsl:param name=
"chapter.autolabel" select=
"0"/>
28 <xsl:param name=
"use.id.as.filename" select=
"1"/>
29 <xsl:param name=
"html.ext" select=
"'.html'"/>
30 <xsl:param name=
"refentry.generate.name" select=
"0"/>
31 <xsl:param name=
"refentry.generate.title" select=
"1"/>
33 <!-- use index filtering (if available) -->
34 <xsl:param name=
"index.on.role" select=
"1"/>
36 <!-- display variablelists as tables -->
37 <xsl:param name=
"variablelist.as.table" select=
"1"/>
39 <!-- new things to consider
40 <xsl:param name="glossterm.auto.link" select="0"></xsl:param>
43 <!-- this gets set on the command line ... -->
44 <xsl:param name=
"gtkdoc.version" select=
"''"/>
45 <xsl:param name=
"gtkdoc.bookname" select=
"''"/>
47 <!-- ========================================================= -->
48 <!-- template to create the index.sgml anchor index -->
50 <xsl:template match=
"book|article">
51 <xsl:variable name=
"tooldver">
52 <xsl:call-template name=
"version-greater-or-equal">
53 <xsl:with-param name=
"ver1" select=
"$VERSION" />
54 <xsl:with-param name=
"ver2">1.36</xsl:with-param>
57 <xsl:if test=
"$tooldver = 0">
58 <xsl:message terminate=
"yes">
59 FATAL-ERROR: You need the DocBook XSL Stylesheets version
1.36 or higher
60 to build the documentation.
61 Get a newer version at http://docbook.sourceforge.net/projects/xsl/
66 <!-- generate the index.sgml href index -->
67 <xsl:call-template name=
"generate.index"/>
68 <xsl:call-template name=
"generate.devhelp"/>
69 <xsl:call-template name=
"generate.devhelp2"/>
72 <xsl:template name=
"generate.index">
73 <xsl:call-template name=
"write.text.chunk">
74 <xsl:with-param name=
"filename" select=
"'index.sgml'"/>
75 <xsl:with-param name=
"content">
76 <xsl:apply-templates select=
"//releaseinfo/ulink"
77 mode=
"generate.index.mode"/>
78 <!-- check all anchor and refentry elements -->
79 <xsl:apply-templates select=
"//anchor|//refentry|//refsect1|//refsect2|//refsynopsisdiv"
80 mode=
"generate.index.mode"/>
82 <xsl:with-param name=
"default.encoding" select=
"'UTF-8'"/>
83 <xsl:with-param name=
"chunker.output.indent" select=
"'no'"/>
87 <xsl:template match=
"*" mode=
"generate.index.mode">
88 <xsl:if test=
"not(@href) and count(@id) > 0">
89 <xsl:text><ANCHOR id=
"</xsl:text>
90 <xsl:value-of select=
"@id"/>
91 <xsl:text>" href=
"</xsl:text>
92 <xsl:if test=
"$gtkdoc.bookname">
93 <xsl:value-of select=
"$gtkdoc.bookname"/>
94 <xsl:text>/
</xsl:text>
96 <xsl:call-template name=
"href.target"/>
97 <xsl:text>"> </xsl:text>
101 <xsl:template match=
"//releaseinfo/ulink" mode=
"generate.index.mode">
102 <xsl:if test=
"@role='online-location'">
103 <xsl:text><ONLINE href=
"</xsl:text>
104 <xsl:value-of select=
"@url"/>
105 <xsl:text>"> </xsl:text>
109 <!-- ========================================================= -->
110 <!-- template to output gtkdoclink elements for the unknown targets -->
112 <xsl:template match=
"link">
114 <xsl:when test=
"id(@linkend)">
118 <GTKDOCLINK HREF=
"{@linkend}">
119 <xsl:apply-templates/>
125 <!-- ========================================================= -->
126 <!-- Below are the visual portions of the stylesheet. They provide
127 the normal gtk-doc output style. -->
129 <xsl:param name=
"shade.verbatim" select=
"0"/>
130 <xsl:param name=
"refentry.separator" select=
"0"/>
132 <xsl:template match=
"refsect2">
133 <xsl:if test=
"preceding-sibling::refsect2">
139 <xsl:template name=
"user.head.content">
140 <xsl:if test=
"$gtkdoc.version">
141 <meta name=
"generator" content=
"GTK-Doc V{$gtkdoc.version} (XML mode)"/>
143 <link rel=
"stylesheet" href=
"style.css" type=
"text/css"/>
145 <!-- copied from the html.head template in the docbook stylesheets
146 we don't want links for all refentrys, thats just too much
148 <xsl:variable name=
"this" select=
"."/>
149 <xsl:for-each select=
"//part
154 |//appendix[not(parent::article)]|appendix
155 |//glossary[not(parent::article)]|glossary
156 |//index[not(parent::article)]|index">
157 <link rel=
"{local-name(.)}">
158 <xsl:attribute name=
"href">
159 <xsl:call-template name=
"href.target">
160 <xsl:with-param name=
"context" select=
"$this"/>
161 <xsl:with-param name=
"object" select=
"."/>
164 <xsl:attribute name=
"title">
165 <xsl:apply-templates select=
"." mode=
"object.title.markup.textonly"/>
171 <xsl:template name=
"user.footer.content">
175 <xsl:when test=
"$gtkdoc.version">
176 Generated by GTK-Doc V
<xsl:copy-of select=
"$gtkdoc.version" />
185 <xsl:template match=
"title" mode=
"book.titlepage.recto.mode">
186 <table class=
"navigation" id=
"top" width=
"100%"
187 cellpadding=
"2" cellspacing=
"0">
190 <p class=
"{name(.)}">
191 <xsl:value-of select=
"."/>
198 <xsl:template name=
"header.navigation">
199 <xsl:param name=
"prev" select=
"/foo"/>
200 <xsl:param name=
"next" select=
"/foo"/>
201 <xsl:variable name=
"home" select=
"/*[1]"/>
202 <xsl:variable name=
"up" select=
"parent::*"/>
203 <xsl:variable name=
"refsections" select=
"./refsect1[@role]"/>
204 <xsl:variable name=
"glssections" select=
"./glossdiv/title"/>
205 <xsl:variable name=
"idxsections" select=
"./indexdiv/indexdiv/title"/>
206 <xsl:variable name=
"section_id" select=
"./@id"/>
207 <xsl:variable name=
"sect_object_hierarchy" select=
"./refsect1[@role='object_hierarchy']"/>
208 <xsl:variable name=
"sect_impl_interfaces" select=
"./refsect1[@role='impl_interfaces']"/>
209 <xsl:variable name=
"sect_prerequisites" select=
"./refsect1[@role='prerequisites']"/>
210 <xsl:variable name=
"sect_derived_interfaces" select=
"./refsect1[@role='derived_interfaces']"/>
211 <xsl:variable name=
"sect_implementations" select=
"./refsect1[@role='implementations']"/>
212 <xsl:variable name=
"sect_properties" select=
"./refsect1[@role='properties']"/>
213 <xsl:variable name=
"sect_child_properties" select=
"./refsect1[@role='child_properties']"/>
214 <xsl:variable name=
"sect_style_properties" select=
"./refsect1[@role='style_properties']"/>
215 <xsl:variable name=
"sect_signal_proto" select=
"./refsect1[@role='signal_proto']"/>
216 <xsl:variable name=
"sect_desc" select=
"./refsect1[@role='desc']"/>
217 <xsl:variable name=
"sect_synopsis" select=
"./refsynopsisdiv[@role='synopsis']"/>
219 <xsl:variable name="sect_details" select="./refsect1[@id='details']"/>
220 <xsl:variable name="sect_property_details" select="./refsect1[@id='property_details']"/>
221 <xsl:variable name="sect_child_property_details" select="./refsect1[@id='child_property_details']"/>
222 <xsl:variable name="sect_style_property_details" select="./refsect1[@id='style_property_details']"/>
223 <xsl:variable name="sect_signals" select="./refsect1[@id='signals']"/>
226 <xsl:if test=
"$suppress.navigation = '0' and $home != .">
227 <table class=
"navigation" id=
"top" width=
"100%"
228 summary =
"Navigation header" cellpadding=
"2" cellspacing=
"2">
231 <xsl:when test=
"count($prev) > 0">
234 <xsl:attribute name=
"href">
235 <xsl:call-template name=
"href.target">
236 <xsl:with-param name=
"object" select=
"$prev"/>
239 <img src=
"left.png" width=
"24" height=
"24" border=
"0">
240 <xsl:attribute name=
"alt">
241 <xsl:call-template name=
"gentext">
242 <xsl:with-param name=
"key">nav-prev
</xsl:with-param>
254 <xsl:when test=
"count($up) > 0 and $up != $home">
257 <xsl:attribute name=
"href">
258 <xsl:call-template name=
"href.target">
259 <xsl:with-param name=
"object" select=
"$up"/>
262 <img src=
"up.png" width=
"24" height=
"24" border=
"0">
263 <xsl:attribute name=
"alt">
264 <xsl:call-template name=
"gentext">
265 <xsl:with-param name=
"key">nav-up
</xsl:with-param>
277 <xsl:when test=
"$home != .">
280 <xsl:attribute name=
"href">
281 <xsl:call-template name=
"href.target">
282 <xsl:with-param name=
"object" select=
"$home"/>
285 <img src=
"home.png" width=
"24" height=
"24" border=
"0">
286 <xsl:attribute name=
"alt">
287 <xsl:call-template name=
"gentext">
288 <xsl:with-param name=
"key">nav-home
</xsl:with-param>
299 <th width=
"100%" align=
"center">
300 <xsl:apply-templates select=
"$home" mode=
"object.title.markup"/>
303 <xsl:when test=
"count($next) > 0">
306 <xsl:attribute name=
"href">
307 <xsl:call-template name=
"href.target">
308 <xsl:with-param name=
"object" select=
"$next"/>
311 <img src=
"right.png" width=
"24" height=
"24" border=
"0">
312 <xsl:attribute name=
"alt">
313 <xsl:call-template name=
"gentext">
314 <xsl:with-param name=
"key">nav-next
</xsl:with-param>
326 <!--<xsl:if test="name()='refentry'"-->
328 <xsl:when test=
"count($refsections) > 0">
330 <td colspan=
"5" class=
"shortcuts">
331 <xsl:if test=
"count($sect_synopsis) > 0">
332 <a href=
"#{$section_id}.synopsis" class=
"shortcut">Top
</a>
334 <xsl:if test=
"count($sect_desc) > 0">
336 <a href=
"#{$section_id}.description" class=
"shortcut">
337 <xsl:value-of select=
"./refsect1[@role='desc']/title"/>
340 <xsl:if test=
"count($sect_object_hierarchy) > 0">
342 <a href=
"#{$section_id}.object-hierarchy" class=
"shortcut">
343 <xsl:value-of select=
"./refsect1[@role='object_hierarchy']/title"/>
346 <xsl:if test=
"count($sect_impl_interfaces) > 0">
348 <a href=
"#{$section_id}.implemented-interfaces" class=
"shortcut">
349 <xsl:value-of select=
"./refsect1[@role='impl_interfaces']/title"/>
352 <xsl:if test=
"count($sect_prerequisites) > 0">
354 <a href=
"#{$section_id}.prerequisites" class=
"shortcut">
355 <xsl:value-of select=
"./refsect1[@role='prerequisites']/title"/>
358 <xsl:if test=
"count($sect_derived_interfaces) > 0">
360 <a href=
"#{$section_id}.derived-interfaces" class=
"shortcut">
361 <xsl:value-of select=
"./refsect1[@role='derived_interfaces']/title"/>
364 <xsl:if test=
"count($sect_implementations) > 0">
366 <a href=
"#{$section_id}.implementations" class=
"shortcut">
367 <xsl:value-of select=
"./refsect1[@role='implementations']/title"/>
370 <xsl:if test=
"count($sect_properties) > 0">
372 <a href=
"#{$section_id}.properties" class=
"shortcut">
373 <xsl:value-of select=
"./refsect1[@role='properties']/title"/>
376 <xsl:if test=
"count($sect_child_properties) > 0">
378 <a href=
"#{$section_id}.child-properties" class=
"shortcut">
379 <xsl:value-of select=
"./refsect1[@role='child_properties']/title"/>
382 <xsl:if test=
"count($sect_style_properties) > 0">
384 <a href=
"#{$section_id}.style-properties" class=
"shortcut">
385 <xsl:value-of select=
"./refsect1[@role='style_properties']/title"/>
388 <xsl:if test=
"count($sect_signal_proto) > 0">
390 <a href=
"#{$section_id}.signals" class=
"shortcut">
391 <xsl:value-of select=
"./refsect1[@role='signal_proto']/title"/>
395 <xsl:if test="count($sect_details) > 0">
396 <a href="#details" class="shortcut">
397 <xsl:value-of select="./refsect1[@id='details']/title"/>
401 <xsl:if test="count($sect_property_details) > 0">
402 <a href="#property_details" class="shortcut">
403 <xsl:value-of select="./refsect1[@id='property_details']/title"/>
407 <xsl:if test="count($sect_child_property_details) > 0">
408 <a href="#child_property_details" class="shortcut">
409 <xsl:value-of select="./refsect1[@id='property_child_details']/title"/>
413 <xsl:if test="count($sect_style_property_details) > 0">
414 <a href="#style_property_details" class="shortcut">
415 <xsl:value-of select="./refsect1[@id='style_property_details']/title"/>
419 <xsl:if test="count($sect_signals) > 0">
420 <a href="#signals" class="shortcut">
421 <xsl:value-of select="./refsect1[@id='signals']/title"/>
429 <!-- this is not yet very nice, as it requires all glossdic/indexdiv
430 elements having a anchor element. maybe we can customize the xsl
431 to automaticaly create local anchors
433 <xsl:when test=
"count($glssections) > 0">
435 <td colspan=
"5" class=
"shortcuts">
436 <xsl:for-each select=
"./glossdiv">
437 <xsl:if test=
"position() > 1">
441 <xsl:attribute name=
"href">#gls
<xsl:value-of select=
"./title"/></xsl:attribute>
442 <xsl:value-of select=
"./title"/>
448 <xsl:when test=
"count($idxsections) > 0">
450 <td colspan=
"5" class=
"shortcuts">
451 <xsl:for-each select=
"./indexdiv/indexdiv">
452 <xsl:if test=
"position() > 1">
456 <xsl:attribute name=
"href">#idx
<xsl:value-of select=
"./title"/></xsl:attribute>
457 <xsl:value-of select=
"./title"/>
468 <xsl:template name=
"footer.navigation">
471 <!-- avoid creating multiple identical indices
472 if the stylesheets don't support filtered indices
474 <xsl:template match=
"index">
475 <xsl:variable name=
"has-filtered-index">
476 <xsl:call-template name=
"version-greater-or-equal">
477 <xsl:with-param name=
"ver1" select=
"$VERSION" />
478 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
481 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
486 <xsl:template match=
"index" mode=
"toc">
487 <xsl:variable name=
"has-filtered-index">
488 <xsl:call-template name=
"version-greater-or-equal">
489 <xsl:with-param name=
"ver1" select=
"$VERSION" />
490 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
493 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
498 <xsl:template match=
"para">
500 <xsl:when test=
"@role = 'gallery'">
501 <div class=
"container">
502 <div class=
"gallery-spacer"> </div>
503 <xsl:apply-templates mode=
"gallery.mode"/>
504 <div class=
"gallery-spacer"> </div>
513 <xsl:template match=
"link" mode=
"gallery.mode">
514 <div class=
"gallery-float">
515 <xsl:apply-templates select=
"."/>
519 <!-- add gallery handling to refnamediv template -->
520 <xsl:template match=
"refnamediv">
521 <div class=
"{name(.)}">
523 <tr><td valign=
"top">
524 <xsl:call-template name=
"anchor"/>
526 <xsl:when test=
"$refentry.generate.name != 0">
528 <xsl:call-template name=
"gentext">
529 <xsl:with-param name=
"key" select=
"'RefName'"/>
533 <xsl:when test=
"$refentry.generate.title != 0">
536 <xsl:when test=
"../refmeta/refentrytitle">
537 <xsl:apply-templates select=
"../refmeta/refentrytitle"/>
540 <xsl:apply-templates select=
"refname[1]"/>
547 <xsl:apply-templates/>
550 <td valign=
"top" align=
"right">
551 <!-- find the gallery image to use here
552 - determine the id of the enclosing refentry
553 - look for an inlinegraphic inside a link with linkend == refentryid inside a para with role == gallery
556 <xsl:variable name=
"refentryid" select=
"../@id"/>
557 <xsl:apply-templates select=
"//para[@role = 'gallery']/link[@linkend = $refentryid]/inlinegraphic"/>
563 <!-- add anchors for index sections -->
564 <xsl:template match=
"indexdiv">
565 <a><xsl:attribute name=
"name">idx
<xsl:value-of select=
"./title"/></xsl:attribute></a>
566 <xsl:apply-templates/>
569 <!-- add anchors for glossary sections -->
570 <xsl:template match=
"glossdiv">
571 <a><xsl:attribute name=
"name">gls
<xsl:value-of select=
"./title"/></xsl:attribute></a>
572 <xsl:apply-templates/>
575 <!-- Exterminate any trace of indexterms in the main flow -->
576 <xsl:template match=
"indexterm">
579 <!-- Extra link on the right side of doc-blobs -->
580 <xsl:template name=
"user.format.extralinks">
581 <xsl:if test=
"../ulink[@role='extralinks']">
582 <span class=
"extralinks">
583 <xsl:for-each select=
"../ulink[@role='extralinks']">
584 <xsl:if test=
"position() = 1">[
 </xsl:if>
585 <xsl:if test=
"position() > 1"> |
 </xsl:if>
587 <xsl:attribute name=
"href"><xsl:value-of select=
"@url"/></xsl:attribute>
588 <xsl:copy-of select=
"text()" />
590 <xsl:if test=
"position() = last()"> ]
</xsl:if>
594 <!--xsl:copy-of select="text()" /-->
595 <xsl:apply-templates/>
598 <xsl:template match=
"//refsect2/ulink[@role='extralinks']"/>
599 <xsl:template match=
"//refsect1/ulink[@role='extralinks']"/>
601 <xsl:template match=
"//refsect2/title">
602 <h3><xsl:call-template name=
"user.format.extralinks"/></h3>
605 <xsl:template match=
"//refsect1/title">
606 <h2><xsl:call-template name=
"user.format.extralinks"/></h2>
609 <!-- ==================================================================== -->
611 <xsl:template match=
"acronym">
612 <xsl:call-template name=
"generate.acronym.link"/>
615 <xsl:template name=
"generate.acronym.link">
616 <xsl:param name=
"acronym">
617 <xsl:apply-templates/>
620 We use for-each to change context to the database document because key()
621 only locates elements in the same document as the context node!
624 <xsl:param name=
"value" >
625 <xsl:value-of select=
"//glossentry/glossterm[text()=$acronym]/../glossdef/para[1]" />
628 <xsl:when test=
"$value=''">
631 In gtk-doc.xsl: For acronym (
<xsl:value-of select=
"$acronym"/>) no value found!
634 <xsl:attribute name=
"href">
635 <xsl:text>http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=
</xsl:text>
636 <xsl:value-of select=
"$acronym"/>
638 <xsl:call-template name=
"inline.charseq"/>
644 <xsl:attribute name=
"title">
645 <xsl:value-of select=
"$value"/>
647 <xsl:call-template name=
"inline.charseq"/>