release: update news and date in manual
[gtk-doc.git] / devhelp.xsl
blobb2364fcaabc4fa615725a92ba7538e150b00c5ce
1 <?xml version='1.0'?> <!--*- mode: xml -*-->
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 version='1.0'
4 xmlns="http://www.devhelp.net/book"
5 exclude-result-prefixes="#default">
7 <xsl:template name="generate.devhelp">
8 <xsl:call-template name="write.chunk">
9 <xsl:with-param name="filename">
10 <xsl:choose>
11 <xsl:when test="$gtkdoc.bookname">
12 <xsl:value-of select="$gtkdoc.bookname"/>
13 </xsl:when>
14 <xsl:otherwise>
15 <xsl:text>book</xsl:text>
16 </xsl:otherwise>
17 </xsl:choose>
18 <xsl:text>.devhelp</xsl:text>
19 </xsl:with-param>
20 <xsl:with-param name="method" select="'xml'"/>
21 <xsl:with-param name="indent" select="'yes'"/>
22 <xsl:with-param name="encoding" select="'utf-8'"/>
23 <xsl:with-param name="content">
24 <xsl:call-template name="devhelp"/>
25 </xsl:with-param>
26 </xsl:call-template>
27 </xsl:template>
29 <xsl:template name="devhelp">
30 <xsl:variable name="title">
31 <xsl:apply-templates select="." mode="generate.devhelp.toc.title.mode"/>
32 </xsl:variable>
33 <xsl:variable name="link">
34 <xsl:call-template name="href.target"/>
35 </xsl:variable>
36 <xsl:variable name="author">
37 <xsl:if test="articleinfo|bookinfo">
38 <xsl:apply-templates mode="generate.devhelp.authors"
39 select="articleinfo|bookinfo"/>
40 </xsl:if>
41 </xsl:variable>
42 <xsl:variable name="toc.nodes" select="part|reference|preface|chapter|
43 appendix|article|bibliography|
44 glossary|index|refentry|
45 bridgehead|sect1"/>
47 <book title="{$title}" link="{$link}" author="{$author}" name="{$gtkdoc.bookname}">
48 <xsl:if test="$toc.nodes">
49 <chapters>
50 <xsl:apply-templates select="$toc.nodes"
51 mode="generate.devhelp.toc.mode"/>
52 </chapters>
53 </xsl:if>
54 <functions>
55 <xsl:apply-templates select="$gtkdoc.refsect2"
56 mode="generate.devhelp.index.mode"/>
57 </functions>
58 </book>
59 </xsl:template>
61 <xsl:template match="*" mode="generate.devhelp.toc.mode">
62 <xsl:variable name="title">
63 <xsl:apply-templates select="." mode="generate.devhelp.toc.title.mode"/>
64 </xsl:variable>
65 <xsl:variable name="target">
66 <xsl:variable name="anchor" select="title/anchor"/>
67 <xsl:choose>
68 <xsl:when test="$anchor">
69 <xsl:call-template name="href.target">
70 <xsl:with-param name="object" select="$anchor"/>
71 </xsl:call-template>
72 </xsl:when>
73 <xsl:otherwise>
74 <xsl:call-template name="href.target"/>
75 </xsl:otherwise>
76 </xsl:choose>
77 </xsl:variable>
79 <sub name="{$title}" link="{$target}">
80 <xsl:apply-templates select="section|sect1|
81 refentry|refsect|
82 bridgehead|part|chapter|glossary|index"
83 mode="generate.devhelp.toc.mode"/>
84 </sub>
85 </xsl:template>
87 <xsl:template match="*" mode="generate.devhelp.index.mode">
88 <xsl:variable name="title" select="title"/>
89 <xsl:variable name="anchor" select="title/anchor"/>
90 <xsl:variable name="target">
91 <xsl:choose>
92 <xsl:when test="$anchor">
93 <xsl:call-template name="href.target">
94 <xsl:with-param name="object" select="$anchor"/>
95 </xsl:call-template>
96 </xsl:when>
97 <xsl:otherwise>
98 <xsl:call-template name="href.target"/>
99 </xsl:otherwise>
100 </xsl:choose>
101 </xsl:variable>
102 <function name="{$title}" link="{$target}"/>
103 </xsl:template>
105 <!-- get title -->
106 <xsl:template match="article" mode="generate.devhelp.toc.title.mode">
107 <xsl:value-of select="articleinfo/title"/>
108 </xsl:template>
109 <xsl:template match="book" mode="generate.devhelp.toc.title.mode">
110 <xsl:value-of select="bookinfo/title"/>
111 </xsl:template>
112 <xsl:template match="refentry" mode="generate.devhelp.toc.title.mode">
113 <xsl:value-of select="refmeta/refentrytitle"/>
114 </xsl:template>
115 <xsl:template match="*" mode="generate.devhelp.toc.title.mode">
116 <xsl:value-of select="title"/>
117 </xsl:template>
119 <!-- generate list of authors ... -->
120 <xsl:template match="articleinfo|bookinfo" mode="generate.devhelp.authors">
121 <xsl:for-each select="authorgroup/author">
122 <xsl:value-of select="firstname"/>
123 <xsl:text> </xsl:text>
124 <xsl:value-of select="surname"/>
125 <xsl:if test="not(last())">
126 <xsl:text>, </xsl:text>
127 </xsl:if>
128 </xsl:for-each>
129 </xsl:template>
131 </xsl:stylesheet>