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