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">
23 <xsl:param name=
"chunker.output.encoding" select=
"'UTF-8'"/>
24 <xsl:param name=
"chunker.output.indent" select=
"'yes'"/>
25 <xsl:param name=
"chunker.output.doctype-public" select=
"'-//W3C//DTD HTML 4.01 Transitional//EN'"/>
26 <xsl:param name=
"chunk.fast" select=
"1"/>
28 <xsl:param name=
"default.encoding" select=
"'UTF-8'"/>
29 <xsl:param name=
"chapter.autolabel" select=
"0"/>
30 <xsl:param name=
"use.id.as.filename" select=
"1"/>
31 <xsl:param name=
"html.ext" select=
"'.html'"/>
32 <xsl:param name=
"refentry.generate.name" select=
"0"/>
33 <xsl:param name=
"refentry.generate.title" select=
"1"/>
35 <!-- use index filtering (if available) -->
36 <xsl:param name=
"index.on.role" select=
"1"/>
38 <!-- display variablelists as tables -->
39 <xsl:param name=
"variablelist.as.table" select=
"1"/>
41 <!-- new things to consider
42 <xsl:param name="glossterm.auto.link" select="0"></xsl:param>
45 <!-- this gets set on the command line ... -->
46 <xsl:param name=
"gtkdoc.version" select=
"''"/>
47 <xsl:param name=
"gtkdoc.bookname" select=
"''"/>
49 <!-- ========================================================= -->
51 <!-- l10n is slow, we don't ue it, so we'd like to turn it off
52 this atleast avoid the re-evaluation -->
53 <xsl:template name=
"l10n.language">en
</xsl:template>
55 <!-- ========================================================= -->
56 <!-- template to create the index.sgml anchor index -->
58 <xsl:template match=
"book|article">
59 <xsl:variable name=
"tooldver">
60 <xsl:call-template name=
"version-greater-or-equal">
61 <xsl:with-param name=
"ver1" select=
"$VERSION" />
62 <xsl:with-param name=
"ver2">1.36</xsl:with-param>
65 <xsl:if test=
"$tooldver = 0">
66 <xsl:message terminate=
"yes">
67 FATAL-ERROR: You need the DocBook XSL Stylesheets version
1.36 or higher
68 to build the documentation.
69 Get a newer version at http://docbook.sourceforge.net/projects/xsl/
74 <!-- generate the index.sgml href index -->
75 <xsl:call-template name=
"generate.index"/>
76 <xsl:call-template name=
"generate.devhelp"/>
77 <xsl:call-template name=
"generate.devhelp2"/>
80 <xsl:template name=
"generate.index">
81 <xsl:call-template name=
"write.text.chunk">
82 <xsl:with-param name=
"filename" select=
"'index.sgml'"/>
83 <xsl:with-param name=
"content">
84 <xsl:apply-templates select=
"/book/bookinforeleaseinfo/ulink"
85 mode=
"generate.index.mode"/>
86 <!-- check all anchor and refentry elements -->
87 <xsl:apply-templates select=
"//anchor|//refentry|//refsect1|//refsect2|//refsynopsisdiv|//varlistentry"
88 mode=
"generate.index.mode"/>
90 <xsl:with-param name=
"default.encoding" select=
"'UTF-8'"/>
91 <xsl:with-param name=
"chunker.output.indent" select=
"'no'"/>
95 <xsl:template match=
"*" mode=
"generate.index.mode">
96 <xsl:if test=
"not(@href) and count(@id) > 0">
97 <xsl:text><ANCHOR id=
"</xsl:text>
98 <xsl:value-of select=
"@id"/>
99 <xsl:text>" href=
"</xsl:text>
100 <xsl:if test=
"$gtkdoc.bookname">
101 <xsl:value-of select=
"$gtkdoc.bookname"/>
102 <xsl:text>/
</xsl:text>
104 <xsl:call-template name=
"href.target"/>
105 <xsl:text>"> </xsl:text>
109 <xsl:template match=
"/book/bookinfo/releaseinfo/ulink" mode=
"generate.index.mode">
110 <xsl:if test=
"@role='online-location'">
111 <xsl:text><ONLINE href=
"</xsl:text>
112 <xsl:value-of select=
"@url"/>
113 <xsl:text>"> </xsl:text>
117 <!-- ========================================================= -->
118 <!-- template to output gtkdoclink elements for the unknown targets -->
120 <xsl:template match=
"link">
122 <xsl:when test=
"id(@linkend)">
126 <GTKDOCLINK HREF=
"{@linkend}">
127 <xsl:apply-templates/>
133 <!-- ========================================================= -->
134 <!-- Below are the visual portions of the stylesheet. They provide
135 the normal gtk-doc output style. -->
137 <xsl:param name=
"shade.verbatim" select=
"0"/>
138 <xsl:param name=
"refentry.separator" select=
"0"/>
140 <xsl:template match=
"refsect2">
141 <xsl:if test=
"preceding-sibling::refsect2">
147 <xsl:template name=
"user.head.content">
148 <xsl:if test=
"$gtkdoc.version">
149 <meta name=
"generator" content=
"GTK-Doc V{$gtkdoc.version} (XML mode)"/>
151 <link rel=
"stylesheet" href=
"style.css" type=
"text/css"/>
153 <!-- copied from the html.head template in the docbook stylesheets
154 we don't want links for all refentrys, thats just too much
156 <xsl:variable name=
"this" select=
"."/>
157 <xsl:for-each select=
"//part
162 |//appendix[not(parent::article)]|appendix
163 |//glossary[not(parent::article)]|glossary
164 |//index[not(parent::article)]|index">
165 <link rel=
"{local-name(.)}">
166 <xsl:attribute name=
"href">
167 <xsl:call-template name=
"href.target">
168 <xsl:with-param name=
"context" select=
"$this"/>
169 <xsl:with-param name=
"object" select=
"."/>
172 <xsl:attribute name=
"title">
173 <xsl:apply-templates select=
"." mode=
"object.title.markup.textonly"/>
179 <xsl:template name=
"user.footer.content">
183 <xsl:when test=
"$gtkdoc.version">
184 Generated by GTK-Doc V
<xsl:copy-of select=
"$gtkdoc.version" />
193 <xsl:template match=
"title" mode=
"book.titlepage.recto.mode">
194 <table class=
"navigation" id=
"top" width=
"100%"
195 cellpadding=
"2" cellspacing=
"0">
198 <p class=
"{name(.)}">
199 <xsl:value-of select=
"."/>
206 <xsl:template name=
"header.navigation">
207 <xsl:param name=
"prev" select=
"/foo"/>
208 <xsl:param name=
"next" select=
"/foo"/>
209 <xsl:variable name=
"home" select=
"/*[1]"/>
210 <xsl:variable name=
"up" select=
"parent::*"/>
211 <xsl:variable name=
"refsections" select=
"./refsect1[@role]"/>
212 <xsl:variable name=
"glssections" select=
"./glossdiv/title"/>
213 <xsl:variable name=
"idxsections" select=
"./indexdiv/indexdiv/title"/>
214 <xsl:variable name=
"section_id" select=
"./@id"/>
215 <xsl:variable name=
"sect_object_hierarchy" select=
"./refsect1[@role='object_hierarchy']"/>
216 <xsl:variable name=
"sect_impl_interfaces" select=
"./refsect1[@role='impl_interfaces']"/>
217 <xsl:variable name=
"sect_prerequisites" select=
"./refsect1[@role='prerequisites']"/>
218 <xsl:variable name=
"sect_derived_interfaces" select=
"./refsect1[@role='derived_interfaces']"/>
219 <xsl:variable name=
"sect_implementations" select=
"./refsect1[@role='implementations']"/>
220 <xsl:variable name=
"sect_properties" select=
"./refsect1[@role='properties']"/>
221 <xsl:variable name=
"sect_child_properties" select=
"./refsect1[@role='child_properties']"/>
222 <xsl:variable name=
"sect_style_properties" select=
"./refsect1[@role='style_properties']"/>
223 <xsl:variable name=
"sect_signal_proto" select=
"./refsect1[@role='signal_proto']"/>
224 <xsl:variable name=
"sect_desc" select=
"./refsect1[@role='desc']"/>
225 <xsl:variable name=
"sect_synopsis" select=
"./refsynopsisdiv[@role='synopsis']"/>
227 <xsl:variable name="sect_details" select="./refsect1[@id='details']"/>
228 <xsl:variable name="sect_property_details" select="./refsect1[@id='property_details']"/>
229 <xsl:variable name="sect_child_property_details" select="./refsect1[@id='child_property_details']"/>
230 <xsl:variable name="sect_style_property_details" select="./refsect1[@id='style_property_details']"/>
231 <xsl:variable name="sect_signals" select="./refsect1[@id='signals']"/>
234 <xsl:if test=
"$suppress.navigation = '0' and $home != .">
235 <table class=
"navigation" id=
"top" width=
"100%"
236 summary =
"Navigation header" cellpadding=
"2" cellspacing=
"2">
239 <xsl:when test=
"count($prev) > 0">
242 <xsl:attribute name=
"href">
243 <xsl:call-template name=
"href.target">
244 <xsl:with-param name=
"object" select=
"$prev"/>
247 <img src=
"left.png" width=
"24" height=
"24" border=
"0">
248 <xsl:attribute name=
"alt">
249 <xsl:call-template name=
"gentext">
250 <xsl:with-param name=
"key">nav-prev
</xsl:with-param>
262 <xsl:when test=
"count($up) > 0 and $up != $home">
265 <xsl:attribute name=
"href">
266 <xsl:call-template name=
"href.target">
267 <xsl:with-param name=
"object" select=
"$up"/>
270 <img src=
"up.png" width=
"24" height=
"24" border=
"0">
271 <xsl:attribute name=
"alt">
272 <xsl:call-template name=
"gentext">
273 <xsl:with-param name=
"key">nav-up
</xsl:with-param>
285 <xsl:when test=
"$home != .">
288 <xsl:attribute name=
"href">
289 <xsl:call-template name=
"href.target">
290 <xsl:with-param name=
"object" select=
"$home"/>
293 <img src=
"home.png" width=
"24" height=
"24" border=
"0">
294 <xsl:attribute name=
"alt">
295 <xsl:call-template name=
"gentext">
296 <xsl:with-param name=
"key">nav-home
</xsl:with-param>
307 <th width=
"100%" align=
"center">
308 <xsl:apply-templates select=
"$home" mode=
"object.title.markup"/>
311 <xsl:when test=
"count($next) > 0">
314 <xsl:attribute name=
"href">
315 <xsl:call-template name=
"href.target">
316 <xsl:with-param name=
"object" select=
"$next"/>
319 <img src=
"right.png" width=
"24" height=
"24" border=
"0">
320 <xsl:attribute name=
"alt">
321 <xsl:call-template name=
"gentext">
322 <xsl:with-param name=
"key">nav-next
</xsl:with-param>
334 <!--<xsl:if test="name()='refentry'"-->
336 <xsl:when test=
"count($refsections) > 0">
338 <td colspan=
"5" class=
"shortcuts">
339 <xsl:if test=
"count($sect_synopsis) > 0">
340 <a href=
"#{$section_id}.synopsis" class=
"shortcut">Top
</a>
342 <xsl:if test=
"count($sect_desc) > 0">
344 <a href=
"#{$section_id}.description" class=
"shortcut">
345 <xsl:value-of select=
"./refsect1[@role='desc']/title"/>
348 <xsl:if test=
"count($sect_object_hierarchy) > 0">
350 <a href=
"#{$section_id}.object-hierarchy" class=
"shortcut">
351 <xsl:value-of select=
"./refsect1[@role='object_hierarchy']/title"/>
354 <xsl:if test=
"count($sect_impl_interfaces) > 0">
356 <a href=
"#{$section_id}.implemented-interfaces" class=
"shortcut">
357 <xsl:value-of select=
"./refsect1[@role='impl_interfaces']/title"/>
360 <xsl:if test=
"count($sect_prerequisites) > 0">
362 <a href=
"#{$section_id}.prerequisites" class=
"shortcut">
363 <xsl:value-of select=
"./refsect1[@role='prerequisites']/title"/>
366 <xsl:if test=
"count($sect_derived_interfaces) > 0">
368 <a href=
"#{$section_id}.derived-interfaces" class=
"shortcut">
369 <xsl:value-of select=
"./refsect1[@role='derived_interfaces']/title"/>
372 <xsl:if test=
"count($sect_implementations) > 0">
374 <a href=
"#{$section_id}.implementations" class=
"shortcut">
375 <xsl:value-of select=
"./refsect1[@role='implementations']/title"/>
378 <xsl:if test=
"count($sect_properties) > 0">
380 <a href=
"#{$section_id}.properties" class=
"shortcut">
381 <xsl:value-of select=
"./refsect1[@role='properties']/title"/>
384 <xsl:if test=
"count($sect_child_properties) > 0">
386 <a href=
"#{$section_id}.child-properties" class=
"shortcut">
387 <xsl:value-of select=
"./refsect1[@role='child_properties']/title"/>
390 <xsl:if test=
"count($sect_style_properties) > 0">
392 <a href=
"#{$section_id}.style-properties" class=
"shortcut">
393 <xsl:value-of select=
"./refsect1[@role='style_properties']/title"/>
396 <xsl:if test=
"count($sect_signal_proto) > 0">
398 <a href=
"#{$section_id}.signals" class=
"shortcut">
399 <xsl:value-of select=
"./refsect1[@role='signal_proto']/title"/>
403 <xsl:if test="count($sect_details) > 0">
404 <a href="#details" class="shortcut">
405 <xsl:value-of select="./refsect1[@id='details']/title"/>
409 <xsl:if test="count($sect_property_details) > 0">
410 <a href="#property_details" class="shortcut">
411 <xsl:value-of select="./refsect1[@id='property_details']/title"/>
415 <xsl:if test="count($sect_child_property_details) > 0">
416 <a href="#child_property_details" class="shortcut">
417 <xsl:value-of select="./refsect1[@id='property_child_details']/title"/>
421 <xsl:if test="count($sect_style_property_details) > 0">
422 <a href="#style_property_details" class="shortcut">
423 <xsl:value-of select="./refsect1[@id='style_property_details']/title"/>
427 <xsl:if test="count($sect_signals) > 0">
428 <a href="#signals" class="shortcut">
429 <xsl:value-of select="./refsect1[@id='signals']/title"/>
437 <!-- this is not yet very nice, as it requires all glossdic/indexdiv
438 elements having a anchor element. maybe we can customize the xsl
439 to automaticaly create local anchors
441 <xsl:when test=
"count($glssections) > 0">
443 <td colspan=
"5" class=
"shortcuts">
444 <xsl:for-each select=
"./glossdiv">
445 <xsl:if test=
"position() > 1">
449 <xsl:attribute name=
"href">#gls
<xsl:value-of select=
"./title"/></xsl:attribute>
450 <xsl:value-of select=
"./title"/>
456 <xsl:when test=
"count($idxsections) > 0">
458 <td colspan=
"5" class=
"shortcuts">
459 <xsl:for-each select=
"./indexdiv/indexdiv">
460 <xsl:if test=
"position() > 1">
464 <xsl:attribute name=
"href">#idx
<xsl:value-of select=
"./title"/></xsl:attribute>
465 <xsl:value-of select=
"./title"/>
476 <xsl:template name=
"footer.navigation">
479 <!-- avoid creating multiple identical indices
480 if the stylesheets don't support filtered indices
482 <xsl:template match=
"index">
483 <xsl:variable name=
"has-filtered-index">
484 <xsl:call-template name=
"version-greater-or-equal">
485 <xsl:with-param name=
"ver1" select=
"$VERSION" />
486 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
489 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
494 <xsl:template match=
"index" mode=
"toc">
495 <xsl:variable name=
"has-filtered-index">
496 <xsl:call-template name=
"version-greater-or-equal">
497 <xsl:with-param name=
"ver1" select=
"$VERSION" />
498 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
501 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
506 <xsl:template match=
"para">
508 <xsl:when test=
"@role = 'gallery'">
509 <div class=
"container">
510 <div class=
"gallery-spacer"> </div>
511 <xsl:apply-templates mode=
"gallery.mode"/>
512 <div class=
"gallery-spacer"> </div>
520 <!-- FIXME: try if that works too -->
521 <!--xsl:template match="para[@role='gallery']">
522 <div class="container">
523 <div class="gallery-spacer"> </div>
524 <xsl:apply-templates mode="gallery.mode"/>
525 <div class="gallery-spacer"> </div>
531 <xsl:template match="link" mode="gallery.mode">
532 <div class="gallery-float">
533 <xsl:apply-templates select="."/>
537 <!-- add gallery handling to refnamediv template -->
538 <xsl:template match=
"refnamediv">
539 <div class=
"{name(.)}">
541 <tr><td valign=
"top">
542 <xsl:call-template name=
"anchor"/>
544 <xsl:when test=
"$refentry.generate.name != 0">
546 <xsl:call-template name=
"gentext">
547 <xsl:with-param name=
"key" select=
"'RefName'"/>
551 <xsl:when test=
"$refentry.generate.title != 0">
554 <xsl:when test=
"../refmeta/refentrytitle">
555 <xsl:apply-templates select=
"../refmeta/refentrytitle"/>
558 <xsl:apply-templates select=
"refname[1]"/>
565 <xsl:apply-templates/>
568 <td valign=
"top" align=
"right">
569 <!-- find the gallery image to use here
570 - determine the id of the enclosing refentry
571 - look for an inlinegraphic inside a link with linkend == refentryid inside a para with role == gallery
574 <xsl:variable name=
"refentryid" select=
"../@id"/>
575 <xsl:apply-templates select=
"//para[@role = 'gallery']/link[@linkend = $refentryid]/inlinegraphic"/>
581 <!-- add anchors for index sections -->
582 <xsl:template match=
"indexdiv">
583 <a><xsl:attribute name=
"name">idx
<xsl:value-of select=
"./title"/></xsl:attribute></a>
584 <xsl:apply-templates/>
587 <!-- add anchors for glossary sections -->
588 <xsl:template match=
"glossdiv">
589 <a><xsl:attribute name=
"name">gls
<xsl:value-of select=
"./title"/></xsl:attribute></a>
590 <xsl:apply-templates/>
593 <!-- Exterminate any trace of indexterms in the main flow -->
594 <xsl:template match=
"indexterm">
597 <!-- Extra link on the right side of doc-blobs -->
598 <xsl:template name=
"user.format.extralinks">
599 <xsl:if test=
"../ulink[@role='extralinks']">
600 <span class=
"extralinks">
601 <xsl:for-each select=
"../ulink[@role='extralinks']">
602 <xsl:if test=
"position() = 1">[
 </xsl:if>
603 <xsl:if test=
"position() > 1"> |
 </xsl:if>
605 <xsl:attribute name=
"href"><xsl:value-of select=
"@url"/></xsl:attribute>
606 <xsl:copy-of select=
"text()" />
608 <xsl:if test=
"position() = last()"> ]
</xsl:if>
612 <!--xsl:copy-of select="text()" /-->
613 <xsl:apply-templates/>
616 <!-- this is not in use yet (see gtkdoc-mkdb
617 <xsl:template match="//refsect2/ulink[@role='extralinks']"/>
618 <xsl:template match="//refsect1/ulink[@role='extralinks']"/>
620 <xsl:template match="//refsect2/title">
621 <h3><xsl:call-template name="user.format.extralinks"/></h3>
624 <xsl:template match="//refsect1/title">
625 <h2><xsl:call-template name="user.format.extralinks"/></h2>
629 <!-- ==================================================================== -->
631 <xsl:template match=
"acronym">
632 <xsl:call-template name=
"generate.acronym.link"/>
635 <xsl:template name=
"generate.acronym.link">
636 <xsl:param name=
"acronym">
637 <xsl:apply-templates/>
640 We use for-each to change context to the database document because key()
641 only locates elements in the same document as the context node!
644 <xsl:param name=
"value" >
645 <xsl:value-of select=
"//glossentry/glossterm[text()=$acronym]/../glossdef/para[1]" />
648 <xsl:when test=
"$value=''">
651 In gtk-doc.xsl: For acronym (
<xsl:value-of select=
"$acronym"/>) no value found!
654 <xsl:attribute name=
"href">
655 <xsl:text>http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=
</xsl:text>
656 <xsl:value-of select=
"$acronym"/>
658 <xsl:call-template name=
"inline.charseq"/>
664 <xsl:attribute name=
"title">
665 <xsl:value-of select=
"$value"/>
667 <xsl:call-template name=
"inline.charseq"/>