Updated Spanish translation
[gtk-doc.git] / gtk-doc.xsl
blob36b6453eac1cfc53814ad52f8e0f63c04fce6c67
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"
5 version="1.0">
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"
16 use="."/>
17 <xsl:key name="gallery.key"
18 match="para[@role='gallery']/link"
19 use="@linkend"/>
21 <!-- change some parameters -->
22 <!-- http://docbook.sourceforge.net/release/xsl/current/doc/html/index.html -->
23 <xsl:param name="toc.section.depth">2</xsl:param>
24 <xsl:param name="generate.toc">
25 book toc
26 chapter toc
27 glossary toc
28 index toc
29 part toc
30 reference toc
31 </xsl:param>
33 <xsl:param name="chunker.output.encoding" select="'UTF-8'"/>
34 <xsl:param name="chunker.output.indent" select="'yes'"/>
35 <xsl:param name="chunker.output.doctype-public" select="'-//W3C//DTD HTML 4.01 Transitional//EN'"/>
36 <xsl:param name="chunk.fast" select="1"/>
38 <xsl:param name="default.encoding" select="'UTF-8'"/>
39 <xsl:param name="chapter.autolabel" select="0"/>
40 <xsl:param name="use.id.as.filename" select="1"/>
41 <xsl:param name="html.ext" select="'.html'"/>
42 <xsl:param name="refentry.generate.name" select="0"/>
43 <xsl:param name="refentry.generate.title" select="1"/>
44 <!-- don't generate all those link tags (very slow and hardly used)
45 it does not show much effect as we have a user.head.content template
46 <xsl:param name="html.extra.head.links" select="0" />
47 -->
49 <!-- use index filtering (if available) -->
50 <xsl:param name="index.on.role" select="1"/>
52 <!-- display variablelists as tables -->
53 <xsl:param name="variablelist.as.table" select="1"/>
55 <!-- new things to consider
56 <xsl:param name="glossterm.auto.link" select="0"></xsl:param>
57 -->
59 <!-- this gets set on the command line ... -->
60 <xsl:param name="gtkdoc.version" select="''"/>
61 <xsl:param name="gtkdoc.bookname" select="''"/>
63 <!-- ========================================================= -->
65 <!-- l10n is slow, we don't ue it, so we'd like to turn it off
66 this atleast avoid the re-evaluation -->
67 <xsl:template name="l10n.language">en</xsl:template>
69 <xsl:param name="gtkdoc.l10n.xml" select="document('http://docbook.sourceforge.net/release/xsl/current/common/en.xml')"/>
71 <xsl:key name="gtkdoc.gentext.key"
72 match="l:gentext[@key]"
73 use="@key"/>
74 <xsl:key name="gtkdoc.context.key"
75 match="l:context[@name]"
76 use="@name"/>
78 <xsl:template name="gentext">
79 <xsl:param name="key" select="local-name(.)"/>
81 <xsl:for-each select="$gtkdoc.l10n.xml">
82 <xsl:variable name="l10n.gentext" select="key('gtkdoc.gentext.key', $key)"/>
84 <xsl:choose>
85 <xsl:when test="$l10n.gentext">
86 <xsl:value-of select="$l10n.gentext/@text"/>
87 </xsl:when>
88 <xsl:otherwise>
89 <xsl:message>
90 <xsl:text>No "en" localization of "</xsl:text>
91 <xsl:value-of select="$key"/>
92 <xsl:text>" exists.</xsl:text>
93 </xsl:message>
94 </xsl:otherwise>
95 </xsl:choose>
96 </xsl:for-each>
97 </xsl:template>
99 <xsl:template name="gentext.dingbat">
100 <xsl:param name="dingbat">bullet</xsl:param>
102 <xsl:variable name="l10n.dingbat"
103 select="($gtkdoc.l10n.xml/l:l10n/l:dingbat[@key=$dingbat])[1]"/>
105 <xsl:choose>
106 <xsl:when test="$l10n.dingbat">
107 <xsl:value-of select="$l10n.dingbat/@text"/>
108 </xsl:when>
109 <xsl:otherwise>
110 <xsl:message>
111 <xsl:text>No "en" localization of dingbat </xsl:text>
112 <xsl:value-of select="$dingbat"/>
113 <xsl:text> exists; using "en".</xsl:text>
114 </xsl:message>
115 </xsl:otherwise>
116 </xsl:choose>
117 </xsl:template>
119 <xsl:template name="gentext.template">
120 <xsl:param name="context" select="'default'"/>
121 <xsl:param name="name" select="'default'"/>
122 <xsl:param name="origname" select="$name"/>
124 <!-- cut leading / if any to avoid one recursion -->
125 <xsl:variable name="rname">
126 <xsl:choose>
127 <xsl:when test="starts-with($name, '/')">
128 <xsl:value-of select="substring-after($name, '/')"/>
129 </xsl:when>
130 <xsl:otherwise>
131 <xsl:value-of select="$name"/>
132 </xsl:otherwise>
133 </xsl:choose>
134 </xsl:variable>
136 <!-- this is called with context="title|title-numbered|title-unnumbered>
137 <xsl:message>
138 <xsl:text>context:</xsl:text><xsl:value-of select="$context"/>
139 <xsl:text>;name:</xsl:text><xsl:value-of select="$rname"/>
140 <xsl:text>;origname:</xsl:text><xsl:value-of select="$origname"/>
141 </xsl:message>
143 see html/html.xsl:<xsl:template match="*" mode="html.title.attribute">
146 <xsl:for-each select="$gtkdoc.l10n.xml">
147 <xsl:variable name="context.node" select="key('gtkdoc.context.key', $context)"/>
148 <xsl:variable name="template.node"
149 select="($context.node/l:template[@name=$rname])[1]"/>
151 <xsl:choose>
152 <xsl:when test="$template.node/@text">
153 <xsl:value-of select="$template.node/@text"/>
154 <!-- debug
155 <xsl:message>
156 <xsl:text>=</xsl:text><xsl:value-of select="$template.node/@text"/>
157 </xsl:message>
159 </xsl:when>
160 <xsl:otherwise>
161 <xsl:choose>
162 <xsl:when test="contains($rname, '/')">
163 <xsl:call-template name="gentext.template">
164 <xsl:with-param name="context" select="$context"/>
165 <xsl:with-param name="name" select="substring-after($rname, '/')"/>
166 <xsl:with-param name="origname" select="$origname"/>
167 </xsl:call-template>
168 </xsl:when>
169 </xsl:choose>
170 </xsl:otherwise>
171 </xsl:choose>
172 </xsl:for-each>
173 </xsl:template>
175 <!-- silently test whether a gentext template exists -->
176 <xsl:template name="gentext.template.exists">
177 <xsl:param name="context" select="'default'"/>
178 <xsl:param name="name" select="'default'"/>
179 <xsl:param name="origname" select="$name"/>
181 <xsl:variable name="template">
182 <xsl:call-template name="gentext.template">
183 <xsl:with-param name="context" select="$context"/>
184 <xsl:with-param name="name" select="$name"/>
185 <xsl:with-param name="origname" select="$origname"/>
186 </xsl:call-template>
187 </xsl:variable>
189 <xsl:choose>
190 <xsl:when test="string-length($template) != 0">1</xsl:when>
191 <xsl:otherwise>0</xsl:otherwise>
192 </xsl:choose>
193 </xsl:template>
195 <!-- shortcut version -->
196 <!-- @bug: https://bugzilla.gnome.org/show_bug.cgi?id=617478 -->
197 <xsl:template name="generate.html.title"/>
198 <!--xsl:template name="generate.html.title">
199 <xsl:variable name="has.title.markup">
200 <xsl:apply-templates select="." mode="title.markup">
201 <xsl:with-param name="verbose" select="0"/>
202 </xsl:apply-templates>
203 </xsl:variable>
204 <xsl:if test="$has.title.markup != '???TITLE???'">
205 <xsl:variable name="gentext.title">
206 <xsl:apply-templates select="." mode="object.title.markup.textonly"/>
207 </xsl:variable>
208 <xsl:choose>
209 <xsl:when test="string-length($gentext.title) != 0">
210 <xsl:attribute name="title">
211 <xsl:value-of select="$gentext.title"/>
212 </xsl:attribute>
213 </xsl:when>
214 <xsl:when test="alt">
215 <xsl:attribute name="title">
216 <xsl:value-of select="normalize-space(alt)"/>
217 </xsl:attribute>
218 </xsl:when>
219 </xsl:choose>
220 </xsl:if>
221 </xsl:template-->
223 <!-- Generate a title attribute for the context node (e.g. links) -->
224 <xsl:template match="*" mode="html.title.attribute">
225 <xsl:variable name="has.title.markup">
226 <xsl:apply-templates select="." mode="title.markup">
227 <xsl:with-param name="verbose" select="0"/>
228 </xsl:apply-templates>
229 </xsl:variable>
230 <xsl:if test="$has.title.markup != '???TITLE???'">
231 <xsl:variable name="is.title">
232 <xsl:call-template name="gentext.template.exists">
233 <xsl:with-param name="context" select="'title'"/>
234 <xsl:with-param name="name" select="local-name(.)"/>
235 <xsl:with-param name="lang">
236 <xsl:call-template name="l10n.language"/>
237 </xsl:with-param>
238 </xsl:call-template>
239 </xsl:variable>
241 <xsl:variable name="is.title-numbered">
242 <xsl:if test="$is.title = 0">
243 <xsl:call-template name="gentext.template.exists">
244 <xsl:with-param name="context" select="'title-numbered'"/>
245 <xsl:with-param name="name" select="local-name(.)"/>
246 <xsl:with-param name="lang">
247 <xsl:call-template name="l10n.language"/>
248 </xsl:with-param>
249 </xsl:call-template>
250 </xsl:if>
251 </xsl:variable>
254 <xsl:variable name="is.title-unnumbered">
255 <xsl:if test="$is.title = 0 and $is.title-numbered = 0">
256 <xsl:call-template name="gentext.template.exists">
257 <xsl:with-param name="context" select="'title-unnumbered'"/>
258 <xsl:with-param name="name" select="local-name(.)"/>
259 <xsl:with-param name="lang">
260 <xsl:call-template name="l10n.language"/>
261 </xsl:with-param>
262 </xsl:call-template>
263 </xsl:if>
264 </xsl:variable>
266 <xsl:variable name="gentext.title">
267 <xsl:if test="$is.title != 0 or
268 $is.title-numbered != 0 or
269 $is.title-unnumbered != 0">
270 <xsl:apply-templates select="."
271 mode="object.title.markup.textonly"/>
272 </xsl:if>
273 </xsl:variable>
275 <xsl:choose>
276 <xsl:when test="string-length($gentext.title) != 0">
277 <xsl:attribute name="title">
278 <xsl:value-of select="$gentext.title"/>
279 </xsl:attribute>
280 </xsl:when>
281 <xsl:when test="alt">
282 <xsl:attribute name="title">
283 <xsl:value-of select="normalize-space(alt)"/>
284 </xsl:attribute>
285 </xsl:when>
286 </xsl:choose>
287 </xsl:if>
288 </xsl:template>
293 <!-- ========================================================= -->
294 <!-- template to create the index.sgml anchor index -->
296 <xsl:template match="book|article">
297 <xsl:variable name="tooldver">
298 <xsl:call-template name="version-greater-or-equal">
299 <xsl:with-param name="ver1" select="$VERSION" />
300 <xsl:with-param name="ver2">1.36</xsl:with-param>
301 </xsl:call-template>
302 </xsl:variable>
303 <xsl:if test="$tooldver = 0">
304 <xsl:message terminate="yes">
305 FATAL-ERROR: You need the DocBook XSL Stylesheets version 1.36 or higher
306 to build the documentation.
307 Get a newer version at http://docbook.sourceforge.net/projects/xsl/
308 </xsl:message>
309 </xsl:if>
310 <xsl:apply-imports/>
312 <!-- generate the index.sgml href index -->
313 <xsl:call-template name="generate.index"/>
314 <!-- generate $book.devhelp2 -->
315 <xsl:call-template name="generate.devhelp2"/>
316 </xsl:template>
318 <xsl:template name="generate.index">
319 <xsl:call-template name="write.text.chunk">
320 <xsl:with-param name="filename" select="'index.sgml'"/>
321 <xsl:with-param name="content">
322 <xsl:apply-templates select="/book/bookinfo/releaseinfo/ulink"
323 mode="generate.index.mode"/>
324 <!-- check all anchor and refentry elements -->
325 <!--
326 The obvious way to write this is //anchor|//refentry|etc...
327 The obvious way is slow because it causes multiple traversals
328 in libxslt. This take about half the time.
330 <xsl:apply-templates select="//*[name()='anchor' or name()='refentry' or name()='refsect1' or
331 name() = 'refsect2' or name()='refsynopsisdiv' or
332 name()='varlistentry']"
333 mode="generate.index.mode"/>
334 </xsl:with-param>
335 <xsl:with-param name="default.encoding" select="'UTF-8'"/>
336 <xsl:with-param name="chunker.output.indent" select="'no'"/>
337 </xsl:call-template>
338 </xsl:template>
340 <xsl:template match="*" mode="generate.index.mode">
341 <xsl:if test="not(@href) and count(@id) > 0">
342 <xsl:text>&lt;ANCHOR id=&quot;</xsl:text>
343 <xsl:value-of select="@id"/>
344 <xsl:text>&quot; href=&quot;</xsl:text>
345 <xsl:if test="$gtkdoc.bookname">
346 <xsl:value-of select="$gtkdoc.bookname"/>
347 <xsl:text>/</xsl:text>
348 </xsl:if>
349 <xsl:call-template name="href.target"/>
350 <xsl:text>&quot;&gt;&#10;</xsl:text>
351 </xsl:if>
352 </xsl:template>
354 <xsl:template match="/book/bookinfo/releaseinfo/ulink" mode="generate.index.mode">
355 <xsl:if test="@role='online-location'">
356 <xsl:text>&lt;ONLINE href=&quot;</xsl:text>
357 <xsl:value-of select="@url"/>
358 <xsl:text>&quot;&gt;&#10;</xsl:text>
359 </xsl:if>
360 </xsl:template>
362 <!-- ========================================================= -->
363 <!-- template to output gtkdoclink elements for the unknown targets -->
365 <xsl:template match="link">
366 <xsl:choose>
367 <xsl:when test="id(@linkend)">
368 <xsl:apply-imports/>
369 </xsl:when>
370 <xsl:otherwise>
371 <GTKDOCLINK HREF="{@linkend}">
372 <xsl:apply-templates/>
373 </GTKDOCLINK>
374 </xsl:otherwise>
375 </xsl:choose>
376 </xsl:template>
378 <!-- ========================================================= -->
379 <!-- Below are the visual portions of the stylesheet. They provide
380 the normal gtk-doc output style. -->
382 <xsl:param name="shade.verbatim" select="0"/>
383 <xsl:param name="refentry.separator" select="0"/>
385 <xsl:template match="refsect2">
386 <xsl:if test="preceding-sibling::refsect2">
387 <hr/>
388 </xsl:if>
389 <xsl:apply-imports/>
390 </xsl:template>
392 <xsl:template name="user.head.content">
393 <xsl:if test="$gtkdoc.version">
394 <meta name="generator" content="GTK-Doc V{$gtkdoc.version} (XML mode)"/>
395 </xsl:if>
396 <link rel="stylesheet" href="style.css" type="text/css"/>
397 </xsl:template>
399 <xsl:template name="user.footer.content">
400 <div class="footer">
401 <hr />
402 <xsl:choose>
403 <xsl:when test="$gtkdoc.version">
404 Generated by GTK-Doc V<xsl:copy-of select="$gtkdoc.version" />
405 </xsl:when>
406 <xsl:otherwise>
407 Generated by GTK-Doc
408 </xsl:otherwise>
409 </xsl:choose>
410 </div>
411 </xsl:template>
413 <xsl:template match="title" mode="book.titlepage.recto.mode">
414 <table class="navigation" id="top" width="100%"
415 cellpadding="2" cellspacing="0">
416 <tr>
417 <th valign="middle">
418 <p class="{name(.)}">
419 <xsl:value-of select="."/>
420 </p>
421 </th>
422 </tr>
423 </table>
424 </xsl:template>
426 <xsl:template name="header.navigation">
427 <xsl:param name="prev" select="/foo"/>
428 <xsl:param name="next" select="/foo"/>
429 <xsl:variable name="home" select="/*[1]"/>
430 <xsl:variable name="up" select="parent::*"/>
431 <xsl:variable name="refsections" select="./refsect1[@role]"/>
432 <xsl:variable name="glssections" select="./glossdiv/title"/>
433 <xsl:variable name="idxsections" select="./indexdiv/indexdiv/title"/>
434 <xsl:variable name="section_id" select="./@id"/>
435 <xsl:variable name="sect_object_hierarchy" select="./refsect1[@role='object_hierarchy']"/>
436 <xsl:variable name="sect_impl_interfaces" select="./refsect1[@role='impl_interfaces']"/>
437 <xsl:variable name="sect_prerequisites" select="./refsect1[@role='prerequisites']"/>
438 <xsl:variable name="sect_derived_interfaces" select="./refsect1[@role='derived_interfaces']"/>
439 <xsl:variable name="sect_implementations" select="./refsect1[@role='implementations']"/>
440 <xsl:variable name="sect_properties" select="./refsect1[@role='properties']"/>
441 <xsl:variable name="sect_child_properties" select="./refsect1[@role='child_properties']"/>
442 <xsl:variable name="sect_style_properties" select="./refsect1[@role='style_properties']"/>
443 <xsl:variable name="sect_signal_proto" select="./refsect1[@role='signal_proto']"/>
444 <xsl:variable name="sect_desc" select="./refsect1[@role='desc']"/>
445 <xsl:variable name="sect_synopsis" select="./refsynopsisdiv[@role='synopsis']"/>
446 <!--
447 <xsl:variable name="sect_details" select="./refsect1[@id='details']"/>
448 <xsl:variable name="sect_property_details" select="./refsect1[@id='property_details']"/>
449 <xsl:variable name="sect_child_property_details" select="./refsect1[@id='child_property_details']"/>
450 <xsl:variable name="sect_style_property_details" select="./refsect1[@id='style_property_details']"/>
451 <xsl:variable name="sect_signals" select="./refsect1[@id='signals']"/>
454 <xsl:if test="$suppress.navigation = '0' and $home != .">
455 <table class="navigation" id="top" width="100%"
456 summary = "Navigation header" cellpadding="2" cellspacing="2">
457 <tr valign="middle">
458 <xsl:choose>
459 <xsl:when test="count($prev) > 0">
460 <td>
461 <a accesskey="p">
462 <xsl:attribute name="href">
463 <xsl:call-template name="href.target">
464 <xsl:with-param name="object" select="$prev"/>
465 </xsl:call-template>
466 </xsl:attribute>
467 <img src="left.png" width="24" height="24" border="0">
468 <xsl:attribute name="alt">
469 <xsl:call-template name="gentext">
470 <xsl:with-param name="key">nav-prev</xsl:with-param>
471 </xsl:call-template>
472 </xsl:attribute>
473 </img>
474 </a>
475 </td>
476 </xsl:when>
477 <xsl:otherwise>
478 <td>&#160;</td>
479 </xsl:otherwise>
480 </xsl:choose>
481 <xsl:choose>
482 <xsl:when test="count($up) > 0 and $up != $home">
483 <td>
484 <a accesskey="u">
485 <xsl:attribute name="href">
486 <xsl:call-template name="href.target">
487 <xsl:with-param name="object" select="$up"/>
488 </xsl:call-template>
489 </xsl:attribute>
490 <img src="up.png" width="24" height="24" border="0">
491 <xsl:attribute name="alt">
492 <xsl:call-template name="gentext">
493 <xsl:with-param name="key">nav-up</xsl:with-param>
494 </xsl:call-template>
495 </xsl:attribute>
496 </img>
497 </a>
498 </td>
499 </xsl:when>
500 <xsl:otherwise>
501 <td>&#160;</td>
502 </xsl:otherwise>
503 </xsl:choose>
504 <xsl:choose>
505 <xsl:when test="$home != .">
506 <td>
507 <a accesskey="h">
508 <xsl:attribute name="href">
509 <xsl:call-template name="href.target">
510 <xsl:with-param name="object" select="$home"/>
511 </xsl:call-template>
512 </xsl:attribute>
513 <img src="home.png" width="24" height="24" border="0">
514 <xsl:attribute name="alt">
515 <xsl:call-template name="gentext">
516 <xsl:with-param name="key">nav-home</xsl:with-param>
517 </xsl:call-template>
518 </xsl:attribute>
519 </img>
520 </a>
521 </td>
522 </xsl:when>
523 <xsl:otherwise>
524 <td>&#160;</td>
525 </xsl:otherwise>
526 </xsl:choose>
527 <th width="100%" align="center">
528 <xsl:apply-templates select="$home" mode="object.title.markup"/>
529 </th>
530 <xsl:choose>
531 <xsl:when test="count($next) > 0">
532 <td>
533 <a accesskey="n">
534 <xsl:attribute name="href">
535 <xsl:call-template name="href.target">
536 <xsl:with-param name="object" select="$next"/>
537 </xsl:call-template>
538 </xsl:attribute>
539 <img src="right.png" width="24" height="24" border="0">
540 <xsl:attribute name="alt">
541 <xsl:call-template name="gentext">
542 <xsl:with-param name="key">nav-next</xsl:with-param>
543 </xsl:call-template>
544 </xsl:attribute>
545 </img>
546 </a>
547 </td>
548 </xsl:when>
549 <xsl:otherwise>
550 <td>&#160;</td>
551 </xsl:otherwise>
552 </xsl:choose>
553 </tr>
554 <!--<xsl:if test="name()='refentry'"-->
555 <xsl:choose>
556 <xsl:when test="count($refsections) > 0">
557 <tr>
558 <td colspan="5" class="shortcuts">
559 <xsl:if test="count($sect_synopsis) > 0">
560 <a href="#{$section_id}.synopsis" class="shortcut">Top</a>
561 </xsl:if>
562 <xsl:if test="count($sect_desc) > 0">
563 &#160;|&#160;
564 <a href="#{$section_id}.description" class="shortcut">
565 <xsl:value-of select="./refsect1[@role='desc']/title"/>
566 </a>
567 </xsl:if>
568 <xsl:if test="count($sect_object_hierarchy) > 0">
569 &#160;|&#160;
570 <a href="#{$section_id}.object-hierarchy" class="shortcut">
571 <xsl:value-of select="./refsect1[@role='object_hierarchy']/title"/>
572 </a>
573 </xsl:if>
574 <xsl:if test="count($sect_impl_interfaces) > 0">
575 &#160;|&#160;
576 <a href="#{$section_id}.implemented-interfaces" class="shortcut">
577 <xsl:value-of select="./refsect1[@role='impl_interfaces']/title"/>
578 </a>
579 </xsl:if>
580 <xsl:if test="count($sect_prerequisites) > 0">
581 &#160;|&#160;
582 <a href="#{$section_id}.prerequisites" class="shortcut">
583 <xsl:value-of select="./refsect1[@role='prerequisites']/title"/>
584 </a>
585 </xsl:if>
586 <xsl:if test="count($sect_derived_interfaces) > 0">
587 &#160;|&#160;
588 <a href="#{$section_id}.derived-interfaces" class="shortcut">
589 <xsl:value-of select="./refsect1[@role='derived_interfaces']/title"/>
590 </a>
591 </xsl:if>
592 <xsl:if test="count($sect_implementations) > 0">
593 &#160;|&#160;
594 <a href="#{$section_id}.implementations" class="shortcut">
595 <xsl:value-of select="./refsect1[@role='implementations']/title"/>
596 </a>
597 </xsl:if>
598 <xsl:if test="count($sect_properties) > 0">
599 &#160;|&#160;
600 <a href="#{$section_id}.properties" class="shortcut">
601 <xsl:value-of select="./refsect1[@role='properties']/title"/>
602 </a>
603 </xsl:if>
604 <xsl:if test="count($sect_child_properties) > 0">
605 &#160;|&#160;
606 <a href="#{$section_id}.child-properties" class="shortcut">
607 <xsl:value-of select="./refsect1[@role='child_properties']/title"/>
608 </a>
609 </xsl:if>
610 <xsl:if test="count($sect_style_properties) > 0">
611 &#160;|&#160;
612 <a href="#{$section_id}.style-properties" class="shortcut">
613 <xsl:value-of select="./refsect1[@role='style_properties']/title"/>
614 </a>
615 </xsl:if>
616 <xsl:if test="count($sect_signal_proto) > 0">
617 &#160;|&#160;
618 <a href="#{$section_id}.signals" class="shortcut">
619 <xsl:value-of select="./refsect1[@role='signal_proto']/title"/>
620 </a>
621 </xsl:if>
622 <!--
623 <xsl:if test="count($sect_details) > 0">
624 <a href="#details" class="shortcut">
625 <xsl:value-of select="./refsect1[@id='details']/title"/>
626 </a>
627 &#160;|&#160;
628 </xsl:if>
629 <xsl:if test="count($sect_property_details) > 0">
630 <a href="#property_details" class="shortcut">
631 <xsl:value-of select="./refsect1[@id='property_details']/title"/>
632 </a>
633 &#160;|&#160;
634 </xsl:if>
635 <xsl:if test="count($sect_child_property_details) > 0">
636 <a href="#child_property_details" class="shortcut">
637 <xsl:value-of select="./refsect1[@id='property_child_details']/title"/>
638 </a>
639 &#160;|&#160;
640 </xsl:if>
641 <xsl:if test="count($sect_style_property_details) > 0">
642 <a href="#style_property_details" class="shortcut">
643 <xsl:value-of select="./refsect1[@id='style_property_details']/title"/>
644 </a>
645 &#160;|&#160;
646 </xsl:if>
647 <xsl:if test="count($sect_signals) > 0">
648 <a href="#signals" class="shortcut">
649 <xsl:value-of select="./refsect1[@id='signals']/title"/>
650 </a>
651 &#160;|&#160;
652 </xsl:if>
654 </td>
655 </tr>
656 </xsl:when>
657 <!-- this is not yet very nice, as it requires all glossdic/indexdiv
658 elements having a anchor element. maybe we can customize the xsl
659 to automaticaly create local anchors
661 <xsl:when test="count($glssections) > 0">
662 <tr>
663 <td colspan="5" class="shortcuts">
664 <xsl:for-each select="./glossdiv">
665 <xsl:if test="position() > 1">
666 &#160;|&#160;
667 </xsl:if>
668 <a class="shortcut">
669 <xsl:attribute name="href">#gls<xsl:value-of select="./title"/></xsl:attribute>
670 <xsl:value-of select="./title"/>
671 </a>
672 </xsl:for-each>
673 </td>
674 </tr>
675 </xsl:when>
676 <xsl:when test="count($idxsections) > 0">
677 <tr>
678 <td colspan="5" class="shortcuts">
679 <xsl:for-each select="./indexdiv/indexdiv">
680 <xsl:if test="position() > 1">
681 &#160;|&#160;
682 </xsl:if>
683 <a class="shortcut">
684 <xsl:attribute name="href">#idx<xsl:value-of select="./title"/></xsl:attribute>
685 <xsl:value-of select="./title"/>
686 </a>
687 </xsl:for-each>
688 </td>
689 </tr>
690 </xsl:when>
691 </xsl:choose>
692 </table>
693 </xsl:if>
694 </xsl:template>
696 <xsl:template name="footer.navigation">
697 </xsl:template>
699 <!-- avoid creating multiple identical indices
700 if the stylesheets don't support filtered indices
702 <xsl:template match="index">
703 <xsl:variable name="has-filtered-index">
704 <xsl:call-template name="version-greater-or-equal">
705 <xsl:with-param name="ver1" select="$VERSION" />
706 <xsl:with-param name="ver2">1.66</xsl:with-param>
707 </xsl:call-template>
708 </xsl:variable>
709 <xsl:if test="($has-filtered-index = 1) or (count(@role) = 0)">
710 <xsl:apply-imports/>
711 </xsl:if>
712 </xsl:template>
714 <xsl:template match="index" mode="toc">
715 <xsl:variable name="has-filtered-index">
716 <xsl:call-template name="version-greater-or-equal">
717 <xsl:with-param name="ver1" select="$VERSION" />
718 <xsl:with-param name="ver2">1.66</xsl:with-param>
719 </xsl:call-template>
720 </xsl:variable>
721 <xsl:if test="($has-filtered-index = 1) or (count(@role) = 0)">
722 <xsl:apply-imports/>
723 </xsl:if>
724 </xsl:template>
726 <xsl:template match="para">
727 <xsl:choose>
728 <xsl:when test="@role = 'gallery'">
729 <div class="container">
730 <div class="gallery-spacer"> </div>
731 <xsl:apply-templates mode="gallery.mode"/>
732 <div class="gallery-spacer"> </div>
733 </div>
734 </xsl:when>
735 <xsl:otherwise>
736 <xsl:apply-imports/>
737 </xsl:otherwise>
738 </xsl:choose>
739 </xsl:template>
740 <!-- FIXME: try if that works too -->
741 <!--xsl:template match="para[@role='gallery']">
742 <div class="container">
743 <div class="gallery-spacer"> </div>
744 <xsl:apply-templates mode="gallery.mode"/>
745 <div class="gallery-spacer"> </div>
746 </div>
747 </xsl:template-->
751 <xsl:template match="link" mode="gallery.mode">
752 <div class="gallery-float">
753 <xsl:apply-templates select="."/>
754 </div>
755 </xsl:template>
757 <!-- add gallery handling to refnamediv template -->
758 <xsl:template match="refnamediv">
759 <div class="{name(.)}">
760 <table width="100%">
761 <tr><td valign="top">
762 <xsl:call-template name="anchor"/>
763 <xsl:choose>
764 <xsl:when test="$refentry.generate.name != 0">
765 <h2>
766 <xsl:call-template name="gentext">
767 <xsl:with-param name="key" select="'RefName'"/>
768 </xsl:call-template>
769 </h2>
770 </xsl:when>
771 <xsl:when test="$refentry.generate.title != 0">
772 <h2>
773 <xsl:choose>
774 <xsl:when test="../refmeta/refentrytitle">
775 <xsl:apply-templates select="../refmeta/refentrytitle"/>
776 </xsl:when>
777 <xsl:otherwise>
778 <xsl:apply-templates select="refname[1]"/>
779 </xsl:otherwise>
780 </xsl:choose>
781 </h2>
782 </xsl:when>
783 </xsl:choose>
785 <xsl:apply-templates/>
786 </p>
787 </td>
788 <td valign="top" align="right">
789 <xsl:choose>
790 <xsl:when test="../refmeta/refmiscinfo/inlinegraphic">
791 <xsl:apply-templates select="../refmeta/refmiscinfo/inlinegraphic"/>
792 </xsl:when>
793 <xsl:otherwise>
794 <!-- find the gallery image to use here
795 - determine the id of the enclosing refentry
796 - look for an inlinegraphic inside a link with linkend == refentryid inside a para with role == gallery
797 - use it here
799 <xsl:variable name="refentryid" select="../@id"/>
800 <xsl:apply-templates select="key('gallery.key', $refentryid)/inlinegraphic"/>
801 </xsl:otherwise>
802 </xsl:choose>
803 </td></tr>
804 </table>
805 </div>
806 </xsl:template>
808 <!-- add anchors for index sections -->
809 <xsl:template match="indexdiv">
810 <a><xsl:attribute name="name">idx<xsl:value-of select="./title"/></xsl:attribute></a>
811 <xsl:apply-templates/>
812 </xsl:template>
814 <!-- add anchors for glossary sections -->
815 <xsl:template match="glossdiv">
816 <a><xsl:attribute name="name">gls<xsl:value-of select="./title"/></xsl:attribute></a>
817 <xsl:apply-templates/>
818 </xsl:template>
820 <!-- Exterminate any trace of indexterms in the main flow -->
821 <xsl:template match="indexterm">
822 </xsl:template>
824 <!-- Extra link on the right side of doc-blobs -->
825 <xsl:template name="user.format.extralinks">
826 <xsl:if test="../ulink[@role='extralinks']">
827 <span class="extralinks">
828 <xsl:for-each select="../ulink[@role='extralinks']">
829 <xsl:if test="position() = 1">[&#160;</xsl:if>
830 <xsl:if test="position() > 1">&#160;|&#160;</xsl:if>
832 <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
833 <xsl:copy-of select="text()" />
834 </a>
835 <xsl:if test="position() = last()">&#160;]</xsl:if>
836 </xsl:for-each>
837 </span>
838 </xsl:if>
839 <!--xsl:copy-of select="text()" /-->
840 <xsl:apply-templates/>
841 </xsl:template>
843 <!-- this is not in use yet (see gtkdoc-mkdb
844 <xsl:template match="//refsect2/ulink[@role='extralinks']"/>
845 <xsl:template match="//refsect1/ulink[@role='extralinks']"/>
847 <xsl:template match="//refsect2/title">
848 <h3><xsl:call-template name="user.format.extralinks"/></h3>
849 </xsl:template>
851 <xsl:template match="//refsect1/title">
852 <h2><xsl:call-template name="user.format.extralinks"/></h2>
853 </xsl:template>
856 <!-- ==================================================================== -->
858 <xsl:template match="acronym">
859 <xsl:call-template name="generate.acronym.link"/>
860 </xsl:template>
862 <xsl:template name="generate.acronym.link">
863 <xsl:param name="acronym">
864 <xsl:apply-templates/>
865 </xsl:param>
866 <!--
867 We use for-each to change context to the database document because key()
868 only locates elements in the same document as the context node!
871 <xsl:param name="value" >
872 <xsl:value-of select="key('acronym.key', $acronym)/../glossdef/para[1]" />
873 </xsl:param>
874 <xsl:choose>
875 <xsl:when test="$value=''">
876 <!-- debug -->
877 <xsl:message>
878 In gtk-doc.xsl: For acronym (<xsl:value-of select="$acronym"/>) no value found!
879 </xsl:message>
881 <xsl:attribute name="href">
882 <xsl:text>http://foldoc.org/</xsl:text>
883 <xsl:value-of select="$acronym"/>
884 </xsl:attribute>
885 <xsl:call-template name="inline.charseq"/>
886 </a>
887 </xsl:when>
888 <xsl:otherwise>
889 <!-- found -->
890 <acronym>
891 <xsl:attribute name="title">
892 <xsl:value-of select="$value"/>
893 </xsl:attribute>
894 <xsl:call-template name="inline.charseq"/>
895 </acronym>
896 </xsl:otherwise>
897 </xsl:choose>
898 </xsl:template>
900 </xsl:stylesheet>