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 <!-- http://www.sagehill.net/docbookxsl/Chunking.html says we should use
9 "chunkfast.xsl", but I can see a difference -->
10 <xsl:import href=
"http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/>
11 <xsl:include href=
"devhelp2.xsl"/>
12 <xsl:include href=
"version-greater-or-equal.xsl"/>
14 <xsl:key name=
"acronym.key"
15 match=
"glossentry/glossterm"
17 <xsl:key name=
"gallery.key"
18 match=
"para[@role='gallery']/link"
21 <!-- change some parameters -->
22 <!-- http://docbook.sourceforge.net/release/xsl/current/doc/html/index.html -->
23 <xsl:param name=
"admon.style"/>
24 <xsl:param name=
"toc.section.depth">2</xsl:param>
25 <xsl:param name=
"generate.toc">
34 <xsl:param name=
"chunker.output.encoding" select=
"'UTF-8'"/>
35 <xsl:param name=
"chunker.output.indent" select=
"'yes'"/>
36 <xsl:param name=
"chunker.output.doctype-public" select=
"'-//W3C//DTD HTML 4.01 Transitional//EN'"/>
37 <xsl:param name=
"chunk.fast" select=
"1"/>
39 <xsl:param name=
"default.encoding" select=
"'UTF-8'"/>
40 <xsl:param name=
"chapter.autolabel" select=
"0"/>
41 <xsl:param name=
"use.id.as.filename" select=
"1"/>
42 <xsl:param name=
"generate.consistent.ids" select=
"1"/>
43 <xsl:param name=
"html.ext" select=
"'.html'"/>
44 <xsl:param name=
"refentry.generate.name" select=
"0"/>
45 <xsl:param name=
"refentry.generate.title" select=
"1"/>
46 <!-- don't generate all those link tags (very slow and hardly used)
47 it does not show much effect as we have a user.head.content template
48 <xsl:param name="html.extra.head.links" select="0" />
51 <!-- use index filtering (if available) -->
52 <xsl:param name=
"index.on.role" select=
"1"/>
54 <!-- display variablelists as tables -->
55 <xsl:param name=
"variablelist.as.table" select=
"1"/>
57 <!-- new things to consider
58 <xsl:param name="glossterm.auto.link" select="0"></xsl:param>
61 <!-- this gets set on the command line ... -->
62 <xsl:param name=
"gtkdoc.version" select=
"''"/>
63 <xsl:param name=
"gtkdoc.bookname" select=
"''"/>
65 <!-- ========================================================= -->
67 <!-- l10n is slow, we don't ue it, so we'd like to turn it off
68 this atleast avoid the re-evaluation -->
69 <xsl:template name=
"l10n.language">en
</xsl:template>
71 <xsl:param name=
"gtkdoc.l10n.xml" select=
"document('http://docbook.sourceforge.net/release/xsl/current/common/en.xml')"/>
73 <xsl:key name=
"gtkdoc.gentext.key"
74 match=
"l:gentext[@key]"
76 <xsl:key name=
"gtkdoc.context.key"
77 match=
"l:context[@name]"
80 <xsl:template name=
"gentext">
81 <xsl:param name=
"key" select=
"local-name(.)"/>
83 <xsl:for-each select=
"$gtkdoc.l10n.xml">
84 <xsl:variable name=
"l10n.gentext" select=
"key('gtkdoc.gentext.key', $key)"/>
87 <xsl:when test=
"$l10n.gentext">
88 <xsl:value-of select=
"$l10n.gentext/@text"/>
92 <xsl:text>No
"en" localization of
"</xsl:text>
93 <xsl:value-of select="$key
"/>
94 <xsl:text>" exists.
</xsl:text>
101 <xsl:template name=
"gentext.dingbat">
102 <xsl:param name=
"dingbat">bullet
</xsl:param>
104 <xsl:variable name=
"l10n.dingbat"
105 select=
"($gtkdoc.l10n.xml/l:l10n/l:dingbat[@key=$dingbat])[1]"/>
108 <xsl:when test=
"$l10n.dingbat">
109 <xsl:value-of select=
"$l10n.dingbat/@text"/>
113 <xsl:text>No
"en" localization of dingbat
</xsl:text>
114 <xsl:value-of select=
"$dingbat"/>
115 <xsl:text> exists; using
"en".
</xsl:text>
121 <xsl:template name=
"gentext.template">
122 <xsl:param name=
"context" select=
"'default'"/>
123 <xsl:param name=
"name" select=
"'default'"/>
124 <xsl:param name=
"origname" select=
"$name"/>
126 <!-- cut leading / if any to avoid one recursion -->
127 <xsl:variable name=
"rname">
129 <xsl:when test=
"starts-with($name, '/')">
130 <xsl:value-of select=
"substring-after($name, '/')"/>
133 <xsl:value-of select=
"$name"/>
138 <!-- this is called with context="title|title-numbered|title-unnumbered>
140 <xsl:text>context:</xsl:text><xsl:value-of select="$context"/>
141 <xsl:text>;name:</xsl:text><xsl:value-of select="$rname"/>
142 <xsl:text>;origname:</xsl:text><xsl:value-of select="$origname"/>
145 see html/html.xsl:<xsl:template match="*" mode="html.title.attribute">
148 <xsl:for-each select=
"$gtkdoc.l10n.xml">
149 <xsl:variable name=
"context.node" select=
"key('gtkdoc.context.key', $context)"/>
150 <xsl:variable name=
"template.node"
151 select=
"($context.node/l:template[@name=$rname])[1]"/>
154 <xsl:when test=
"$template.node/@text">
155 <xsl:value-of select=
"$template.node/@text"/>
158 <xsl:text>=</xsl:text><xsl:value-of select="$template.node/@text"/>
164 <xsl:when test=
"contains($rname, '/')">
165 <xsl:call-template name=
"gentext.template">
166 <xsl:with-param name=
"context" select=
"$context"/>
167 <xsl:with-param name=
"name" select=
"substring-after($rname, '/')"/>
168 <xsl:with-param name=
"origname" select=
"$origname"/>
177 <!-- silently test whether a gentext template exists -->
178 <xsl:template name=
"gentext.template.exists">
179 <xsl:param name=
"context" select=
"'default'"/>
180 <xsl:param name=
"name" select=
"'default'"/>
181 <xsl:param name=
"origname" select=
"$name"/>
183 <xsl:variable name=
"template">
184 <xsl:call-template name=
"gentext.template">
185 <xsl:with-param name=
"context" select=
"$context"/>
186 <xsl:with-param name=
"name" select=
"$name"/>
187 <xsl:with-param name=
"origname" select=
"$origname"/>
192 <xsl:when test=
"string-length($template) != 0">1</xsl:when>
193 <xsl:otherwise>0</xsl:otherwise>
197 <!-- shortcut version -->
198 <!-- @bug: https://bugzilla.gnome.org/show_bug.cgi?id=617478 -->
199 <xsl:template name=
"generate.html.title"/>
200 <!--xsl:template name="generate.html.title">
201 <xsl:variable name="has.title.markup">
202 <xsl:apply-templates select="." mode="title.markup">
203 <xsl:with-param name="verbose" select="0"/>
204 </xsl:apply-templates>
206 <xsl:if test="$has.title.markup != '???TITLE???'">
207 <xsl:variable name="gentext.title">
208 <xsl:apply-templates select="." mode="object.title.markup.textonly"/>
211 <xsl:when test="string-length($gentext.title) != 0">
212 <xsl:attribute name="title">
213 <xsl:value-of select="$gentext.title"/>
216 <xsl:when test="alt">
217 <xsl:attribute name="title">
218 <xsl:value-of select="normalize-space(alt)"/>
225 <!-- Generate a title attribute for the context node (e.g. links) -->
226 <xsl:template match=
"*" mode=
"html.title.attribute">
227 <xsl:variable name=
"has.title.markup">
228 <xsl:apply-templates select=
"." mode=
"title.markup">
229 <xsl:with-param name=
"verbose" select=
"0"/>
230 </xsl:apply-templates>
232 <xsl:if test=
"$has.title.markup != '???TITLE???'">
233 <xsl:variable name=
"is.title">
234 <xsl:call-template name=
"gentext.template.exists">
235 <xsl:with-param name=
"context" select=
"'title'"/>
236 <xsl:with-param name=
"name" select=
"local-name(.)"/>
237 <xsl:with-param name=
"lang">
238 <xsl:call-template name=
"l10n.language"/>
243 <xsl:variable name=
"is.title-numbered">
244 <xsl:if test=
"$is.title = 0">
245 <xsl:call-template name=
"gentext.template.exists">
246 <xsl:with-param name=
"context" select=
"'title-numbered'"/>
247 <xsl:with-param name=
"name" select=
"local-name(.)"/>
248 <xsl:with-param name=
"lang">
249 <xsl:call-template name=
"l10n.language"/>
256 <xsl:variable name=
"is.title-unnumbered">
257 <xsl:if test=
"$is.title = 0 and $is.title-numbered = 0">
258 <xsl:call-template name=
"gentext.template.exists">
259 <xsl:with-param name=
"context" select=
"'title-unnumbered'"/>
260 <xsl:with-param name=
"name" select=
"local-name(.)"/>
261 <xsl:with-param name=
"lang">
262 <xsl:call-template name=
"l10n.language"/>
268 <xsl:variable name=
"gentext.title">
269 <xsl:if test=
"$is.title != 0 or
270 $is.title-numbered != 0 or
271 $is.title-unnumbered != 0">
272 <xsl:apply-templates select=
"."
273 mode=
"object.title.markup.textonly"/>
278 <xsl:when test=
"string-length($gentext.title) != 0">
279 <xsl:attribute name=
"title">
280 <xsl:value-of select=
"$gentext.title"/>
283 <xsl:when test=
"alt">
284 <xsl:attribute name=
"title">
285 <xsl:value-of select=
"normalize-space(alt)"/>
295 <!-- ========================================================= -->
296 <!-- template to create the index.sgml anchor index -->
298 <xsl:template match=
"book|article">
299 <xsl:variable name=
"tooldver">
300 <xsl:call-template name=
"version-greater-or-equal">
301 <xsl:with-param name=
"ver1" select=
"$VERSION" />
302 <xsl:with-param name=
"ver2">1.36</xsl:with-param>
305 <xsl:if test=
"$tooldver = 0">
306 <xsl:message terminate=
"yes">
307 FATAL-ERROR: You need the DocBook XSL Stylesheets version
1.36 or higher
308 to build the documentation.
309 Get a newer version at http://docbook.sourceforge.net/projects/xsl/
314 <!-- generate the index.sgml href index -->
315 <xsl:call-template name=
"generate.index"/>
316 <!-- generate $book.devhelp2 -->
317 <xsl:call-template name=
"generate.devhelp2"/>
320 <xsl:template name=
"generate.index">
321 <xsl:call-template name=
"write.text.chunk">
322 <xsl:with-param name=
"filename" select=
"'index.sgml'"/>
323 <xsl:with-param name=
"content">
324 <xsl:apply-templates select=
"/book/bookinfo/releaseinfo/ulink"
325 mode=
"generate.index.mode"/>
326 <!-- check all anchor and refentry elements -->
328 The obvious way to write this is //anchor|//refentry|etc...
329 The obvious way is slow because it causes multiple traversals
330 in libxslt. This take about half the time.
332 <xsl:apply-templates select=
"//*[name()='anchor' or name()='refentry' or name()='refsect1' or
333 name() = 'refsect2' or name()='refsynopsisdiv' or
334 name()='varlistentry']"
335 mode=
"generate.index.mode"/>
337 <xsl:with-param name=
"default.encoding" select=
"'UTF-8'"/>
338 <xsl:with-param name=
"chunker.output.indent" select=
"'no'"/>
342 <xsl:template match=
"*" mode=
"generate.index.mode">
343 <xsl:if test=
"not(@href) and count(@id) > 0">
344 <xsl:text><ANCHOR id=
"</xsl:text>
345 <xsl:value-of select=
"@id"/>
346 <xsl:text>" href=
"</xsl:text>
347 <xsl:if test=
"$gtkdoc.bookname">
348 <xsl:value-of select=
"$gtkdoc.bookname"/>
349 <xsl:text>/
</xsl:text>
351 <xsl:call-template name=
"href.target"/>
352 <xsl:text>"> </xsl:text>
356 <xsl:template match=
"/book/bookinfo/releaseinfo/ulink" mode=
"generate.index.mode">
357 <xsl:if test=
"@role='online-location'">
358 <xsl:text><ONLINE href=
"</xsl:text>
359 <xsl:value-of select=
"@url"/>
360 <xsl:text>"> </xsl:text>
364 <!-- ========================================================= -->
365 <!-- template to output gtkdoclink elements for the unknown targets -->
367 <xsl:template match=
"link">
369 <xsl:when test=
"id(@linkend)">
373 <GTKDOCLINK HREF=
"{@linkend}">
374 <xsl:apply-templates/>
380 <!-- ========================================================= -->
381 <!-- Below are the visual portions of the stylesheet. They provide
382 the normal gtk-doc output style. -->
384 <xsl:param name=
"shade.verbatim" select=
"0"/>
385 <xsl:param name=
"refentry.separator" select=
"0"/>
387 <xsl:template match=
"refsect2">
388 <xsl:if test=
"preceding-sibling::refsect2">
394 <xsl:template name=
"user.head.title">
395 <xsl:param name=
"node" select=
"."/>
396 <xsl:param name=
"title"/>
397 <xsl:variable name=
"home" select=
"/*[1]"/>
399 <xsl:apply-templates select=
"$home" mode=
"object.title.markup"/>:
<xsl:copy-of select=
"$title"/>
403 <xsl:template name=
"user.head.content">
404 <xsl:if test=
"$gtkdoc.version">
405 <meta name=
"generator" content=
"GTK-Doc V{$gtkdoc.version} (XML mode)"/>
407 <link rel=
"stylesheet" href=
"style.css" type=
"text/css"/>
410 <xsl:template name=
"user.footer.content">
414 <xsl:when test=
"$gtkdoc.version">
415 Generated by GTK-Doc V
<xsl:copy-of select=
"$gtkdoc.version" />
424 <xsl:template match=
"title" mode=
"book.titlepage.recto.mode">
425 <table class=
"navigation" id=
"top" width=
"100%"
426 cellpadding=
"2" cellspacing=
"0">
429 <p class=
"{name(.)}">
430 <xsl:value-of select=
"."/>
437 <xsl:template name=
"header.navigation">
438 <xsl:param name=
"prev" select=
"/foo"/>
439 <xsl:param name=
"next" select=
"/foo"/>
440 <xsl:variable name=
"home" select=
"/*[1]"/>
441 <xsl:variable name=
"up" select=
"parent::*"/>
442 <xsl:variable name=
"refsections" select=
"./refsect1[@role]"/>
443 <xsl:variable name=
"glssections" select=
"./glossdiv/title"/>
444 <xsl:variable name=
"idxsections" select=
"./indexdiv/indexdiv/title"/>
445 <xsl:variable name=
"section_id" select=
"./@id"/>
446 <xsl:variable name=
"sect_object_hierarchy" select=
"./refsect1[@role='object_hierarchy']"/>
447 <xsl:variable name=
"sect_impl_interfaces" select=
"./refsect1[@role='impl_interfaces']"/>
448 <xsl:variable name=
"sect_prerequisites" select=
"./refsect1[@role='prerequisites']"/>
449 <xsl:variable name=
"sect_derived_interfaces" select=
"./refsect1[@role='derived_interfaces']"/>
450 <xsl:variable name=
"sect_implementations" select=
"./refsect1[@role='implementations']"/>
451 <xsl:variable name=
"sect_properties" select=
"./refsect1[@role='properties']"/>
452 <xsl:variable name=
"sect_child_properties" select=
"./refsect1[@role='child_properties']"/>
453 <xsl:variable name=
"sect_style_properties" select=
"./refsect1[@role='style_properties']"/>
454 <xsl:variable name=
"sect_signal_proto" select=
"./refsect1[@role='signal_proto']"/>
455 <xsl:variable name=
"sect_desc" select=
"./refsect1[@role='desc']"/>
456 <xsl:variable name=
"sect_synopsis" select=
"./refsynopsisdiv[@role='synopsis']"/>
458 <xsl:variable name="sect_details" select="./refsect1[@id='details']"/>
459 <xsl:variable name="sect_property_details" select="./refsect1[@id='property_details']"/>
460 <xsl:variable name="sect_child_property_details" select="./refsect1[@id='child_property_details']"/>
461 <xsl:variable name="sect_style_property_details" select="./refsect1[@id='style_property_details']"/>
462 <xsl:variable name="sect_signals" select="./refsect1[@id='signals']"/>
465 <xsl:if test=
"$suppress.navigation = '0' and $home != .">
466 <table class=
"navigation" id=
"top" width=
"100%"
467 summary =
"Navigation header" cellpadding=
"2" cellspacing=
"10">
469 <td width=
"100%" align=
"left">
470 <!--<xsl:if test="name()='refentry'"-->
472 <xsl:when test=
"count($refsections) > 0">
473 <a href=
"#" class=
"shortcut">Top
</a>
474 <xsl:if test=
"count($sect_desc) > 0">
476 <a href=
"#{$section_id}.description" class=
"shortcut">
477 <xsl:value-of select=
"./refsect1[@role='desc']/title"/>
480 <xsl:if test=
"count($sect_object_hierarchy) > 0">
482 <a href=
"#{$section_id}.object-hierarchy" class=
"shortcut">
483 <xsl:value-of select=
"./refsect1[@role='object_hierarchy']/title"/>
486 <xsl:if test=
"count($sect_impl_interfaces) > 0">
488 <a href=
"#{$section_id}.implemented-interfaces" class=
"shortcut">
489 <xsl:value-of select=
"./refsect1[@role='impl_interfaces']/title"/>
492 <xsl:if test=
"count($sect_prerequisites) > 0">
494 <a href=
"#{$section_id}.prerequisites" class=
"shortcut">
495 <xsl:value-of select=
"./refsect1[@role='prerequisites']/title"/>
498 <xsl:if test=
"count($sect_derived_interfaces) > 0">
500 <a href=
"#{$section_id}.derived-interfaces" class=
"shortcut">
501 <xsl:value-of select=
"./refsect1[@role='derived_interfaces']/title"/>
504 <xsl:if test=
"count($sect_implementations) > 0">
506 <a href=
"#{$section_id}.implementations" class=
"shortcut">
507 <xsl:value-of select=
"./refsect1[@role='implementations']/title"/>
510 <xsl:if test=
"count($sect_properties) > 0">
512 <a href=
"#{$section_id}.properties" class=
"shortcut">
513 <xsl:value-of select=
"./refsect1[@role='properties']/title"/>
516 <xsl:if test=
"count($sect_child_properties) > 0">
518 <a href=
"#{$section_id}.child-properties" class=
"shortcut">
519 <xsl:value-of select=
"./refsect1[@role='child_properties']/title"/>
522 <xsl:if test=
"count($sect_style_properties) > 0">
524 <a href=
"#{$section_id}.style-properties" class=
"shortcut">
525 <xsl:value-of select=
"./refsect1[@role='style_properties']/title"/>
528 <xsl:if test=
"count($sect_signal_proto) > 0">
530 <a href=
"#{$section_id}.signals" class=
"shortcut">
531 <xsl:value-of select=
"./refsect1[@role='signal_proto']/title"/>
535 <xsl:if test="count($sect_details) > 0">
536 <a href="#details" class="shortcut">
537 <xsl:value-of select="./refsect1[@id='details']/title"/>
541 <xsl:if test="count($sect_property_details) > 0">
542 <a href="#property_details" class="shortcut">
543 <xsl:value-of select="./refsect1[@id='property_details']/title"/>
547 <xsl:if test="count($sect_child_property_details) > 0">
548 <a href="#child_property_details" class="shortcut">
549 <xsl:value-of select="./refsect1[@id='property_child_details']/title"/>
553 <xsl:if test="count($sect_style_property_details) > 0">
554 <a href="#style_property_details" class="shortcut">
555 <xsl:value-of select="./refsect1[@id='style_property_details']/title"/>
559 <xsl:if test="count($sect_signals) > 0">
560 <a href="#signals" class="shortcut">
561 <xsl:value-of select="./refsect1[@id='signals']/title"/>
567 <!-- this is not yet very nice, as it requires all glossdic/indexdiv
568 elements having a anchor element. maybe we can customize the xsl
569 to automaticaly create local anchors
571 <xsl:when test=
"count($glssections) > 0">
572 <xsl:for-each select=
"./glossdiv">
573 <xsl:if test=
"position() > 1">
577 <xsl:attribute name=
"href">#gls
<xsl:value-of select=
"./title"/></xsl:attribute>
578 <xsl:value-of select=
"./title"/>
582 <xsl:when test=
"count($idxsections) > 0">
583 <xsl:for-each select=
"./indexdiv/indexdiv">
584 <xsl:if test=
"position() > 1">
588 <xsl:attribute name=
"href">#idx
<xsl:value-of select=
"./title"/></xsl:attribute>
589 <xsl:value-of select=
"./title"/>
596 <xsl:when test=
"$home != .">
599 <xsl:attribute name=
"href">
600 <xsl:call-template name=
"href.target">
601 <xsl:with-param name=
"object" select=
"$home"/>
604 <img src=
"home.png" width=
"16" height=
"16" border=
"0">
605 <xsl:attribute name=
"alt">
606 <xsl:call-template name=
"gentext">
607 <xsl:with-param name=
"key">nav-home
</xsl:with-param>
619 <xsl:when test=
"count($up) > 0 and $up != $home">
622 <xsl:attribute name=
"href">
623 <xsl:call-template name=
"href.target">
624 <xsl:with-param name=
"object" select=
"$up"/>
627 <img src=
"up.png" width=
"16" height=
"16" border=
"0">
628 <xsl:attribute name=
"alt">
629 <xsl:call-template name=
"gentext">
630 <xsl:with-param name=
"key">nav-up
</xsl:with-param>
638 <td><img src=
"up-insensitive.png" width=
"16" height=
"16" border=
"0"/></td>
642 <xsl:when test=
"count($prev) > 0">
645 <xsl:attribute name=
"href">
646 <xsl:call-template name=
"href.target">
647 <xsl:with-param name=
"object" select=
"$prev"/>
650 <img src=
"left.png" width=
"16" height=
"16" border=
"0">
651 <xsl:attribute name=
"alt">
652 <xsl:call-template name=
"gentext">
653 <xsl:with-param name=
"key">nav-prev
</xsl:with-param>
661 <td><img src=
"left-insensitive.png" width=
"16" height=
"16" border=
"0"/></td>
665 <xsl:when test=
"count($next) > 0">
668 <xsl:attribute name=
"href">
669 <xsl:call-template name=
"href.target">
670 <xsl:with-param name=
"object" select=
"$next"/>
673 <img src=
"right.png" width=
"16" height=
"16" border=
"0">
674 <xsl:attribute name=
"alt">
675 <xsl:call-template name=
"gentext">
676 <xsl:with-param name=
"key">nav-next
</xsl:with-param>
684 <td><img src=
"right-insensitive.png" width=
"16" height=
"16" border=
"0"/></td>
692 <xsl:template name=
"footer.navigation">
695 <!-- avoid creating multiple identical indices
696 if the stylesheets don't support filtered indices
698 <xsl:template match=
"index">
699 <xsl:variable name=
"has-filtered-index">
700 <xsl:call-template name=
"version-greater-or-equal">
701 <xsl:with-param name=
"ver1" select=
"$VERSION" />
702 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
705 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
710 <xsl:template match=
"index" mode=
"toc">
711 <xsl:variable name=
"has-filtered-index">
712 <xsl:call-template name=
"version-greater-or-equal">
713 <xsl:with-param name=
"ver1" select=
"$VERSION" />
714 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
717 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
722 <xsl:template match=
"para">
724 <xsl:when test=
"@role = 'gallery'">
725 <div class=
"container">
726 <div class=
"gallery-spacer"> </div>
727 <xsl:apply-templates mode=
"gallery.mode"/>
728 <div class=
"gallery-spacer"> </div>
736 <!-- FIXME: try if that works too -->
737 <!--xsl:template match="para[@role='gallery']">
738 <div class="container">
739 <div class="gallery-spacer"> </div>
740 <xsl:apply-templates mode="gallery.mode"/>
741 <div class="gallery-spacer"> </div>
747 <xsl:template match="link" mode="gallery.mode">
748 <div class="gallery-float">
749 <xsl:apply-templates select="."/>
753 <!-- add gallery handling to refnamediv template -->
754 <xsl:template match=
"refnamediv">
755 <div class=
"{name(.)}">
757 <tr><td valign=
"top">
758 <xsl:call-template name=
"anchor"/>
760 <xsl:when test=
"$refentry.generate.name != 0">
762 <xsl:call-template name=
"gentext">
763 <xsl:with-param name=
"key" select=
"'RefName'"/>
767 <xsl:when test=
"$refentry.generate.title != 0">
770 <xsl:when test=
"../refmeta/refentrytitle">
771 <xsl:apply-templates select=
"../refmeta/refentrytitle"/>
774 <xsl:apply-templates select=
"refname[1]"/>
781 <xsl:apply-templates/>
784 <td valign=
"top" align=
"right">
786 <xsl:when test=
"../refmeta/refmiscinfo/inlinegraphic">
787 <xsl:apply-templates select=
"../refmeta/refmiscinfo/inlinegraphic"/>
790 <!-- find the gallery image to use here
791 - determine the id of the enclosing refentry
792 - look for an inlinegraphic inside a link with linkend == refentryid inside a para with role == gallery
795 <xsl:variable name=
"refentryid" select=
"../@id"/>
796 <xsl:apply-templates select=
"key('gallery.key', $refentryid)/inlinegraphic"/>
804 <!-- add anchors for index sections -->
805 <xsl:template match=
"indexdiv">
806 <a><xsl:attribute name=
"name">idx
<xsl:value-of select=
"./title"/></xsl:attribute></a>
807 <xsl:apply-templates/>
810 <!-- add anchors for glossary sections -->
811 <xsl:template match=
"glossdiv">
812 <a><xsl:attribute name=
"name">gls
<xsl:value-of select=
"./title"/></xsl:attribute></a>
813 <xsl:apply-templates/>
816 <!-- Exterminate any trace of indexterms in the main flow -->
817 <xsl:template match=
"indexterm">
820 <!-- Extra link on the right side of doc-blobs -->
821 <xsl:template name=
"user.format.extralinks">
822 <xsl:if test=
"../ulink[@role='extralinks']">
823 <span class=
"extralinks">
824 <xsl:for-each select=
"../ulink[@role='extralinks']">
825 <xsl:if test=
"position() = 1">[
 </xsl:if>
826 <xsl:if test=
"position() > 1"> |
 </xsl:if>
828 <xsl:attribute name=
"href"><xsl:value-of select=
"@url"/></xsl:attribute>
829 <xsl:copy-of select=
"text()" />
831 <xsl:if test=
"position() = last()"> ]
</xsl:if>
835 <!--xsl:copy-of select="text()" /-->
836 <xsl:apply-templates/>
839 <!-- this is not in use yet (see gtkdoc-mkdb
840 <xsl:template match="//refsect2/ulink[@role='extralinks']"/>
841 <xsl:template match="//refsect1/ulink[@role='extralinks']"/>
843 <xsl:template match="//refsect2/title">
844 <h3><xsl:call-template name="user.format.extralinks"/></h3>
847 <xsl:template match="//refsect1/title">
848 <h2><xsl:call-template name="user.format.extralinks"/></h2>
852 <!-- ==================================================================== -->
854 <xsl:template match=
"acronym">
855 <xsl:call-template name=
"generate.acronym.link"/>
858 <xsl:template name=
"generate.acronym.link">
859 <xsl:param name=
"acronym">
860 <xsl:apply-templates/>
863 We use for-each to change context to the database document because key()
864 only locates elements in the same document as the context node!
867 <xsl:param name=
"value" >
868 <xsl:value-of select=
"key('acronym.key', $acronym)/../glossdef/para[1]" />
871 <xsl:when test=
"$value=''">
874 In gtk-doc.xsl: For acronym (
<xsl:value-of select=
"$acronym"/>) no value found!
877 <xsl:attribute name=
"href">
878 <xsl:text>http://foldoc.org/
</xsl:text>
879 <xsl:value-of select=
"$acronym"/>
881 <xsl:call-template name=
"inline.charseq"/>
887 <xsl:attribute name=
"title">
888 <xsl:value-of select=
"$value"/>
890 <xsl:call-template name=
"inline.charseq"/>