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"
142 content=
"GTK-Doc V{$gtkdoc.version} (XML mode)"/>
144 <link rel=
"stylesheet" href=
"style.css" type=
"text/css"/>
146 <!-- copied from the html.head template in the docbook stylesheets
147 we don't want links for all refentrys, thats just too much
149 <xsl:variable name=
"this" select=
"."/>
150 <xsl:for-each select=
"//part
155 |//appendix[not(parent::article)]|appendix
156 |//glossary[not(parent::article)]|glossary
157 |//index[not(parent::article)]|index">
158 <link rel=
"{local-name(.)}">
159 <xsl:attribute name=
"href">
160 <xsl:call-template name=
"href.target">
161 <xsl:with-param name=
"context" select=
"$this"/>
162 <xsl:with-param name=
"object" select=
"."/>
165 <xsl:attribute name=
"title">
166 <xsl:apply-templates select=
"." mode=
"object.title.markup.textonly"/>
172 <xsl:template name=
"user.footer.content">
176 <xsl:when test=
"$gtkdoc.version">
177 Generated by GTK-Doc V
<xsl:copy-of select=
"$gtkdoc.version" />
186 <xsl:template match=
"title" mode=
"book.titlepage.recto.mode">
187 <table class=
"navigation" id=
"top" width=
"100%"
188 cellpadding=
"2" cellspacing=
"0">
191 <p class=
"{name(.)}">
192 <xsl:value-of select=
"."/>
199 <xsl:template name=
"header.navigation">
200 <xsl:param name=
"prev" select=
"/foo"/>
201 <xsl:param name=
"next" select=
"/foo"/>
202 <xsl:variable name=
"home" select=
"/*[1]"/>
203 <xsl:variable name=
"up" select=
"parent::*"/>
204 <xsl:variable name=
"refsections" select=
"./refsect1[@role]"/>
205 <xsl:variable name=
"glssections" select=
"./glossdiv/title"/>
206 <xsl:variable name=
"idxsections" select=
"./indexdiv/indexdiv/title"/>
207 <xsl:variable name=
"section_id" select=
"./@id"/>
208 <xsl:variable name=
"sect_object_hierarchy" select=
"./refsect1[@role='object_hierarchy']"/>
209 <xsl:variable name=
"sect_impl_interfaces" select=
"./refsect1[@role='impl_interfaces']"/>
210 <xsl:variable name=
"sect_prerequisites" select=
"./refsect1[@role='prerequisites']"/>
211 <xsl:variable name=
"sect_derived_interfaces" select=
"./refsect1[@role='derived_interfaces']"/>
212 <xsl:variable name=
"sect_implementations" select=
"./refsect1[@role='implementations']"/>
213 <xsl:variable name=
"sect_properties" select=
"./refsect1[@role='properties']"/>
214 <xsl:variable name=
"sect_child_properties" select=
"./refsect1[@role='child_properties']"/>
215 <xsl:variable name=
"sect_style_properties" select=
"./refsect1[@role='style_properties']"/>
216 <xsl:variable name=
"sect_signal_proto" select=
"./refsect1[@role='signal_proto']"/>
217 <xsl:variable name=
"sect_desc" select=
"./refsect1[@role='desc']"/>
218 <xsl:variable name=
"sect_synopsis" select=
"./refsynopsisdiv[@role='synopsis']"/>
220 <xsl:variable name="sect_details" select="./refsect1[@id='details']"/>
221 <xsl:variable name="sect_property_details" select="./refsect1[@id='property_details']"/>
222 <xsl:variable name="sect_child_property_details" select="./refsect1[@id='child_property_details']"/>
223 <xsl:variable name="sect_style_property_details" select="./refsect1[@id='style_property_details']"/>
224 <xsl:variable name="sect_signals" select="./refsect1[@id='signals']"/>
227 <xsl:if test=
"$suppress.navigation = '0' and $home != .">
228 <table class=
"navigation" id=
"top" width=
"100%"
229 summary =
"Navigation header" cellpadding=
"2" cellspacing=
"2">
232 <xsl:when test=
"count($prev) > 0">
235 <xsl:attribute name=
"href">
236 <xsl:call-template name=
"href.target">
237 <xsl:with-param name=
"object" select=
"$prev"/>
240 <img src=
"left.png" width=
"24" height=
"24" border=
"0">
241 <xsl:attribute name=
"alt">
242 <xsl:call-template name=
"gentext">
243 <xsl:with-param name=
"key">nav-prev
</xsl:with-param>
255 <xsl:when test=
"count($up) > 0 and $up != $home">
258 <xsl:attribute name=
"href">
259 <xsl:call-template name=
"href.target">
260 <xsl:with-param name=
"object" select=
"$up"/>
263 <img src=
"up.png" width=
"24" height=
"24" border=
"0">
264 <xsl:attribute name=
"alt">
265 <xsl:call-template name=
"gentext">
266 <xsl:with-param name=
"key">nav-up
</xsl:with-param>
278 <xsl:when test=
"$home != .">
281 <xsl:attribute name=
"href">
282 <xsl:call-template name=
"href.target">
283 <xsl:with-param name=
"object" select=
"$home"/>
286 <img src=
"home.png" width=
"24" height=
"24" border=
"0">
287 <xsl:attribute name=
"alt">
288 <xsl:call-template name=
"gentext">
289 <xsl:with-param name=
"key">nav-home
</xsl:with-param>
300 <th width=
"100%" align=
"center">
301 <xsl:apply-templates select=
"$home" mode=
"object.title.markup"/>
304 <xsl:when test=
"count($next) > 0">
307 <xsl:attribute name=
"href">
308 <xsl:call-template name=
"href.target">
309 <xsl:with-param name=
"object" select=
"$next"/>
312 <img src=
"right.png" width=
"24" height=
"24" border=
"0">
313 <xsl:attribute name=
"alt">
314 <xsl:call-template name=
"gentext">
315 <xsl:with-param name=
"key">nav-next
</xsl:with-param>
327 <!--<xsl:if test="name()='refentry'"-->
329 <xsl:when test=
"count($refsections) > 0">
331 <td colspan=
"5" class=
"shortcuts">
332 <xsl:if test=
"count($sect_synopsis) > 0">
333 <a href=
"#{$section_id}.synopsis" class=
"shortcut">Top
</a>
335 <xsl:if test=
"count($sect_desc) > 0">
337 <a href=
"#{$section_id}.description" class=
"shortcut">
338 <xsl:value-of select=
"./refsect1[@role='desc']/title"/>
341 <xsl:if test=
"count($sect_object_hierarchy) > 0">
343 <a href=
"#{$section_id}.object-hierarchy" class=
"shortcut">
344 <xsl:value-of select=
"./refsect1[@role='object_hierarchy']/title"/>
347 <xsl:if test=
"count($sect_impl_interfaces) > 0">
349 <a href=
"#{$section_id}.implemented-interfaces" class=
"shortcut">
350 <xsl:value-of select=
"./refsect1[@role='impl_interfaces']/title"/>
353 <xsl:if test=
"count($sect_prerequisites) > 0">
355 <a href=
"#{$section_id}.prerequisites" class=
"shortcut">
356 <xsl:value-of select=
"./refsect1[@role='prerequisites']/title"/>
359 <xsl:if test=
"count($sect_derived_interfaces) > 0">
361 <a href=
"#{$section_id}.derived-interfaces" class=
"shortcut">
362 <xsl:value-of select=
"./refsect1[@role='derived_interfaces']/title"/>
365 <xsl:if test=
"count($sect_implementations) > 0">
367 <a href=
"#{$section_id}.implementations" class=
"shortcut">
368 <xsl:value-of select=
"./refsect1[@role='implementations']/title"/>
371 <xsl:if test=
"count($sect_properties) > 0">
373 <a href=
"#{$section_id}.properties" class=
"shortcut">
374 <xsl:value-of select=
"./refsect1[@role='properties']/title"/>
377 <xsl:if test=
"count($sect_child_properties) > 0">
379 <a href=
"#{$section_id}.child-properties" class=
"shortcut">
380 <xsl:value-of select=
"./refsect1[@role='child_properties']/title"/>
383 <xsl:if test=
"count($sect_style_properties) > 0">
385 <a href=
"#{$section_id}.style-properties" class=
"shortcut">
386 <xsl:value-of select=
"./refsect1[@role='style_properties']/title"/>
389 <xsl:if test=
"count($sect_signal_proto) > 0">
391 <a href=
"#{$section_id}.signals" class=
"shortcut">
392 <xsl:value-of select=
"./refsect1[@role='signal_proto']/title"/>
396 <xsl:if test="count($sect_details) > 0">
397 <a href="#details" class="shortcut">
398 <xsl:value-of select="./refsect1[@id='details']/title"/>
402 <xsl:if test="count($sect_property_details) > 0">
403 <a href="#property_details" class="shortcut">
404 <xsl:value-of select="./refsect1[@id='property_details']/title"/>
408 <xsl:if test="count($sect_child_property_details) > 0">
409 <a href="#child_property_details" class="shortcut">
410 <xsl:value-of select="./refsect1[@id='property_child_details']/title"/>
414 <xsl:if test="count($sect_style_property_details) > 0">
415 <a href="#style_property_details" class="shortcut">
416 <xsl:value-of select="./refsect1[@id='style_property_details']/title"/>
420 <xsl:if test="count($sect_signals) > 0">
421 <a href="#signals" class="shortcut">
422 <xsl:value-of select="./refsect1[@id='signals']/title"/>
430 <!-- this is not yet very nice, as it requires all glossdic/indexdiv
431 elements having a anchor element. maybe we can customize the xsl
432 to automaticaly create local anchors
434 <xsl:when test=
"count($glssections) > 0">
436 <td colspan=
"5" class=
"shortcuts">
437 <xsl:for-each select=
"./glossdiv">
438 <xsl:if test=
"position() > 1">
442 <xsl:attribute name=
"href">#gls
<xsl:value-of select=
"./title"/></xsl:attribute>
443 <xsl:value-of select=
"./title"/>
449 <xsl:when test=
"count($idxsections) > 0">
451 <td colspan=
"5" class=
"shortcuts">
452 <xsl:for-each select=
"./indexdiv/indexdiv">
453 <xsl:if test=
"position() > 1">
457 <xsl:attribute name=
"href">#idx
<xsl:value-of select=
"./title"/></xsl:attribute>
458 <xsl:value-of select=
"./title"/>
469 <xsl:template name=
"footer.navigation">
472 <!-- avoid creating multiple identical indices
473 if the stylesheets don't support filtered indices
475 <xsl:template match=
"index">
476 <xsl:variable name=
"has-filtered-index">
477 <xsl:call-template name=
"version-greater-or-equal">
478 <xsl:with-param name=
"ver1" select=
"$VERSION" />
479 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
482 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
487 <xsl:template match=
"index" mode=
"toc">
488 <xsl:variable name=
"has-filtered-index">
489 <xsl:call-template name=
"version-greater-or-equal">
490 <xsl:with-param name=
"ver1" select=
"$VERSION" />
491 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
494 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
499 <xsl:template match=
"para">
501 <xsl:when test=
"@role = 'gallery'">
502 <div class=
"container">
503 <div class=
"gallery-spacer"> </div>
504 <xsl:apply-templates mode=
"gallery.mode"/>
505 <div class=
"gallery-spacer"> </div>
514 <xsl:template match=
"link" mode=
"gallery.mode">
515 <div class=
"gallery-float">
516 <xsl:apply-templates select=
"."/>
520 <!-- add gallery handling to refnamediv template -->
521 <xsl:template match=
"refnamediv">
522 <div class=
"{name(.)}">
524 <tr><td valign=
"top">
525 <xsl:call-template name=
"anchor"/>
527 <xsl:when test=
"$refentry.generate.name != 0">
529 <xsl:call-template name=
"gentext">
530 <xsl:with-param name=
"key" select=
"'RefName'"/>
534 <xsl:when test=
"$refentry.generate.title != 0">
537 <xsl:when test=
"../refmeta/refentrytitle">
538 <xsl:apply-templates select=
"../refmeta/refentrytitle"/>
541 <xsl:apply-templates select=
"refname[1]"/>
548 <xsl:apply-templates/>
551 <td valign=
"top" align=
"right">
552 <!-- find the gallery image to use here
553 - determine the id of the enclosing refentry
554 - look for an inlinegraphic inside a link with linkend == refentryid inside a para with role == gallery
557 <xsl:variable name=
"refentryid" select=
"../@id"/>
558 <xsl:apply-templates select=
"//para[@role = 'gallery']/link[@linkend = $refentryid]/inlinegraphic"/>
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 <xsl:template match=
"glossdiv">
570 <a><xsl:attribute name=
"name">gls
<xsl:value-of select=
"./title"/></xsl:attribute></a>
571 <xsl:apply-templates/>
574 <!-- Exterminate any trace of indexterms in the main flow -->
575 <xsl:template match=
"indexterm">
578 <!-- ==================================================================== -->
580 <xsl:template match=
"acronym">
581 <xsl:call-template name=
"generate.acronym.link"/>
584 <xsl:template name=
"generate.acronym.link">
585 <xsl:param name=
"acronym">
586 <xsl:apply-templates/>
589 We use for-each to change context to the database document because key()
590 only locates elements in the same document as the context node!
593 <xsl:param name=
"value" >
594 <xsl:value-of select=
"//glossentry/glossterm[text()=$acronym]/../glossdef/para[1]" />
597 <xsl:when test=
"$value=''">
600 In gtk-doc.xsl: For acronym (
<xsl:value-of select=
"$acronym"/>) no value found!
603 <xsl:attribute name=
"href">
604 <xsl:text>http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=
</xsl:text>
605 <xsl:value-of select=
"$acronym"/>
607 <xsl:call-template name=
"inline.charseq"/>
613 <xsl:attribute name=
"title">
614 <xsl:value-of select=
"$value"/>
616 <xsl:call-template name=
"inline.charseq"/>