mkman: fix command invocation.
[gtk-doc.git] / gtk-doc.xsl
blob5c90dc2a1a5675bc5a5e7f22574eb922dfa97501
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 whether 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 <!-- @bug: https://bugzilla.gnome.org/show_bug.cgi?id=617478 -->
183 <xsl:template name="generate.html.title"/>
184 <!--xsl:template name="generate.html.title">
185 <xsl:variable name="has.title.markup">
186 <xsl:apply-templates select="." mode="title.markup">
187 <xsl:with-param name="verbose" select="0"/>
188 </xsl:apply-templates>
189 </xsl:variable>
190 <xsl:if test="$has.title.markup != '???TITLE???'">
191 <xsl:variable name="gentext.title">
192 <xsl:apply-templates select="." mode="object.title.markup.textonly"/>
193 </xsl:variable>
194 <xsl:choose>
195 <xsl:when test="string-length($gentext.title) != 0">
196 <xsl:attribute name="title">
197 <xsl:value-of select="$gentext.title"/>
198 </xsl:attribute>
199 </xsl:when>
200 <xsl:when test="alt">
201 <xsl:attribute name="title">
202 <xsl:value-of select="normalize-space(alt)"/>
203 </xsl:attribute>
204 </xsl:when>
205 </xsl:choose>
206 </xsl:if>
207 </xsl:template-->
209 <!-- Generate a title attribute for the context node (e.g. links) -->
210 <xsl:template match="*" mode="html.title.attribute">
211 <xsl:variable name="has.title.markup">
212 <xsl:apply-templates select="." mode="title.markup">
213 <xsl:with-param name="verbose" select="0"/>
214 </xsl:apply-templates>
215 </xsl:variable>
216 <xsl:if test="$has.title.markup != '???TITLE???'">
217 <xsl:variable name="is.title">
218 <xsl:call-template name="gentext.template.exists">
219 <xsl:with-param name="context" select="'title'"/>
220 <xsl:with-param name="name" select="local-name(.)"/>
221 <xsl:with-param name="lang">
222 <xsl:call-template name="l10n.language"/>
223 </xsl:with-param>
224 </xsl:call-template>
225 </xsl:variable>
227 <xsl:variable name="is.title-numbered">
228 <xsl:if test="$is.title = 0">
229 <xsl:call-template name="gentext.template.exists">
230 <xsl:with-param name="context" select="'title-numbered'"/>
231 <xsl:with-param name="name" select="local-name(.)"/>
232 <xsl:with-param name="lang">
233 <xsl:call-template name="l10n.language"/>
234 </xsl:with-param>
235 </xsl:call-template>
236 </xsl:if>
237 </xsl:variable>
240 <xsl:variable name="is.title-unnumbered">
241 <xsl:if test="$is.title = 0 and $is.title-numbered = 0">
242 <xsl:call-template name="gentext.template.exists">
243 <xsl:with-param name="context" select="'title-unnumbered'"/>
244 <xsl:with-param name="name" select="local-name(.)"/>
245 <xsl:with-param name="lang">
246 <xsl:call-template name="l10n.language"/>
247 </xsl:with-param>
248 </xsl:call-template>
249 </xsl:if>
250 </xsl:variable>
252 <xsl:variable name="gentext.title">
253 <xsl:if test="$is.title != 0 or
254 $is.title-numbered != 0 or
255 $is.title-unnumbered != 0">
256 <xsl:apply-templates select="."
257 mode="object.title.markup.textonly"/>
258 </xsl:if>
259 </xsl:variable>
261 <xsl:choose>
262 <xsl:when test="string-length($gentext.title) != 0">
263 <xsl:attribute name="title">
264 <xsl:value-of select="$gentext.title"/>
265 </xsl:attribute>
266 </xsl:when>
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>
279 <!-- ========================================================= -->
280 <!-- template to create the index.sgml anchor index -->
282 <xsl:param name="gtkdoc.refsect2" select="//refsect2" />
284 <xsl:template match="book|article">
285 <xsl:variable name="tooldver">
286 <xsl:call-template name="version-greater-or-equal">
287 <xsl:with-param name="ver1" select="$VERSION" />
288 <xsl:with-param name="ver2">1.36</xsl:with-param>
289 </xsl:call-template>
290 </xsl:variable>
291 <xsl:if test="$tooldver = 0">
292 <xsl:message terminate="yes">
293 FATAL-ERROR: You need the DocBook XSL Stylesheets version 1.36 or higher
294 to build the documentation.
295 Get a newer version at http://docbook.sourceforge.net/projects/xsl/
296 </xsl:message>
297 </xsl:if>
298 <xsl:apply-imports/>
300 <!-- generate the index.sgml href index -->
301 <xsl:call-template name="generate.index"/>
302 <!-- generate $book.devhelp{2} -->
303 <xsl:call-template name="generate.devhelp"/>
304 <xsl:call-template name="generate.devhelp2"/>
305 </xsl:template>
307 <xsl:template name="generate.index">
308 <xsl:call-template name="write.text.chunk">
309 <xsl:with-param name="filename" select="'index.sgml'"/>
310 <xsl:with-param name="content">
311 <xsl:apply-templates select="/book/bookinfo/releaseinfo/ulink"
312 mode="generate.index.mode"/>
313 <!-- check all anchor and refentry elements -->
314 <xsl:apply-templates select="//anchor|//refentry|//refsect1|$gtkdoc.refsect2|//refsynopsisdiv|//varlistentry"
315 mode="generate.index.mode"/>
316 </xsl:with-param>
317 <xsl:with-param name="default.encoding" select="'UTF-8'"/>
318 <xsl:with-param name="chunker.output.indent" select="'no'"/>
319 </xsl:call-template>
320 </xsl:template>
322 <xsl:template match="*" mode="generate.index.mode">
323 <xsl:if test="not(@href) and count(@id) > 0">
324 <xsl:text>&lt;ANCHOR id=&quot;</xsl:text>
325 <xsl:value-of select="@id"/>
326 <xsl:text>&quot; href=&quot;</xsl:text>
327 <xsl:if test="$gtkdoc.bookname">
328 <xsl:value-of select="$gtkdoc.bookname"/>
329 <xsl:text>/</xsl:text>
330 </xsl:if>
331 <xsl:call-template name="href.target"/>
332 <xsl:text>&quot;&gt;&#10;</xsl:text>
333 </xsl:if>
334 </xsl:template>
336 <xsl:template match="/book/bookinfo/releaseinfo/ulink" mode="generate.index.mode">
337 <xsl:if test="@role='online-location'">
338 <xsl:text>&lt;ONLINE href=&quot;</xsl:text>
339 <xsl:value-of select="@url"/>
340 <xsl:text>&quot;&gt;&#10;</xsl:text>
341 </xsl:if>
342 </xsl:template>
344 <!-- ========================================================= -->
345 <!-- template to output gtkdoclink elements for the unknown targets -->
347 <xsl:template match="link">
348 <xsl:choose>
349 <xsl:when test="id(@linkend)">
350 <xsl:apply-imports/>
351 </xsl:when>
352 <xsl:otherwise>
353 <GTKDOCLINK HREF="{@linkend}">
354 <xsl:apply-templates/>
355 </GTKDOCLINK>
356 </xsl:otherwise>
357 </xsl:choose>
358 </xsl:template>
360 <!-- ========================================================= -->
361 <!-- Below are the visual portions of the stylesheet. They provide
362 the normal gtk-doc output style. -->
364 <xsl:param name="shade.verbatim" select="0"/>
365 <xsl:param name="refentry.separator" select="0"/>
367 <xsl:template match="refsect2">
368 <xsl:if test="preceding-sibling::refsect2">
369 <hr/>
370 </xsl:if>
371 <xsl:apply-imports/>
372 </xsl:template>
374 <xsl:template name="user.head.content">
375 <xsl:if test="$gtkdoc.version">
376 <meta name="generator" content="GTK-Doc V{$gtkdoc.version} (XML mode)"/>
377 </xsl:if>
378 <link rel="stylesheet" href="style.css" type="text/css"/>
379 </xsl:template>
381 <xsl:template name="user.footer.content">
382 <div class="footer">
383 <hr />
384 <xsl:choose>
385 <xsl:when test="$gtkdoc.version">
386 Generated by GTK-Doc V<xsl:copy-of select="$gtkdoc.version" />
387 </xsl:when>
388 <xsl:otherwise>
389 Generated by GTK-Doc
390 </xsl:otherwise>
391 </xsl:choose>
392 </div>
393 </xsl:template>
395 <xsl:template match="title" mode="book.titlepage.recto.mode">
396 <table class="navigation" id="top" width="100%"
397 cellpadding="2" cellspacing="0">
398 <tr>
399 <th valign="middle">
400 <p class="{name(.)}">
401 <xsl:value-of select="."/>
402 </p>
403 </th>
404 </tr>
405 </table>
406 </xsl:template>
408 <xsl:template name="header.navigation">
409 <xsl:param name="prev" select="/foo"/>
410 <xsl:param name="next" select="/foo"/>
411 <xsl:variable name="home" select="/*[1]"/>
412 <xsl:variable name="up" select="parent::*"/>
413 <xsl:variable name="refsections" select="./refsect1[@role]"/>
414 <xsl:variable name="glssections" select="./glossdiv/title"/>
415 <xsl:variable name="idxsections" select="./indexdiv/indexdiv/title"/>
416 <xsl:variable name="section_id" select="./@id"/>
417 <xsl:variable name="sect_object_hierarchy" select="./refsect1[@role='object_hierarchy']"/>
418 <xsl:variable name="sect_impl_interfaces" select="./refsect1[@role='impl_interfaces']"/>
419 <xsl:variable name="sect_prerequisites" select="./refsect1[@role='prerequisites']"/>
420 <xsl:variable name="sect_derived_interfaces" select="./refsect1[@role='derived_interfaces']"/>
421 <xsl:variable name="sect_implementations" select="./refsect1[@role='implementations']"/>
422 <xsl:variable name="sect_properties" select="./refsect1[@role='properties']"/>
423 <xsl:variable name="sect_child_properties" select="./refsect1[@role='child_properties']"/>
424 <xsl:variable name="sect_style_properties" select="./refsect1[@role='style_properties']"/>
425 <xsl:variable name="sect_signal_proto" select="./refsect1[@role='signal_proto']"/>
426 <xsl:variable name="sect_desc" select="./refsect1[@role='desc']"/>
427 <xsl:variable name="sect_synopsis" select="./refsynopsisdiv[@role='synopsis']"/>
428 <!--
429 <xsl:variable name="sect_details" select="./refsect1[@id='details']"/>
430 <xsl:variable name="sect_property_details" select="./refsect1[@id='property_details']"/>
431 <xsl:variable name="sect_child_property_details" select="./refsect1[@id='child_property_details']"/>
432 <xsl:variable name="sect_style_property_details" select="./refsect1[@id='style_property_details']"/>
433 <xsl:variable name="sect_signals" select="./refsect1[@id='signals']"/>
436 <xsl:if test="$suppress.navigation = '0' and $home != .">
437 <table class="navigation" id="top" width="100%"
438 summary = "Navigation header" cellpadding="2" cellspacing="2">
439 <tr valign="middle">
440 <xsl:choose>
441 <xsl:when test="count($prev) > 0">
442 <td>
443 <a accesskey="p">
444 <xsl:attribute name="href">
445 <xsl:call-template name="href.target">
446 <xsl:with-param name="object" select="$prev"/>
447 </xsl:call-template>
448 </xsl:attribute>
449 <img src="left.png" width="24" height="24" border="0">
450 <xsl:attribute name="alt">
451 <xsl:call-template name="gentext">
452 <xsl:with-param name="key">nav-prev</xsl:with-param>
453 </xsl:call-template>
454 </xsl:attribute>
455 </img>
456 </a>
457 </td>
458 </xsl:when>
459 <xsl:otherwise>
460 <td>&#160;</td>
461 </xsl:otherwise>
462 </xsl:choose>
463 <xsl:choose>
464 <xsl:when test="count($up) > 0 and $up != $home">
465 <td>
466 <a accesskey="u">
467 <xsl:attribute name="href">
468 <xsl:call-template name="href.target">
469 <xsl:with-param name="object" select="$up"/>
470 </xsl:call-template>
471 </xsl:attribute>
472 <img src="up.png" width="24" height="24" border="0">
473 <xsl:attribute name="alt">
474 <xsl:call-template name="gentext">
475 <xsl:with-param name="key">nav-up</xsl:with-param>
476 </xsl:call-template>
477 </xsl:attribute>
478 </img>
479 </a>
480 </td>
481 </xsl:when>
482 <xsl:otherwise>
483 <td>&#160;</td>
484 </xsl:otherwise>
485 </xsl:choose>
486 <xsl:choose>
487 <xsl:when test="$home != .">
488 <td>
489 <a accesskey="h">
490 <xsl:attribute name="href">
491 <xsl:call-template name="href.target">
492 <xsl:with-param name="object" select="$home"/>
493 </xsl:call-template>
494 </xsl:attribute>
495 <img src="home.png" width="24" height="24" border="0">
496 <xsl:attribute name="alt">
497 <xsl:call-template name="gentext">
498 <xsl:with-param name="key">nav-home</xsl:with-param>
499 </xsl:call-template>
500 </xsl:attribute>
501 </img>
502 </a>
503 </td>
504 </xsl:when>
505 <xsl:otherwise>
506 <td>&#160;</td>
507 </xsl:otherwise>
508 </xsl:choose>
509 <th width="100%" align="center">
510 <xsl:apply-templates select="$home" mode="object.title.markup"/>
511 </th>
512 <xsl:choose>
513 <xsl:when test="count($next) > 0">
514 <td>
515 <a accesskey="n">
516 <xsl:attribute name="href">
517 <xsl:call-template name="href.target">
518 <xsl:with-param name="object" select="$next"/>
519 </xsl:call-template>
520 </xsl:attribute>
521 <img src="right.png" width="24" height="24" border="0">
522 <xsl:attribute name="alt">
523 <xsl:call-template name="gentext">
524 <xsl:with-param name="key">nav-next</xsl:with-param>
525 </xsl:call-template>
526 </xsl:attribute>
527 </img>
528 </a>
529 </td>
530 </xsl:when>
531 <xsl:otherwise>
532 <td>&#160;</td>
533 </xsl:otherwise>
534 </xsl:choose>
535 </tr>
536 <!--<xsl:if test="name()='refentry'"-->
537 <xsl:choose>
538 <xsl:when test="count($refsections) > 0">
539 <tr>
540 <td colspan="5" class="shortcuts">
541 <xsl:if test="count($sect_synopsis) > 0">
542 <a href="#{$section_id}.synopsis" class="shortcut">Top</a>
543 </xsl:if>
544 <xsl:if test="count($sect_desc) > 0">
545 &#160;|&#160;
546 <a href="#{$section_id}.description" class="shortcut">
547 <xsl:value-of select="./refsect1[@role='desc']/title"/>
548 </a>
549 </xsl:if>
550 <xsl:if test="count($sect_object_hierarchy) > 0">
551 &#160;|&#160;
552 <a href="#{$section_id}.object-hierarchy" class="shortcut">
553 <xsl:value-of select="./refsect1[@role='object_hierarchy']/title"/>
554 </a>
555 </xsl:if>
556 <xsl:if test="count($sect_impl_interfaces) > 0">
557 &#160;|&#160;
558 <a href="#{$section_id}.implemented-interfaces" class="shortcut">
559 <xsl:value-of select="./refsect1[@role='impl_interfaces']/title"/>
560 </a>
561 </xsl:if>
562 <xsl:if test="count($sect_prerequisites) > 0">
563 &#160;|&#160;
564 <a href="#{$section_id}.prerequisites" class="shortcut">
565 <xsl:value-of select="./refsect1[@role='prerequisites']/title"/>
566 </a>
567 </xsl:if>
568 <xsl:if test="count($sect_derived_interfaces) > 0">
569 &#160;|&#160;
570 <a href="#{$section_id}.derived-interfaces" class="shortcut">
571 <xsl:value-of select="./refsect1[@role='derived_interfaces']/title"/>
572 </a>
573 </xsl:if>
574 <xsl:if test="count($sect_implementations) > 0">
575 &#160;|&#160;
576 <a href="#{$section_id}.implementations" class="shortcut">
577 <xsl:value-of select="./refsect1[@role='implementations']/title"/>
578 </a>
579 </xsl:if>
580 <xsl:if test="count($sect_properties) > 0">
581 &#160;|&#160;
582 <a href="#{$section_id}.properties" class="shortcut">
583 <xsl:value-of select="./refsect1[@role='properties']/title"/>
584 </a>
585 </xsl:if>
586 <xsl:if test="count($sect_child_properties) > 0">
587 &#160;|&#160;
588 <a href="#{$section_id}.child-properties" class="shortcut">
589 <xsl:value-of select="./refsect1[@role='child_properties']/title"/>
590 </a>
591 </xsl:if>
592 <xsl:if test="count($sect_style_properties) > 0">
593 &#160;|&#160;
594 <a href="#{$section_id}.style-properties" class="shortcut">
595 <xsl:value-of select="./refsect1[@role='style_properties']/title"/>
596 </a>
597 </xsl:if>
598 <xsl:if test="count($sect_signal_proto) > 0">
599 &#160;|&#160;
600 <a href="#{$section_id}.signals" class="shortcut">
601 <xsl:value-of select="./refsect1[@role='signal_proto']/title"/>
602 </a>
603 </xsl:if>
604 <!--
605 <xsl:if test="count($sect_details) > 0">
606 <a href="#details" class="shortcut">
607 <xsl:value-of select="./refsect1[@id='details']/title"/>
608 </a>
609 &#160;|&#160;
610 </xsl:if>
611 <xsl:if test="count($sect_property_details) > 0">
612 <a href="#property_details" class="shortcut">
613 <xsl:value-of select="./refsect1[@id='property_details']/title"/>
614 </a>
615 &#160;|&#160;
616 </xsl:if>
617 <xsl:if test="count($sect_child_property_details) > 0">
618 <a href="#child_property_details" class="shortcut">
619 <xsl:value-of select="./refsect1[@id='property_child_details']/title"/>
620 </a>
621 &#160;|&#160;
622 </xsl:if>
623 <xsl:if test="count($sect_style_property_details) > 0">
624 <a href="#style_property_details" class="shortcut">
625 <xsl:value-of select="./refsect1[@id='style_property_details']/title"/>
626 </a>
627 &#160;|&#160;
628 </xsl:if>
629 <xsl:if test="count($sect_signals) > 0">
630 <a href="#signals" class="shortcut">
631 <xsl:value-of select="./refsect1[@id='signals']/title"/>
632 </a>
633 &#160;|&#160;
634 </xsl:if>
636 </td>
637 </tr>
638 </xsl:when>
639 <!-- this is not yet very nice, as it requires all glossdic/indexdiv
640 elements having a anchor element. maybe we can customize the xsl
641 to automaticaly create local anchors
643 <xsl:when test="count($glssections) > 0">
644 <tr>
645 <td colspan="5" class="shortcuts">
646 <xsl:for-each select="./glossdiv">
647 <xsl:if test="position() > 1">
648 &#160;|&#160;
649 </xsl:if>
650 <a class="shortcut">
651 <xsl:attribute name="href">#gls<xsl:value-of select="./title"/></xsl:attribute>
652 <xsl:value-of select="./title"/>
653 </a>
654 </xsl:for-each>
655 </td>
656 </tr>
657 </xsl:when>
658 <xsl:when test="count($idxsections) > 0">
659 <tr>
660 <td colspan="5" class="shortcuts">
661 <xsl:for-each select="./indexdiv/indexdiv">
662 <xsl:if test="position() > 1">
663 &#160;|&#160;
664 </xsl:if>
665 <a class="shortcut">
666 <xsl:attribute name="href">#idx<xsl:value-of select="./title"/></xsl:attribute>
667 <xsl:value-of select="./title"/>
668 </a>
669 </xsl:for-each>
670 </td>
671 </tr>
672 </xsl:when>
673 </xsl:choose>
674 </table>
675 </xsl:if>
676 </xsl:template>
678 <xsl:template name="footer.navigation">
679 </xsl:template>
681 <!-- avoid creating multiple identical indices
682 if the stylesheets don't support filtered indices
684 <xsl:template match="index">
685 <xsl:variable name="has-filtered-index">
686 <xsl:call-template name="version-greater-or-equal">
687 <xsl:with-param name="ver1" select="$VERSION" />
688 <xsl:with-param name="ver2">1.66</xsl:with-param>
689 </xsl:call-template>
690 </xsl:variable>
691 <xsl:if test="($has-filtered-index = 1) or (count(@role) = 0)">
692 <xsl:apply-imports/>
693 </xsl:if>
694 </xsl:template>
696 <xsl:template match="index" mode="toc">
697 <xsl:variable name="has-filtered-index">
698 <xsl:call-template name="version-greater-or-equal">
699 <xsl:with-param name="ver1" select="$VERSION" />
700 <xsl:with-param name="ver2">1.66</xsl:with-param>
701 </xsl:call-template>
702 </xsl:variable>
703 <xsl:if test="($has-filtered-index = 1) or (count(@role) = 0)">
704 <xsl:apply-imports/>
705 </xsl:if>
706 </xsl:template>
708 <xsl:template match="para">
709 <xsl:choose>
710 <xsl:when test="@role = 'gallery'">
711 <div class="container">
712 <div class="gallery-spacer"> </div>
713 <xsl:apply-templates mode="gallery.mode"/>
714 <div class="gallery-spacer"> </div>
715 </div>
716 </xsl:when>
717 <xsl:otherwise>
718 <xsl:apply-imports/>
719 </xsl:otherwise>
720 </xsl:choose>
721 </xsl:template>
722 <!-- FIXME: try if that works too -->
723 <!--xsl:template match="para[@role='gallery']">
724 <div class="container">
725 <div class="gallery-spacer"> </div>
726 <xsl:apply-templates mode="gallery.mode"/>
727 <div class="gallery-spacer"> </div>
728 </div>
729 </xsl:template-->
733 <xsl:template match="link" mode="gallery.mode">
734 <div class="gallery-float">
735 <xsl:apply-templates select="."/>
736 </div>
737 </xsl:template>
739 <!-- add gallery handling to refnamediv template -->
740 <xsl:template match="refnamediv">
741 <div class="{name(.)}">
742 <table width="100%">
743 <tr><td valign="top">
744 <xsl:call-template name="anchor"/>
745 <xsl:choose>
746 <xsl:when test="$refentry.generate.name != 0">
747 <h2>
748 <xsl:call-template name="gentext">
749 <xsl:with-param name="key" select="'RefName'"/>
750 </xsl:call-template>
751 </h2>
752 </xsl:when>
753 <xsl:when test="$refentry.generate.title != 0">
754 <h2>
755 <xsl:choose>
756 <xsl:when test="../refmeta/refentrytitle">
757 <xsl:apply-templates select="../refmeta/refentrytitle"/>
758 </xsl:when>
759 <xsl:otherwise>
760 <xsl:apply-templates select="refname[1]"/>
761 </xsl:otherwise>
762 </xsl:choose>
763 </h2>
764 </xsl:when>
765 </xsl:choose>
767 <xsl:apply-templates/>
768 </p>
769 </td>
770 <td valign="top" align="right">
771 <xsl:choose>
772 <xsl:when test="../refmeta/refmiscinfo/inlinegraphic">
773 <xsl:apply-templates select="../refmeta/refmiscinfo/inlinegraphic"/>
774 </xsl:when>
775 <xsl:otherwise>
776 <!-- find the gallery image to use here
777 - determine the id of the enclosing refentry
778 - look for an inlinegraphic inside a link with linkend == refentryid inside a para with role == gallery
779 - use it here
781 <xsl:variable name="refentryid" select="../@id"/>
782 <xsl:apply-templates select="//para[@role = 'gallery']/link[@linkend = $refentryid]/inlinegraphic"/>
783 </xsl:otherwise>
784 </xsl:choose>
785 </td></tr>
786 </table>
787 </div>
788 </xsl:template>
790 <!-- add anchors for index sections -->
791 <xsl:template match="indexdiv">
792 <a><xsl:attribute name="name">idx<xsl:value-of select="./title"/></xsl:attribute></a>
793 <xsl:apply-templates/>
794 </xsl:template>
796 <!-- add anchors for glossary sections -->
797 <xsl:template match="glossdiv">
798 <a><xsl:attribute name="name">gls<xsl:value-of select="./title"/></xsl:attribute></a>
799 <xsl:apply-templates/>
800 </xsl:template>
802 <!-- Exterminate any trace of indexterms in the main flow -->
803 <xsl:template match="indexterm">
804 </xsl:template>
806 <!-- Extra link on the right side of doc-blobs -->
807 <xsl:template name="user.format.extralinks">
808 <xsl:if test="../ulink[@role='extralinks']">
809 <span class="extralinks">
810 <xsl:for-each select="../ulink[@role='extralinks']">
811 <xsl:if test="position() = 1">[&#160;</xsl:if>
812 <xsl:if test="position() > 1">&#160;|&#160;</xsl:if>
814 <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
815 <xsl:copy-of select="text()" />
816 </a>
817 <xsl:if test="position() = last()">&#160;]</xsl:if>
818 </xsl:for-each>
819 </span>
820 </xsl:if>
821 <!--xsl:copy-of select="text()" /-->
822 <xsl:apply-templates/>
823 </xsl:template>
825 <!-- this is not in use yet (see gtkdoc-mkdb
826 <xsl:template match="//refsect2/ulink[@role='extralinks']"/>
827 <xsl:template match="//refsect1/ulink[@role='extralinks']"/>
829 <xsl:template match="//refsect2/title">
830 <h3><xsl:call-template name="user.format.extralinks"/></h3>
831 </xsl:template>
833 <xsl:template match="//refsect1/title">
834 <h2><xsl:call-template name="user.format.extralinks"/></h2>
835 </xsl:template>
838 <!-- ==================================================================== -->
840 <xsl:template match="acronym">
841 <xsl:call-template name="generate.acronym.link"/>
842 </xsl:template>
844 <xsl:template name="generate.acronym.link">
845 <xsl:param name="acronym">
846 <xsl:apply-templates/>
847 </xsl:param>
848 <!--
849 We use for-each to change context to the database document because key()
850 only locates elements in the same document as the context node!
853 <xsl:param name="value" >
854 <xsl:value-of select="//glossentry/glossterm[text()=$acronym]/../glossdef/para[1]" />
855 </xsl:param>
856 <xsl:choose>
857 <xsl:when test="$value=''">
858 <!-- debug -->
859 <xsl:message>
860 In gtk-doc.xsl: For acronym (<xsl:value-of select="$acronym"/>) no value found!
861 </xsl:message>
863 <xsl:attribute name="href">
864 <xsl:text>http://foldoc.org/</xsl:text>
865 <xsl:value-of select="$acronym"/>
866 </xsl:attribute>
867 <xsl:call-template name="inline.charseq"/>
868 </a>
869 </xsl:when>
870 <xsl:otherwise>
871 <!-- found -->
872 <acronym>
873 <xsl:attribute name="title">
874 <xsl:value-of select="$value"/>
875 </xsl:attribute>
876 <xsl:call-template name="inline.charseq"/>
877 </acronym>
878 </xsl:otherwise>
879 </xsl:choose>
880 </xsl:template>
882 </xsl:stylesheet>