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