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"/>
36 <!-- don't generate all those link tags (very slow and hardly used)
37 it does not show much effect as we have a user.head.content template
38 <xsl:param name="html.extra.head.links" select="0" />
41 <!-- use index filtering (if available) -->
42 <xsl:param name=
"index.on.role" select=
"1"/>
44 <!-- display variablelists as tables -->
45 <xsl:param name=
"variablelist.as.table" select=
"1"/>
47 <!-- new things to consider
48 <xsl:param name="glossterm.auto.link" select="0"></xsl:param>
51 <!-- this gets set on the command line ... -->
52 <xsl:param name=
"gtkdoc.version" select=
"''"/>
53 <xsl:param name=
"gtkdoc.bookname" select=
"''"/>
55 <!-- ========================================================= -->
57 <!-- l10n is slow, we don't ue it, so we'd like to turn it off
58 this atleast avoid the re-evaluation -->
59 <xsl:template name=
"l10n.language">en
</xsl:template>
61 <xsl:param name=
"gtkdoc.l10n.xml" select=
"document('http://docbook.sourceforge.net/release/xsl/current/common/en.xml')"/>
63 <xsl:template name=
"gentext">
64 <xsl:param name=
"key" select=
"local-name(.)"/>
66 <xsl:variable name=
"l10n.gentext"
67 select=
"($gtkdoc.l10n.xml/l:l10n/l:gentext[@key=$key])[1]"/>
70 <xsl:when test=
"$l10n.gentext">
71 <xsl:value-of select=
"$l10n.gentext/@text"/>
75 <xsl:text>No
"en" localization of
"</xsl:text>
76 <xsl:value-of select="$key
"/>
77 <xsl:text>" exists.
</xsl:text>
83 <xsl:template name=
"gentext.dingbat">
84 <xsl:param name=
"dingbat">bullet
</xsl:param>
86 <xsl:variable name=
"l10n.dingbat"
87 select=
"($gtkdoc.l10n.xml/l:l10n/l:dingbat[@key=$dingbat])[1]"/>
90 <xsl:when test=
"$l10n.dingbat">
91 <xsl:value-of select=
"$l10n.dingbat/@text"/>
95 <xsl:text>No
"en" localization of dingbat
</xsl:text>
96 <xsl:value-of select=
"$dingbat"/>
97 <xsl:text> exists; using
"en".
</xsl:text>
104 <xsl:template name=
"gentext.template">
105 <xsl:param name=
"context" select=
"'default'"/>
106 <xsl:param name=
"name" select=
"'default'"/>
107 <xsl:param name=
"origname" select=
"$name"/>
108 <xsl:param name=
"verbose" select=
"1"/>
110 <!-- this is called with context="title|title-numbered|title-unnumbered
112 <xsl:text>context:</xsl:text><xsl:value-of select="$context"/>
116 <xsl:variable name=
"context.node"
117 select=
"$gtkdoc.l10n.xml/l:l10n/l:context[@name=$context]"/>
119 <xsl:variable name=
"template.node"
120 select=
"($context.node/l:template[@name=$name])[1]"/>
123 <xsl:when test=
"$template.node/@text">
124 <xsl:value-of select=
"$template.node/@text"/>
128 <xsl:when test=
"contains($name, '/')">
129 <xsl:call-template name=
"gentext.template">
130 <xsl:with-param name=
"context" select=
"$context"/>
131 <xsl:with-param name=
"name" select=
"substring-after($name, '/')"/>
132 <xsl:with-param name=
"origname" select=
"$origname"/>
133 <xsl:with-param name=
"verbose" select=
"$verbose"/>
136 <xsl:when test=
"$verbose = 0">
143 <!-- ========================================================= -->
144 <!-- template to create the index.sgml anchor index -->
146 <xsl:param name=
"gtkdoc.refsect2" select=
"//refsect2" />
148 <xsl:template match=
"book|article">
149 <xsl:variable name=
"tooldver">
150 <xsl:call-template name=
"version-greater-or-equal">
151 <xsl:with-param name=
"ver1" select=
"$VERSION" />
152 <xsl:with-param name=
"ver2">1.36</xsl:with-param>
155 <xsl:if test=
"$tooldver = 0">
156 <xsl:message terminate=
"yes">
157 FATAL-ERROR: You need the DocBook XSL Stylesheets version
1.36 or higher
158 to build the documentation.
159 Get a newer version at http://docbook.sourceforge.net/projects/xsl/
164 <!-- generate the index.sgml href index -->
165 <xsl:call-template name=
"generate.index"/>
166 <!-- generate $book.devhelp{2} -->
167 <xsl:call-template name=
"generate.devhelp"/>
168 <xsl:call-template name=
"generate.devhelp2"/>
171 <xsl:template name=
"generate.index">
172 <xsl:call-template name=
"write.text.chunk">
173 <xsl:with-param name=
"filename" select=
"'index.sgml'"/>
174 <xsl:with-param name=
"content">
175 <xsl:apply-templates select=
"/book/bookinforeleaseinfo/ulink"
176 mode=
"generate.index.mode"/>
177 <!-- check all anchor and refentry elements -->
178 <xsl:apply-templates select=
"//anchor|//refentry|//refsect1|$gtkdoc.refsect2|//refsynopsisdiv|//varlistentry"
179 mode=
"generate.index.mode"/>
181 <xsl:with-param name=
"default.encoding" select=
"'UTF-8'"/>
182 <xsl:with-param name=
"chunker.output.indent" select=
"'no'"/>
186 <xsl:template match=
"*" mode=
"generate.index.mode">
187 <xsl:if test=
"not(@href) and count(@id) > 0">
188 <xsl:text><ANCHOR id=
"</xsl:text>
189 <xsl:value-of select=
"@id"/>
190 <xsl:text>" href=
"</xsl:text>
191 <xsl:if test=
"$gtkdoc.bookname">
192 <xsl:value-of select=
"$gtkdoc.bookname"/>
193 <xsl:text>/
</xsl:text>
195 <xsl:call-template name=
"href.target"/>
196 <xsl:text>"> </xsl:text>
200 <xsl:template match=
"/book/bookinfo/releaseinfo/ulink" mode=
"generate.index.mode">
201 <xsl:if test=
"@role='online-location'">
202 <xsl:text><ONLINE href=
"</xsl:text>
203 <xsl:value-of select=
"@url"/>
204 <xsl:text>"> </xsl:text>
208 <!-- ========================================================= -->
209 <!-- template to output gtkdoclink elements for the unknown targets -->
211 <xsl:template match=
"link">
213 <xsl:when test=
"id(@linkend)">
217 <GTKDOCLINK HREF=
"{@linkend}">
218 <xsl:apply-templates/>
224 <!-- ========================================================= -->
225 <!-- Below are the visual portions of the stylesheet. They provide
226 the normal gtk-doc output style. -->
228 <xsl:param name=
"shade.verbatim" select=
"0"/>
229 <xsl:param name=
"refentry.separator" select=
"0"/>
231 <xsl:template match=
"refsect2">
232 <xsl:if test=
"preceding-sibling::refsect2">
238 <xsl:template name=
"user.head.content">
239 <xsl:if test=
"$gtkdoc.version">
240 <meta name=
"generator" content=
"GTK-Doc V{$gtkdoc.version} (XML mode)"/>
242 <link rel=
"stylesheet" href=
"style.css" type=
"text/css"/>
245 <xsl:template name=
"user.footer.content">
249 <xsl:when test=
"$gtkdoc.version">
250 Generated by GTK-Doc V
<xsl:copy-of select=
"$gtkdoc.version" />
259 <xsl:template match=
"title" mode=
"book.titlepage.recto.mode">
260 <table class=
"navigation" id=
"top" width=
"100%"
261 cellpadding=
"2" cellspacing=
"0">
264 <p class=
"{name(.)}">
265 <xsl:value-of select=
"."/>
272 <xsl:template name=
"header.navigation">
273 <xsl:param name=
"prev" select=
"/foo"/>
274 <xsl:param name=
"next" select=
"/foo"/>
275 <xsl:variable name=
"home" select=
"/*[1]"/>
276 <xsl:variable name=
"up" select=
"parent::*"/>
277 <xsl:variable name=
"refsections" select=
"./refsect1[@role]"/>
278 <xsl:variable name=
"glssections" select=
"./glossdiv/title"/>
279 <xsl:variable name=
"idxsections" select=
"./indexdiv/indexdiv/title"/>
280 <xsl:variable name=
"section_id" select=
"./@id"/>
281 <xsl:variable name=
"sect_object_hierarchy" select=
"./refsect1[@role='object_hierarchy']"/>
282 <xsl:variable name=
"sect_impl_interfaces" select=
"./refsect1[@role='impl_interfaces']"/>
283 <xsl:variable name=
"sect_prerequisites" select=
"./refsect1[@role='prerequisites']"/>
284 <xsl:variable name=
"sect_derived_interfaces" select=
"./refsect1[@role='derived_interfaces']"/>
285 <xsl:variable name=
"sect_implementations" select=
"./refsect1[@role='implementations']"/>
286 <xsl:variable name=
"sect_properties" select=
"./refsect1[@role='properties']"/>
287 <xsl:variable name=
"sect_child_properties" select=
"./refsect1[@role='child_properties']"/>
288 <xsl:variable name=
"sect_style_properties" select=
"./refsect1[@role='style_properties']"/>
289 <xsl:variable name=
"sect_signal_proto" select=
"./refsect1[@role='signal_proto']"/>
290 <xsl:variable name=
"sect_desc" select=
"./refsect1[@role='desc']"/>
291 <xsl:variable name=
"sect_synopsis" select=
"./refsynopsisdiv[@role='synopsis']"/>
293 <xsl:variable name="sect_details" select="./refsect1[@id='details']"/>
294 <xsl:variable name="sect_property_details" select="./refsect1[@id='property_details']"/>
295 <xsl:variable name="sect_child_property_details" select="./refsect1[@id='child_property_details']"/>
296 <xsl:variable name="sect_style_property_details" select="./refsect1[@id='style_property_details']"/>
297 <xsl:variable name="sect_signals" select="./refsect1[@id='signals']"/>
300 <xsl:if test=
"$suppress.navigation = '0' and $home != .">
301 <table class=
"navigation" id=
"top" width=
"100%"
302 summary =
"Navigation header" cellpadding=
"2" cellspacing=
"2">
305 <xsl:when test=
"count($prev) > 0">
308 <xsl:attribute name=
"href">
309 <xsl:call-template name=
"href.target">
310 <xsl:with-param name=
"object" select=
"$prev"/>
313 <img src=
"left.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-prev
</xsl:with-param>
328 <xsl:when test=
"count($up) > 0 and $up != $home">
331 <xsl:attribute name=
"href">
332 <xsl:call-template name=
"href.target">
333 <xsl:with-param name=
"object" select=
"$up"/>
336 <img src=
"up.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-up
</xsl:with-param>
351 <xsl:when test=
"$home != .">
354 <xsl:attribute name=
"href">
355 <xsl:call-template name=
"href.target">
356 <xsl:with-param name=
"object" select=
"$home"/>
359 <img src=
"home.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-home
</xsl:with-param>
373 <th width=
"100%" align=
"center">
374 <xsl:apply-templates select=
"$home" mode=
"object.title.markup"/>
377 <xsl:when test=
"count($next) > 0">
380 <xsl:attribute name=
"href">
381 <xsl:call-template name=
"href.target">
382 <xsl:with-param name=
"object" select=
"$next"/>
385 <img src=
"right.png" width=
"24" height=
"24" border=
"0">
386 <xsl:attribute name=
"alt">
387 <xsl:call-template name=
"gentext">
388 <xsl:with-param name=
"key">nav-next
</xsl:with-param>
400 <!--<xsl:if test="name()='refentry'"-->
402 <xsl:when test=
"count($refsections) > 0">
404 <td colspan=
"5" class=
"shortcuts">
405 <xsl:if test=
"count($sect_synopsis) > 0">
406 <a href=
"#{$section_id}.synopsis" class=
"shortcut">Top
</a>
408 <xsl:if test=
"count($sect_desc) > 0">
410 <a href=
"#{$section_id}.description" class=
"shortcut">
411 <xsl:value-of select=
"./refsect1[@role='desc']/title"/>
414 <xsl:if test=
"count($sect_object_hierarchy) > 0">
416 <a href=
"#{$section_id}.object-hierarchy" class=
"shortcut">
417 <xsl:value-of select=
"./refsect1[@role='object_hierarchy']/title"/>
420 <xsl:if test=
"count($sect_impl_interfaces) > 0">
422 <a href=
"#{$section_id}.implemented-interfaces" class=
"shortcut">
423 <xsl:value-of select=
"./refsect1[@role='impl_interfaces']/title"/>
426 <xsl:if test=
"count($sect_prerequisites) > 0">
428 <a href=
"#{$section_id}.prerequisites" class=
"shortcut">
429 <xsl:value-of select=
"./refsect1[@role='prerequisites']/title"/>
432 <xsl:if test=
"count($sect_derived_interfaces) > 0">
434 <a href=
"#{$section_id}.derived-interfaces" class=
"shortcut">
435 <xsl:value-of select=
"./refsect1[@role='derived_interfaces']/title"/>
438 <xsl:if test=
"count($sect_implementations) > 0">
440 <a href=
"#{$section_id}.implementations" class=
"shortcut">
441 <xsl:value-of select=
"./refsect1[@role='implementations']/title"/>
444 <xsl:if test=
"count($sect_properties) > 0">
446 <a href=
"#{$section_id}.properties" class=
"shortcut">
447 <xsl:value-of select=
"./refsect1[@role='properties']/title"/>
450 <xsl:if test=
"count($sect_child_properties) > 0">
452 <a href=
"#{$section_id}.child-properties" class=
"shortcut">
453 <xsl:value-of select=
"./refsect1[@role='child_properties']/title"/>
456 <xsl:if test=
"count($sect_style_properties) > 0">
458 <a href=
"#{$section_id}.style-properties" class=
"shortcut">
459 <xsl:value-of select=
"./refsect1[@role='style_properties']/title"/>
462 <xsl:if test=
"count($sect_signal_proto) > 0">
464 <a href=
"#{$section_id}.signals" class=
"shortcut">
465 <xsl:value-of select=
"./refsect1[@role='signal_proto']/title"/>
469 <xsl:if test="count($sect_details) > 0">
470 <a href="#details" class="shortcut">
471 <xsl:value-of select="./refsect1[@id='details']/title"/>
475 <xsl:if test="count($sect_property_details) > 0">
476 <a href="#property_details" class="shortcut">
477 <xsl:value-of select="./refsect1[@id='property_details']/title"/>
481 <xsl:if test="count($sect_child_property_details) > 0">
482 <a href="#child_property_details" class="shortcut">
483 <xsl:value-of select="./refsect1[@id='property_child_details']/title"/>
487 <xsl:if test="count($sect_style_property_details) > 0">
488 <a href="#style_property_details" class="shortcut">
489 <xsl:value-of select="./refsect1[@id='style_property_details']/title"/>
493 <xsl:if test="count($sect_signals) > 0">
494 <a href="#signals" class="shortcut">
495 <xsl:value-of select="./refsect1[@id='signals']/title"/>
503 <!-- this is not yet very nice, as it requires all glossdic/indexdiv
504 elements having a anchor element. maybe we can customize the xsl
505 to automaticaly create local anchors
507 <xsl:when test=
"count($glssections) > 0">
509 <td colspan=
"5" class=
"shortcuts">
510 <xsl:for-each select=
"./glossdiv">
511 <xsl:if test=
"position() > 1">
515 <xsl:attribute name=
"href">#gls
<xsl:value-of select=
"./title"/></xsl:attribute>
516 <xsl:value-of select=
"./title"/>
522 <xsl:when test=
"count($idxsections) > 0">
524 <td colspan=
"5" class=
"shortcuts">
525 <xsl:for-each select=
"./indexdiv/indexdiv">
526 <xsl:if test=
"position() > 1">
530 <xsl:attribute name=
"href">#idx
<xsl:value-of select=
"./title"/></xsl:attribute>
531 <xsl:value-of select=
"./title"/>
542 <xsl:template name=
"footer.navigation">
545 <!-- avoid creating multiple identical indices
546 if the stylesheets don't support filtered indices
548 <xsl:template match=
"index">
549 <xsl:variable name=
"has-filtered-index">
550 <xsl:call-template name=
"version-greater-or-equal">
551 <xsl:with-param name=
"ver1" select=
"$VERSION" />
552 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
555 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
560 <xsl:template match=
"index" mode=
"toc">
561 <xsl:variable name=
"has-filtered-index">
562 <xsl:call-template name=
"version-greater-or-equal">
563 <xsl:with-param name=
"ver1" select=
"$VERSION" />
564 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
567 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
572 <xsl:template match=
"para">
574 <xsl:when test=
"@role = 'gallery'">
575 <div class=
"container">
576 <div class=
"gallery-spacer"> </div>
577 <xsl:apply-templates mode=
"gallery.mode"/>
578 <div class=
"gallery-spacer"> </div>
586 <!-- FIXME: try if that works too -->
587 <!--xsl:template match="para[@role='gallery']">
588 <div class="container">
589 <div class="gallery-spacer"> </div>
590 <xsl:apply-templates mode="gallery.mode"/>
591 <div class="gallery-spacer"> </div>
597 <xsl:template match="link" mode="gallery.mode">
598 <div class="gallery-float">
599 <xsl:apply-templates select="."/>
603 <!-- add gallery handling to refnamediv template -->
604 <xsl:template match=
"refnamediv">
605 <div class=
"{name(.)}">
607 <tr><td valign=
"top">
608 <xsl:call-template name=
"anchor"/>
610 <xsl:when test=
"$refentry.generate.name != 0">
612 <xsl:call-template name=
"gentext">
613 <xsl:with-param name=
"key" select=
"'RefName'"/>
617 <xsl:when test=
"$refentry.generate.title != 0">
620 <xsl:when test=
"../refmeta/refentrytitle">
621 <xsl:apply-templates select=
"../refmeta/refentrytitle"/>
624 <xsl:apply-templates select=
"refname[1]"/>
631 <xsl:apply-templates/>
634 <td valign=
"top" align=
"right">
636 <xsl:when test=
"../refmeta/refmiscinfo/inlinegraphic">
637 <xsl:apply-templates select=
"../refmeta/refmiscinfo/inlinegraphic"/>
640 <!-- find the gallery image to use here
641 - determine the id of the enclosing refentry
642 - look for an inlinegraphic inside a link with linkend == refentryid inside a para with role == gallery
645 <xsl:variable name=
"refentryid" select=
"../@id"/>
646 <xsl:apply-templates select=
"//para[@role = 'gallery']/link[@linkend = $refentryid]/inlinegraphic"/>
654 <!-- add anchors for index sections -->
655 <xsl:template match=
"indexdiv">
656 <a><xsl:attribute name=
"name">idx
<xsl:value-of select=
"./title"/></xsl:attribute></a>
657 <xsl:apply-templates/>
660 <!-- add anchors for glossary sections -->
661 <xsl:template match=
"glossdiv">
662 <a><xsl:attribute name=
"name">gls
<xsl:value-of select=
"./title"/></xsl:attribute></a>
663 <xsl:apply-templates/>
666 <!-- Exterminate any trace of indexterms in the main flow -->
667 <xsl:template match=
"indexterm">
670 <!-- Extra link on the right side of doc-blobs -->
671 <xsl:template name=
"user.format.extralinks">
672 <xsl:if test=
"../ulink[@role='extralinks']">
673 <span class=
"extralinks">
674 <xsl:for-each select=
"../ulink[@role='extralinks']">
675 <xsl:if test=
"position() = 1">[
 </xsl:if>
676 <xsl:if test=
"position() > 1"> |
 </xsl:if>
678 <xsl:attribute name=
"href"><xsl:value-of select=
"@url"/></xsl:attribute>
679 <xsl:copy-of select=
"text()" />
681 <xsl:if test=
"position() = last()"> ]
</xsl:if>
685 <!--xsl:copy-of select="text()" /-->
686 <xsl:apply-templates/>
689 <!-- this is not in use yet (see gtkdoc-mkdb
690 <xsl:template match="//refsect2/ulink[@role='extralinks']"/>
691 <xsl:template match="//refsect1/ulink[@role='extralinks']"/>
693 <xsl:template match="//refsect2/title">
694 <h3><xsl:call-template name="user.format.extralinks"/></h3>
697 <xsl:template match="//refsect1/title">
698 <h2><xsl:call-template name="user.format.extralinks"/></h2>
702 <!-- ==================================================================== -->
704 <xsl:template match=
"acronym">
705 <xsl:call-template name=
"generate.acronym.link"/>
708 <xsl:template name=
"generate.acronym.link">
709 <xsl:param name=
"acronym">
710 <xsl:apply-templates/>
713 We use for-each to change context to the database document because key()
714 only locates elements in the same document as the context node!
717 <xsl:param name=
"value" >
718 <xsl:value-of select=
"//glossentry/glossterm[text()=$acronym]/../glossdef/para[1]" />
721 <xsl:when test=
"$value=''">
724 In gtk-doc.xsl: For acronym (
<xsl:value-of select=
"$acronym"/>) no value found!
727 <xsl:attribute name=
"href">
728 <xsl:text>http://foldoc.org/
</xsl:text>
729 <xsl:value-of select=
"$acronym"/>
731 <xsl:call-template name=
"inline.charseq"/>
737 <xsl:attribute name=
"title">
738 <xsl:value-of select=
"$value"/>
740 <xsl:call-template name=
"inline.charseq"/>