1 <?xml version='
1.0'
?> <!--*- mode: xml -*-->
2 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
3 xmlns:
l=
"http://docbook.sourceforge.net/xmlns/l10n/1.0"
4 exclude-result-prefixes=
"l"
7 <!-- import the chunked XSL stylesheet -->
8 <xsl:import href=
"http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/>
9 <xsl:include href=
"devhelp.xsl"/>
10 <xsl:include href=
"devhelp2.xsl"/>
11 <xsl:include href=
"version-greater-or-equal.xsl"/>
13 <!-- change some parameters -->
14 <!-- http://docbook.sourceforge.net/release/xsl/current/doc/html/index.html -->
15 <xsl:param name=
"toc.section.depth">2</xsl:param>
16 <xsl:param name=
"generate.toc">
25 <xsl:param name=
"chunker.output.encoding" select=
"'UTF-8'"/>
26 <xsl:param name=
"chunker.output.indent" select=
"'yes'"/>
27 <xsl:param name=
"chunker.output.doctype-public" select=
"'-//W3C//DTD HTML 4.01 Transitional//EN'"/>
28 <xsl:param name=
"chunk.fast" select=
"1"/>
30 <xsl:param name=
"default.encoding" select=
"'UTF-8'"/>
31 <xsl:param name=
"chapter.autolabel" select=
"0"/>
32 <xsl:param name=
"use.id.as.filename" select=
"1"/>
33 <xsl:param name=
"html.ext" select=
"'.html'"/>
34 <xsl:param name=
"refentry.generate.name" select=
"0"/>
35 <xsl:param name=
"refentry.generate.title" select=
"1"/>
37 <!-- use index filtering (if available) -->
38 <xsl:param name=
"index.on.role" select=
"1"/>
40 <!-- display variablelists as tables -->
41 <xsl:param name=
"variablelist.as.table" select=
"1"/>
43 <!-- new things to consider
44 <xsl:param name="glossterm.auto.link" select="0"></xsl:param>
47 <!-- this gets set on the command line ... -->
48 <xsl:param name=
"gtkdoc.version" select=
"''"/>
49 <xsl:param name=
"gtkdoc.bookname" select=
"''"/>
51 <!-- ========================================================= -->
53 <!-- l10n is slow, we don't ue it, so we'd like to turn it off
54 this atleast avoid the re-evaluation -->
55 <xsl:template name=
"l10n.language">en
</xsl:template>
57 <xsl:param name=
"gtkdoc.l10n.xml" select=
"document('http://docbook.sourceforge.net/release/xsl/current/common/en.xml')"/>
59 <xsl:template name=
"gentext">
60 <xsl:param name=
"key" select=
"local-name(.)"/>
62 <xsl:variable name=
"l10n.gentext"
63 select=
"($gtkdoc.l10n.xml/l:l10n/l:gentext[@key=$key])[1]"/>
66 <xsl:when test=
"$l10n.gentext">
67 <xsl:value-of select=
"$l10n.gentext/@text"/>
71 <xsl:text>No
"en" localization of
"</xsl:text>
72 <xsl:value-of select="$key
"/>
73 <xsl:text>" exists.
</xsl:text>
79 <xsl:template name=
"gentext.dingbat">
80 <xsl:param name=
"dingbat">bullet
</xsl:param>
82 <xsl:variable name=
"l10n.dingbat"
83 select=
"($gtkdoc.l10n.xml/l:l10n/l:dingbat[@key=$dingbat])[1]"/>
86 <xsl:when test=
"$l10n.dingbat">
87 <xsl:value-of select=
"$l10n.dingbat/@text"/>
91 <xsl:text>No
"en" localization of dingbat
</xsl:text>
92 <xsl:value-of select=
"$dingbat"/>
93 <xsl:text> exists; using
"en".
</xsl:text>
100 <xsl:template name=
"gentext.template">
101 <xsl:param name=
"context" select=
"'default'"/>
102 <xsl:param name=
"name" select=
"'default'"/>
103 <xsl:param name=
"origname" select=
"$name"/>
104 <xsl:param name=
"verbose" select=
"1"/>
106 <!-- this is called with context="title|title-numbered|title-unnumbered
108 <xsl:text>context:</xsl:text><xsl:value-of select="$context"/>
112 <xsl:variable name=
"context.node"
113 select=
"$gtkdoc.l10n.xml/l:l10n/l:context[@name=$context]"/>
115 <xsl:variable name=
"template.node"
116 select=
"($context.node/l:template[@name=$name])[1]"/>
119 <xsl:when test=
"$template.node/@text">
120 <xsl:value-of select=
"$template.node/@text"/>
124 <xsl:when test=
"contains($name, '/')">
125 <xsl:call-template name=
"gentext.template">
126 <xsl:with-param name=
"context" select=
"$context"/>
127 <xsl:with-param name=
"name" select=
"substring-after($name, '/')"/>
128 <xsl:with-param name=
"origname" select=
"$origname"/>
129 <xsl:with-param name=
"verbose" select=
"$verbose"/>
132 <xsl:when test=
"$verbose = 0">
139 <!-- ========================================================= -->
140 <!-- template to create the index.sgml anchor index -->
142 <xsl:param name=
"gtkdoc.refsect2" select=
"//refsect2" />
144 <xsl:template match=
"book|article">
145 <xsl:variable name=
"tooldver">
146 <xsl:call-template name=
"version-greater-or-equal">
147 <xsl:with-param name=
"ver1" select=
"$VERSION" />
148 <xsl:with-param name=
"ver2">1.36</xsl:with-param>
151 <xsl:if test=
"$tooldver = 0">
152 <xsl:message terminate=
"yes">
153 FATAL-ERROR: You need the DocBook XSL Stylesheets version
1.36 or higher
154 to build the documentation.
155 Get a newer version at http://docbook.sourceforge.net/projects/xsl/
160 <!-- generate the index.sgml href index -->
161 <xsl:call-template name=
"generate.index"/>
162 <!-- generate $book.devhelp{2} -->
163 <xsl:call-template name=
"generate.devhelp"/>
164 <xsl:call-template name=
"generate.devhelp2"/>
167 <xsl:template name=
"generate.index">
168 <xsl:call-template name=
"write.text.chunk">
169 <xsl:with-param name=
"filename" select=
"'index.sgml'"/>
170 <xsl:with-param name=
"content">
171 <xsl:apply-templates select=
"/book/bookinforeleaseinfo/ulink"
172 mode=
"generate.index.mode"/>
173 <!-- check all anchor and refentry elements -->
174 <xsl:apply-templates select=
"//anchor|//refentry|//refsect1|$gtkdoc.refsect2|//refsynopsisdiv|//varlistentry"
175 mode=
"generate.index.mode"/>
177 <xsl:with-param name=
"default.encoding" select=
"'UTF-8'"/>
178 <xsl:with-param name=
"chunker.output.indent" select=
"'no'"/>
182 <xsl:template match=
"*" mode=
"generate.index.mode">
183 <xsl:if test=
"not(@href) and count(@id) > 0">
184 <xsl:text><ANCHOR id=
"</xsl:text>
185 <xsl:value-of select=
"@id"/>
186 <xsl:text>" href=
"</xsl:text>
187 <xsl:if test=
"$gtkdoc.bookname">
188 <xsl:value-of select=
"$gtkdoc.bookname"/>
189 <xsl:text>/
</xsl:text>
191 <xsl:call-template name=
"href.target"/>
192 <xsl:text>"> </xsl:text>
196 <xsl:template match=
"/book/bookinfo/releaseinfo/ulink" mode=
"generate.index.mode">
197 <xsl:if test=
"@role='online-location'">
198 <xsl:text><ONLINE href=
"</xsl:text>
199 <xsl:value-of select=
"@url"/>
200 <xsl:text>"> </xsl:text>
204 <!-- ========================================================= -->
205 <!-- template to output gtkdoclink elements for the unknown targets -->
207 <xsl:template match=
"link">
209 <xsl:when test=
"id(@linkend)">
213 <GTKDOCLINK HREF=
"{@linkend}">
214 <xsl:apply-templates/>
220 <!-- ========================================================= -->
221 <!-- Below are the visual portions of the stylesheet. They provide
222 the normal gtk-doc output style. -->
224 <xsl:param name=
"shade.verbatim" select=
"0"/>
225 <xsl:param name=
"refentry.separator" select=
"0"/>
227 <xsl:template match=
"refsect2">
228 <xsl:if test=
"preceding-sibling::refsect2">
234 <xsl:param name=
"gtkdoc.linknodes" select=
"//part
239 |//appendix[not(parent::article)]|appendix
240 |//glossary[not(parent::article)]|glossary
241 |//index[not(parent::article)]|index"/>
243 <xsl:template name=
"user.head.content">
244 <xsl:if test=
"$gtkdoc.version">
245 <meta name=
"generator" content=
"GTK-Doc V{$gtkdoc.version} (XML mode)"/>
247 <link rel=
"stylesheet" href=
"style.css" type=
"text/css"/>
249 <!-- copied from the html.head template in the docbook stylesheets
250 we don't want links for all refentrys, thats just too much
252 <xsl:variable name=
"this" select=
"."/>
253 <xsl:for-each select=
"$gtkdoc.linknodes">
254 <link rel=
"{local-name(.)}">
255 <xsl:attribute name=
"href">
256 <xsl:call-template name=
"href.target">
257 <xsl:with-param name=
"context" select=
"$this"/>
258 <xsl:with-param name=
"object" select=
"."/>
261 <xsl:attribute name=
"title">
262 <xsl:apply-templates select=
"." mode=
"object.title.markup.textonly"/>
268 <xsl:template name=
"user.footer.content">
272 <xsl:when test=
"$gtkdoc.version">
273 Generated by GTK-Doc V
<xsl:copy-of select=
"$gtkdoc.version" />
282 <xsl:template match=
"title" mode=
"book.titlepage.recto.mode">
283 <table class=
"navigation" id=
"top" width=
"100%"
284 cellpadding=
"2" cellspacing=
"0">
287 <p class=
"{name(.)}">
288 <xsl:value-of select=
"."/>
295 <xsl:template name=
"header.navigation">
296 <xsl:param name=
"prev" select=
"/foo"/>
297 <xsl:param name=
"next" select=
"/foo"/>
298 <xsl:variable name=
"home" select=
"/*[1]"/>
299 <xsl:variable name=
"up" select=
"parent::*"/>
300 <xsl:variable name=
"refsections" select=
"./refsect1[@role]"/>
301 <xsl:variable name=
"glssections" select=
"./glossdiv/title"/>
302 <xsl:variable name=
"idxsections" select=
"./indexdiv/indexdiv/title"/>
303 <xsl:variable name=
"section_id" select=
"./@id"/>
304 <xsl:variable name=
"sect_object_hierarchy" select=
"./refsect1[@role='object_hierarchy']"/>
305 <xsl:variable name=
"sect_impl_interfaces" select=
"./refsect1[@role='impl_interfaces']"/>
306 <xsl:variable name=
"sect_prerequisites" select=
"./refsect1[@role='prerequisites']"/>
307 <xsl:variable name=
"sect_derived_interfaces" select=
"./refsect1[@role='derived_interfaces']"/>
308 <xsl:variable name=
"sect_implementations" select=
"./refsect1[@role='implementations']"/>
309 <xsl:variable name=
"sect_properties" select=
"./refsect1[@role='properties']"/>
310 <xsl:variable name=
"sect_child_properties" select=
"./refsect1[@role='child_properties']"/>
311 <xsl:variable name=
"sect_style_properties" select=
"./refsect1[@role='style_properties']"/>
312 <xsl:variable name=
"sect_signal_proto" select=
"./refsect1[@role='signal_proto']"/>
313 <xsl:variable name=
"sect_desc" select=
"./refsect1[@role='desc']"/>
314 <xsl:variable name=
"sect_synopsis" select=
"./refsynopsisdiv[@role='synopsis']"/>
316 <xsl:variable name="sect_details" select="./refsect1[@id='details']"/>
317 <xsl:variable name="sect_property_details" select="./refsect1[@id='property_details']"/>
318 <xsl:variable name="sect_child_property_details" select="./refsect1[@id='child_property_details']"/>
319 <xsl:variable name="sect_style_property_details" select="./refsect1[@id='style_property_details']"/>
320 <xsl:variable name="sect_signals" select="./refsect1[@id='signals']"/>
323 <xsl:if test=
"$suppress.navigation = '0' and $home != .">
324 <table class=
"navigation" id=
"top" width=
"100%"
325 summary =
"Navigation header" cellpadding=
"2" cellspacing=
"2">
328 <xsl:when test=
"count($prev) > 0">
331 <xsl:attribute name=
"href">
332 <xsl:call-template name=
"href.target">
333 <xsl:with-param name=
"object" select=
"$prev"/>
336 <img src=
"left.png" width=
"24" height=
"24" border=
"0">
337 <xsl:attribute name=
"alt">
338 <xsl:call-template name=
"gentext">
339 <xsl:with-param name=
"key">nav-prev
</xsl:with-param>
351 <xsl:when test=
"count($up) > 0 and $up != $home">
354 <xsl:attribute name=
"href">
355 <xsl:call-template name=
"href.target">
356 <xsl:with-param name=
"object" select=
"$up"/>
359 <img src=
"up.png" width=
"24" height=
"24" border=
"0">
360 <xsl:attribute name=
"alt">
361 <xsl:call-template name=
"gentext">
362 <xsl:with-param name=
"key">nav-up
</xsl:with-param>
374 <xsl:when test=
"$home != .">
377 <xsl:attribute name=
"href">
378 <xsl:call-template name=
"href.target">
379 <xsl:with-param name=
"object" select=
"$home"/>
382 <img src=
"home.png" width=
"24" height=
"24" border=
"0">
383 <xsl:attribute name=
"alt">
384 <xsl:call-template name=
"gentext">
385 <xsl:with-param name=
"key">nav-home
</xsl:with-param>
396 <th width=
"100%" align=
"center">
397 <xsl:apply-templates select=
"$home" mode=
"object.title.markup"/>
400 <xsl:when test=
"count($next) > 0">
403 <xsl:attribute name=
"href">
404 <xsl:call-template name=
"href.target">
405 <xsl:with-param name=
"object" select=
"$next"/>
408 <img src=
"right.png" width=
"24" height=
"24" border=
"0">
409 <xsl:attribute name=
"alt">
410 <xsl:call-template name=
"gentext">
411 <xsl:with-param name=
"key">nav-next
</xsl:with-param>
423 <!--<xsl:if test="name()='refentry'"-->
425 <xsl:when test=
"count($refsections) > 0">
427 <td colspan=
"5" class=
"shortcuts">
428 <xsl:if test=
"count($sect_synopsis) > 0">
429 <a href=
"#{$section_id}.synopsis" class=
"shortcut">Top
</a>
431 <xsl:if test=
"count($sect_desc) > 0">
433 <a href=
"#{$section_id}.description" class=
"shortcut">
434 <xsl:value-of select=
"./refsect1[@role='desc']/title"/>
437 <xsl:if test=
"count($sect_object_hierarchy) > 0">
439 <a href=
"#{$section_id}.object-hierarchy" class=
"shortcut">
440 <xsl:value-of select=
"./refsect1[@role='object_hierarchy']/title"/>
443 <xsl:if test=
"count($sect_impl_interfaces) > 0">
445 <a href=
"#{$section_id}.implemented-interfaces" class=
"shortcut">
446 <xsl:value-of select=
"./refsect1[@role='impl_interfaces']/title"/>
449 <xsl:if test=
"count($sect_prerequisites) > 0">
451 <a href=
"#{$section_id}.prerequisites" class=
"shortcut">
452 <xsl:value-of select=
"./refsect1[@role='prerequisites']/title"/>
455 <xsl:if test=
"count($sect_derived_interfaces) > 0">
457 <a href=
"#{$section_id}.derived-interfaces" class=
"shortcut">
458 <xsl:value-of select=
"./refsect1[@role='derived_interfaces']/title"/>
461 <xsl:if test=
"count($sect_implementations) > 0">
463 <a href=
"#{$section_id}.implementations" class=
"shortcut">
464 <xsl:value-of select=
"./refsect1[@role='implementations']/title"/>
467 <xsl:if test=
"count($sect_properties) > 0">
469 <a href=
"#{$section_id}.properties" class=
"shortcut">
470 <xsl:value-of select=
"./refsect1[@role='properties']/title"/>
473 <xsl:if test=
"count($sect_child_properties) > 0">
475 <a href=
"#{$section_id}.child-properties" class=
"shortcut">
476 <xsl:value-of select=
"./refsect1[@role='child_properties']/title"/>
479 <xsl:if test=
"count($sect_style_properties) > 0">
481 <a href=
"#{$section_id}.style-properties" class=
"shortcut">
482 <xsl:value-of select=
"./refsect1[@role='style_properties']/title"/>
485 <xsl:if test=
"count($sect_signal_proto) > 0">
487 <a href=
"#{$section_id}.signals" class=
"shortcut">
488 <xsl:value-of select=
"./refsect1[@role='signal_proto']/title"/>
492 <xsl:if test="count($sect_details) > 0">
493 <a href="#details" class="shortcut">
494 <xsl:value-of select="./refsect1[@id='details']/title"/>
498 <xsl:if test="count($sect_property_details) > 0">
499 <a href="#property_details" class="shortcut">
500 <xsl:value-of select="./refsect1[@id='property_details']/title"/>
504 <xsl:if test="count($sect_child_property_details) > 0">
505 <a href="#child_property_details" class="shortcut">
506 <xsl:value-of select="./refsect1[@id='property_child_details']/title"/>
510 <xsl:if test="count($sect_style_property_details) > 0">
511 <a href="#style_property_details" class="shortcut">
512 <xsl:value-of select="./refsect1[@id='style_property_details']/title"/>
516 <xsl:if test="count($sect_signals) > 0">
517 <a href="#signals" class="shortcut">
518 <xsl:value-of select="./refsect1[@id='signals']/title"/>
526 <!-- this is not yet very nice, as it requires all glossdic/indexdiv
527 elements having a anchor element. maybe we can customize the xsl
528 to automaticaly create local anchors
530 <xsl:when test=
"count($glssections) > 0">
532 <td colspan=
"5" class=
"shortcuts">
533 <xsl:for-each select=
"./glossdiv">
534 <xsl:if test=
"position() > 1">
538 <xsl:attribute name=
"href">#gls
<xsl:value-of select=
"./title"/></xsl:attribute>
539 <xsl:value-of select=
"./title"/>
545 <xsl:when test=
"count($idxsections) > 0">
547 <td colspan=
"5" class=
"shortcuts">
548 <xsl:for-each select=
"./indexdiv/indexdiv">
549 <xsl:if test=
"position() > 1">
553 <xsl:attribute name=
"href">#idx
<xsl:value-of select=
"./title"/></xsl:attribute>
554 <xsl:value-of select=
"./title"/>
565 <xsl:template name=
"footer.navigation">
568 <!-- avoid creating multiple identical indices
569 if the stylesheets don't support filtered indices
571 <xsl:template match=
"index">
572 <xsl:variable name=
"has-filtered-index">
573 <xsl:call-template name=
"version-greater-or-equal">
574 <xsl:with-param name=
"ver1" select=
"$VERSION" />
575 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
578 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
583 <xsl:template match=
"index" mode=
"toc">
584 <xsl:variable name=
"has-filtered-index">
585 <xsl:call-template name=
"version-greater-or-equal">
586 <xsl:with-param name=
"ver1" select=
"$VERSION" />
587 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
590 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
595 <xsl:template match=
"para">
597 <xsl:when test=
"@role = 'gallery'">
598 <div class=
"container">
599 <div class=
"gallery-spacer"> </div>
600 <xsl:apply-templates mode=
"gallery.mode"/>
601 <div class=
"gallery-spacer"> </div>
609 <!-- FIXME: try if that works too -->
610 <!--xsl:template match="para[@role='gallery']">
611 <div class="container">
612 <div class="gallery-spacer"> </div>
613 <xsl:apply-templates mode="gallery.mode"/>
614 <div class="gallery-spacer"> </div>
620 <xsl:template match="link" mode="gallery.mode">
621 <div class="gallery-float">
622 <xsl:apply-templates select="."/>
626 <!-- add gallery handling to refnamediv template -->
627 <xsl:template match=
"refnamediv">
628 <div class=
"{name(.)}">
630 <tr><td valign=
"top">
631 <xsl:call-template name=
"anchor"/>
633 <xsl:when test=
"$refentry.generate.name != 0">
635 <xsl:call-template name=
"gentext">
636 <xsl:with-param name=
"key" select=
"'RefName'"/>
640 <xsl:when test=
"$refentry.generate.title != 0">
643 <xsl:when test=
"../refmeta/refentrytitle">
644 <xsl:apply-templates select=
"../refmeta/refentrytitle"/>
647 <xsl:apply-templates select=
"refname[1]"/>
654 <xsl:apply-templates/>
657 <td valign=
"top" align=
"right">
658 <!-- find the gallery image to use here
659 - determine the id of the enclosing refentry
660 - look for an inlinegraphic inside a link with linkend == refentryid inside a para with role == gallery
663 <xsl:variable name=
"refentryid" select=
"../@id"/>
664 <xsl:apply-templates select=
"//para[@role = 'gallery']/link[@linkend = $refentryid]/inlinegraphic"/>
670 <!-- add anchors for index sections -->
671 <xsl:template match=
"indexdiv">
672 <a><xsl:attribute name=
"name">idx
<xsl:value-of select=
"./title"/></xsl:attribute></a>
673 <xsl:apply-templates/>
676 <!-- add anchors for glossary sections -->
677 <xsl:template match=
"glossdiv">
678 <a><xsl:attribute name=
"name">gls
<xsl:value-of select=
"./title"/></xsl:attribute></a>
679 <xsl:apply-templates/>
682 <!-- Exterminate any trace of indexterms in the main flow -->
683 <xsl:template match=
"indexterm">
686 <!-- Extra link on the right side of doc-blobs -->
687 <xsl:template name=
"user.format.extralinks">
688 <xsl:if test=
"../ulink[@role='extralinks']">
689 <span class=
"extralinks">
690 <xsl:for-each select=
"../ulink[@role='extralinks']">
691 <xsl:if test=
"position() = 1">[
 </xsl:if>
692 <xsl:if test=
"position() > 1"> |
 </xsl:if>
694 <xsl:attribute name=
"href"><xsl:value-of select=
"@url"/></xsl:attribute>
695 <xsl:copy-of select=
"text()" />
697 <xsl:if test=
"position() = last()"> ]
</xsl:if>
701 <!--xsl:copy-of select="text()" /-->
702 <xsl:apply-templates/>
705 <!-- this is not in use yet (see gtkdoc-mkdb
706 <xsl:template match="//refsect2/ulink[@role='extralinks']"/>
707 <xsl:template match="//refsect1/ulink[@role='extralinks']"/>
709 <xsl:template match="//refsect2/title">
710 <h3><xsl:call-template name="user.format.extralinks"/></h3>
713 <xsl:template match="//refsect1/title">
714 <h2><xsl:call-template name="user.format.extralinks"/></h2>
718 <!-- ==================================================================== -->
720 <xsl:template match=
"acronym">
721 <xsl:call-template name=
"generate.acronym.link"/>
724 <xsl:template name=
"generate.acronym.link">
725 <xsl:param name=
"acronym">
726 <xsl:apply-templates/>
729 We use for-each to change context to the database document because key()
730 only locates elements in the same document as the context node!
733 <xsl:param name=
"value" >
734 <xsl:value-of select=
"//glossentry/glossterm[text()=$acronym]/../glossdef/para[1]" />
737 <xsl:when test=
"$value=''">
740 In gtk-doc.xsl: For acronym (
<xsl:value-of select=
"$acronym"/>) no value found!
743 <xsl:attribute name=
"href">
744 <xsl:text>http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=
</xsl:text>
745 <xsl:value-of select=
"$acronym"/>
747 <xsl:call-template name=
"inline.charseq"/>
753 <xsl:attribute name=
"title">
754 <xsl:value-of select=
"$value"/>
756 <xsl:call-template name=
"inline.charseq"/>