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 <!-- ========================================================= -->
50 <!-- template to create the index.sgml anchor index -->
52 <xsl:template match=
"book|article">
53 <xsl:variable name=
"tooldver">
54 <xsl:call-template name=
"version-greater-or-equal">
55 <xsl:with-param name=
"ver1" select=
"$VERSION" />
56 <xsl:with-param name=
"ver2">1.36</xsl:with-param>
59 <xsl:if test=
"$tooldver = 0">
60 <xsl:message terminate=
"yes">
61 FATAL-ERROR: You need the DocBook XSL Stylesheets version
1.36 or higher
62 to build the documentation.
63 Get a newer version at http://docbook.sourceforge.net/projects/xsl/
68 <!-- generate the index.sgml href index -->
69 <xsl:call-template name=
"generate.index"/>
70 <xsl:call-template name=
"generate.devhelp"/>
71 <xsl:call-template name=
"generate.devhelp2"/>
74 <xsl:template name=
"generate.index">
75 <xsl:call-template name=
"write.text.chunk">
76 <xsl:with-param name=
"filename" select=
"'index.sgml'"/>
77 <xsl:with-param name=
"content">
78 <xsl:apply-templates select=
"//releaseinfo/ulink"
79 mode=
"generate.index.mode"/>
80 <!-- check all anchor and refentry elements -->
81 <xsl:apply-templates select=
"//anchor|//refentry|//refsect1|//refsect2|//refsynopsisdiv|//varlistentry"
82 mode=
"generate.index.mode"/>
84 <xsl:with-param name=
"default.encoding" select=
"'UTF-8'"/>
85 <xsl:with-param name=
"chunker.output.indent" select=
"'no'"/>
89 <xsl:template match=
"*" mode=
"generate.index.mode">
90 <xsl:if test=
"not(@href) and count(@id) > 0">
91 <xsl:text><ANCHOR id=
"</xsl:text>
92 <xsl:value-of select=
"@id"/>
93 <xsl:text>" href=
"</xsl:text>
94 <xsl:if test=
"$gtkdoc.bookname">
95 <xsl:value-of select=
"$gtkdoc.bookname"/>
96 <xsl:text>/
</xsl:text>
98 <xsl:call-template name=
"href.target"/>
99 <xsl:text>"> </xsl:text>
103 <xsl:template match=
"//releaseinfo/ulink" mode=
"generate.index.mode">
104 <xsl:if test=
"@role='online-location'">
105 <xsl:text><ONLINE href=
"</xsl:text>
106 <xsl:value-of select=
"@url"/>
107 <xsl:text>"> </xsl:text>
111 <!-- ========================================================= -->
112 <!-- template to output gtkdoclink elements for the unknown targets -->
114 <xsl:template match=
"link">
116 <xsl:when test=
"id(@linkend)">
120 <GTKDOCLINK HREF=
"{@linkend}">
121 <xsl:apply-templates/>
127 <!-- ========================================================= -->
128 <!-- Below are the visual portions of the stylesheet. They provide
129 the normal gtk-doc output style. -->
131 <xsl:param name=
"shade.verbatim" select=
"0"/>
132 <xsl:param name=
"refentry.separator" select=
"0"/>
134 <xsl:template match=
"refsect2">
135 <xsl:if test=
"preceding-sibling::refsect2">
141 <xsl:template name=
"user.head.content">
142 <xsl:if test=
"$gtkdoc.version">
143 <meta name=
"generator" content=
"GTK-Doc V{$gtkdoc.version} (XML mode)"/>
145 <link rel=
"stylesheet" href=
"style.css" type=
"text/css"/>
147 <!-- copied from the html.head template in the docbook stylesheets
148 we don't want links for all refentrys, thats just too much
150 <xsl:variable name=
"this" select=
"."/>
151 <xsl:for-each select=
"//part
156 |//appendix[not(parent::article)]|appendix
157 |//glossary[not(parent::article)]|glossary
158 |//index[not(parent::article)]|index">
159 <link rel=
"{local-name(.)}">
160 <xsl:attribute name=
"href">
161 <xsl:call-template name=
"href.target">
162 <xsl:with-param name=
"context" select=
"$this"/>
163 <xsl:with-param name=
"object" select=
"."/>
166 <xsl:attribute name=
"title">
167 <xsl:apply-templates select=
"." mode=
"object.title.markup.textonly"/>
173 <xsl:template name=
"user.footer.content">
177 <xsl:when test=
"$gtkdoc.version">
178 Generated by GTK-Doc V
<xsl:copy-of select=
"$gtkdoc.version" />
187 <xsl:template match=
"title" mode=
"book.titlepage.recto.mode">
188 <table class=
"navigation" id=
"top" width=
"100%"
189 cellpadding=
"2" cellspacing=
"0">
192 <p class=
"{name(.)}">
193 <xsl:value-of select=
"."/>
200 <xsl:template name=
"header.navigation">
201 <xsl:param name=
"prev" select=
"/foo"/>
202 <xsl:param name=
"next" select=
"/foo"/>
203 <xsl:variable name=
"home" select=
"/*[1]"/>
204 <xsl:variable name=
"up" select=
"parent::*"/>
205 <xsl:variable name=
"refsections" select=
"./refsect1[@role]"/>
206 <xsl:variable name=
"glssections" select=
"./glossdiv/title"/>
207 <xsl:variable name=
"idxsections" select=
"./indexdiv/indexdiv/title"/>
208 <xsl:variable name=
"section_id" select=
"./@id"/>
209 <xsl:variable name=
"sect_object_hierarchy" select=
"./refsect1[@role='object_hierarchy']"/>
210 <xsl:variable name=
"sect_impl_interfaces" select=
"./refsect1[@role='impl_interfaces']"/>
211 <xsl:variable name=
"sect_prerequisites" select=
"./refsect1[@role='prerequisites']"/>
212 <xsl:variable name=
"sect_derived_interfaces" select=
"./refsect1[@role='derived_interfaces']"/>
213 <xsl:variable name=
"sect_implementations" select=
"./refsect1[@role='implementations']"/>
214 <xsl:variable name=
"sect_properties" select=
"./refsect1[@role='properties']"/>
215 <xsl:variable name=
"sect_child_properties" select=
"./refsect1[@role='child_properties']"/>
216 <xsl:variable name=
"sect_style_properties" select=
"./refsect1[@role='style_properties']"/>
217 <xsl:variable name=
"sect_signal_proto" select=
"./refsect1[@role='signal_proto']"/>
218 <xsl:variable name=
"sect_desc" select=
"./refsect1[@role='desc']"/>
219 <xsl:variable name=
"sect_synopsis" select=
"./refsynopsisdiv[@role='synopsis']"/>
221 <xsl:variable name="sect_details" select="./refsect1[@id='details']"/>
222 <xsl:variable name="sect_property_details" select="./refsect1[@id='property_details']"/>
223 <xsl:variable name="sect_child_property_details" select="./refsect1[@id='child_property_details']"/>
224 <xsl:variable name="sect_style_property_details" select="./refsect1[@id='style_property_details']"/>
225 <xsl:variable name="sect_signals" select="./refsect1[@id='signals']"/>
228 <xsl:if test=
"$suppress.navigation = '0' and $home != .">
229 <table class=
"navigation" id=
"top" width=
"100%"
230 summary =
"Navigation header" cellpadding=
"2" cellspacing=
"2">
233 <xsl:when test=
"count($prev) > 0">
236 <xsl:attribute name=
"href">
237 <xsl:call-template name=
"href.target">
238 <xsl:with-param name=
"object" select=
"$prev"/>
241 <img src=
"left.png" width=
"24" height=
"24" border=
"0">
242 <xsl:attribute name=
"alt">
243 <xsl:call-template name=
"gentext">
244 <xsl:with-param name=
"key">nav-prev
</xsl:with-param>
256 <xsl:when test=
"count($up) > 0 and $up != $home">
259 <xsl:attribute name=
"href">
260 <xsl:call-template name=
"href.target">
261 <xsl:with-param name=
"object" select=
"$up"/>
264 <img src=
"up.png" width=
"24" height=
"24" border=
"0">
265 <xsl:attribute name=
"alt">
266 <xsl:call-template name=
"gentext">
267 <xsl:with-param name=
"key">nav-up
</xsl:with-param>
279 <xsl:when test=
"$home != .">
282 <xsl:attribute name=
"href">
283 <xsl:call-template name=
"href.target">
284 <xsl:with-param name=
"object" select=
"$home"/>
287 <img src=
"home.png" width=
"24" height=
"24" border=
"0">
288 <xsl:attribute name=
"alt">
289 <xsl:call-template name=
"gentext">
290 <xsl:with-param name=
"key">nav-home
</xsl:with-param>
301 <th width=
"100%" align=
"center">
302 <xsl:apply-templates select=
"$home" mode=
"object.title.markup"/>
305 <xsl:when test=
"count($next) > 0">
308 <xsl:attribute name=
"href">
309 <xsl:call-template name=
"href.target">
310 <xsl:with-param name=
"object" select=
"$next"/>
313 <img src=
"right.png" width=
"24" height=
"24" border=
"0">
314 <xsl:attribute name=
"alt">
315 <xsl:call-template name=
"gentext">
316 <xsl:with-param name=
"key">nav-next
</xsl:with-param>
328 <!--<xsl:if test="name()='refentry'"-->
330 <xsl:when test=
"count($refsections) > 0">
332 <td colspan=
"5" class=
"shortcuts">
333 <xsl:if test=
"count($sect_synopsis) > 0">
334 <a href=
"#{$section_id}.synopsis" class=
"shortcut">Top
</a>
336 <xsl:if test=
"count($sect_desc) > 0">
338 <a href=
"#{$section_id}.description" class=
"shortcut">
339 <xsl:value-of select=
"./refsect1[@role='desc']/title"/>
342 <xsl:if test=
"count($sect_object_hierarchy) > 0">
344 <a href=
"#{$section_id}.object-hierarchy" class=
"shortcut">
345 <xsl:value-of select=
"./refsect1[@role='object_hierarchy']/title"/>
348 <xsl:if test=
"count($sect_impl_interfaces) > 0">
350 <a href=
"#{$section_id}.implemented-interfaces" class=
"shortcut">
351 <xsl:value-of select=
"./refsect1[@role='impl_interfaces']/title"/>
354 <xsl:if test=
"count($sect_prerequisites) > 0">
356 <a href=
"#{$section_id}.prerequisites" class=
"shortcut">
357 <xsl:value-of select=
"./refsect1[@role='prerequisites']/title"/>
360 <xsl:if test=
"count($sect_derived_interfaces) > 0">
362 <a href=
"#{$section_id}.derived-interfaces" class=
"shortcut">
363 <xsl:value-of select=
"./refsect1[@role='derived_interfaces']/title"/>
366 <xsl:if test=
"count($sect_implementations) > 0">
368 <a href=
"#{$section_id}.implementations" class=
"shortcut">
369 <xsl:value-of select=
"./refsect1[@role='implementations']/title"/>
372 <xsl:if test=
"count($sect_properties) > 0">
374 <a href=
"#{$section_id}.properties" class=
"shortcut">
375 <xsl:value-of select=
"./refsect1[@role='properties']/title"/>
378 <xsl:if test=
"count($sect_child_properties) > 0">
380 <a href=
"#{$section_id}.child-properties" class=
"shortcut">
381 <xsl:value-of select=
"./refsect1[@role='child_properties']/title"/>
384 <xsl:if test=
"count($sect_style_properties) > 0">
386 <a href=
"#{$section_id}.style-properties" class=
"shortcut">
387 <xsl:value-of select=
"./refsect1[@role='style_properties']/title"/>
390 <xsl:if test=
"count($sect_signal_proto) > 0">
392 <a href=
"#{$section_id}.signals" class=
"shortcut">
393 <xsl:value-of select=
"./refsect1[@role='signal_proto']/title"/>
397 <xsl:if test="count($sect_details) > 0">
398 <a href="#details" class="shortcut">
399 <xsl:value-of select="./refsect1[@id='details']/title"/>
403 <xsl:if test="count($sect_property_details) > 0">
404 <a href="#property_details" class="shortcut">
405 <xsl:value-of select="./refsect1[@id='property_details']/title"/>
409 <xsl:if test="count($sect_child_property_details) > 0">
410 <a href="#child_property_details" class="shortcut">
411 <xsl:value-of select="./refsect1[@id='property_child_details']/title"/>
415 <xsl:if test="count($sect_style_property_details) > 0">
416 <a href="#style_property_details" class="shortcut">
417 <xsl:value-of select="./refsect1[@id='style_property_details']/title"/>
421 <xsl:if test="count($sect_signals) > 0">
422 <a href="#signals" class="shortcut">
423 <xsl:value-of select="./refsect1[@id='signals']/title"/>
431 <!-- this is not yet very nice, as it requires all glossdic/indexdiv
432 elements having a anchor element. maybe we can customize the xsl
433 to automaticaly create local anchors
435 <xsl:when test=
"count($glssections) > 0">
437 <td colspan=
"5" class=
"shortcuts">
438 <xsl:for-each select=
"./glossdiv">
439 <xsl:if test=
"position() > 1">
443 <xsl:attribute name=
"href">#gls
<xsl:value-of select=
"./title"/></xsl:attribute>
444 <xsl:value-of select=
"./title"/>
450 <xsl:when test=
"count($idxsections) > 0">
452 <td colspan=
"5" class=
"shortcuts">
453 <xsl:for-each select=
"./indexdiv/indexdiv">
454 <xsl:if test=
"position() > 1">
458 <xsl:attribute name=
"href">#idx
<xsl:value-of select=
"./title"/></xsl:attribute>
459 <xsl:value-of select=
"./title"/>
470 <xsl:template name=
"footer.navigation">
473 <!-- avoid creating multiple identical indices
474 if the stylesheets don't support filtered indices
476 <xsl:template match=
"index">
477 <xsl:variable name=
"has-filtered-index">
478 <xsl:call-template name=
"version-greater-or-equal">
479 <xsl:with-param name=
"ver1" select=
"$VERSION" />
480 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
483 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
488 <xsl:template match=
"index" mode=
"toc">
489 <xsl:variable name=
"has-filtered-index">
490 <xsl:call-template name=
"version-greater-or-equal">
491 <xsl:with-param name=
"ver1" select=
"$VERSION" />
492 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
495 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
500 <xsl:template match=
"para">
502 <xsl:when test=
"@role = 'gallery'">
503 <div class=
"container">
504 <div class=
"gallery-spacer"> </div>
505 <xsl:apply-templates mode=
"gallery.mode"/>
506 <div class=
"gallery-spacer"> </div>
515 <xsl:template match=
"link" mode=
"gallery.mode">
516 <div class=
"gallery-float">
517 <xsl:apply-templates select=
"."/>
521 <!-- add gallery handling to refnamediv template -->
522 <xsl:template match=
"refnamediv">
523 <div class=
"{name(.)}">
525 <tr><td valign=
"top">
526 <xsl:call-template name=
"anchor"/>
528 <xsl:when test=
"$refentry.generate.name != 0">
530 <xsl:call-template name=
"gentext">
531 <xsl:with-param name=
"key" select=
"'RefName'"/>
535 <xsl:when test=
"$refentry.generate.title != 0">
538 <xsl:when test=
"../refmeta/refentrytitle">
539 <xsl:apply-templates select=
"../refmeta/refentrytitle"/>
542 <xsl:apply-templates select=
"refname[1]"/>
549 <xsl:apply-templates/>
552 <td valign=
"top" align=
"right">
553 <!-- find the gallery image to use here
554 - determine the id of the enclosing refentry
555 - look for an inlinegraphic inside a link with linkend == refentryid inside a para with role == gallery
558 <xsl:variable name=
"refentryid" select=
"../@id"/>
559 <xsl:apply-templates select=
"//para[@role = 'gallery']/link[@linkend = $refentryid]/inlinegraphic"/>
565 <!-- add anchors for index sections -->
566 <xsl:template match=
"indexdiv">
567 <a><xsl:attribute name=
"name">idx
<xsl:value-of select=
"./title"/></xsl:attribute></a>
568 <xsl:apply-templates/>
571 <!-- add anchors for glossary sections -->
572 <xsl:template match=
"glossdiv">
573 <a><xsl:attribute name=
"name">gls
<xsl:value-of select=
"./title"/></xsl:attribute></a>
574 <xsl:apply-templates/>
577 <!-- Exterminate any trace of indexterms in the main flow -->
578 <xsl:template match=
"indexterm">
581 <!-- Extra link on the right side of doc-blobs -->
582 <xsl:template name=
"user.format.extralinks">
583 <xsl:if test=
"../ulink[@role='extralinks']">
584 <span class=
"extralinks">
585 <xsl:for-each select=
"../ulink[@role='extralinks']">
586 <xsl:if test=
"position() = 1">[
 </xsl:if>
587 <xsl:if test=
"position() > 1"> |
 </xsl:if>
589 <xsl:attribute name=
"href"><xsl:value-of select=
"@url"/></xsl:attribute>
590 <xsl:copy-of select=
"text()" />
592 <xsl:if test=
"position() = last()"> ]
</xsl:if>
596 <!--xsl:copy-of select="text()" /-->
597 <xsl:apply-templates/>
600 <xsl:template match=
"//refsect2/ulink[@role='extralinks']"/>
601 <xsl:template match=
"//refsect1/ulink[@role='extralinks']"/>
603 <xsl:template match=
"//refsect2/title">
604 <h3><xsl:call-template name=
"user.format.extralinks"/></h3>
607 <xsl:template match=
"//refsect1/title">
608 <h2><xsl:call-template name=
"user.format.extralinks"/></h2>
611 <!-- ==================================================================== -->
613 <xsl:template match=
"acronym">
614 <xsl:call-template name=
"generate.acronym.link"/>
617 <xsl:template name=
"generate.acronym.link">
618 <xsl:param name=
"acronym">
619 <xsl:apply-templates/>
622 We use for-each to change context to the database document because key()
623 only locates elements in the same document as the context node!
626 <xsl:param name=
"value" >
627 <xsl:value-of select=
"//glossentry/glossterm[text()=$acronym]/../glossdef/para[1]" />
630 <xsl:when test=
"$value=''">
633 In gtk-doc.xsl: For acronym (
<xsl:value-of select=
"$acronym"/>) no value found!
636 <xsl:attribute name=
"href">
637 <xsl:text>http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=
</xsl:text>
638 <xsl:value-of select=
"$acronym"/>
640 <xsl:call-template name=
"inline.charseq"/>
646 <xsl:attribute name=
"title">
647 <xsl:value-of select=
"$value"/>
649 <xsl:call-template name=
"inline.charseq"/>