1 <?xml version="1.0" encoding="utf-8"?>
\r
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
\r
3 xmlns:str="http://exslt.org/strings">
\r
8 doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
\r
9 doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
\r
11 <xsl:param name="topdir" select="''"/>
\r
13 <xsl:template match="*" name="copy">
\r
15 <xsl:call-template name="copy-attributes"/>
\r
16 <xsl:apply-templates/>
\r
20 <xsl:template name="copy-attributes">
\r
21 <xsl:for-each select="@*">
\r
22 <xsl:attribute name="{name(current())}">
\r
24 <xsl:when test="contains(current(),'@TOPDIR@')">
\r
25 <xsl:value-of select="substring-before(current(),'@TOPDIR@')"/>
\r
26 <xsl:value-of select="$topdir"/>
\r
27 <xsl:value-of select="substring-after(current(),'@TOPDIR@')"/>
\r
30 <xsl:value-of select="current()"/>
\r
37 <!-- Replace @TOPDIR@ with relative top directory path -->
\r
39 <xsl:template match="@*[contains(current(),'@TOPDIR@')]">
\r
40 <xsl:value-of select="substring-before(current(),'@TOPDIR@')"/>
\r
41 <xsl:value-of select="$topdir"/>
\r
42 <xsl:value-of select="substring-after(current(),'@TOPDIR@')"/>
\r
45 <!-- Add 'class' attribute to some special paragraphs/lists -->
\r
47 <xsl:template name="add-class">
\r
48 <xsl:param name="class"/>
\r
50 <xsl:call-template name="copy-attributes"/>
\r
51 <xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute>
\r
52 <xsl:apply-templates/>
\r
56 <!-- Add '<br/>' tag after every ', ' -->
\r
57 <!-- This code is not very robust, it works with the doxygen output though -->
\r
59 <xsl:template name="break-comma">
\r
61 <xsl:call-template name="copy-attributes"/>
\r
62 <xsl:attribute name="class">commalist</xsl:attribute>
\r
63 <xsl:apply-templates mode="break-comma"/>
\r
67 <xsl:template match="text()[1]" mode="break-comma">
\r
68 <xsl:value-of select="current()"/><br/>
\r
71 <xsl:template match="*" mode="break-comma">
\r
72 <xsl:call-template name="copy"/>
\r
75 <xsl:template match="text()[contains(current(),' and') or contains(current(),'and ')]" mode="break-comma" priority="1">
\r
76 <xsl:value-of select="substring-before(current(),'and')"/>
\r
78 <xsl:value-of select="substring-after(current(),'and')"/>
\r
81 <xsl:template match="text()[contains(current(),',')]" mode="break-comma">
\r
82 <xsl:value-of select="substring-before(current(),',')"/>
\r
83 <xsl:text>,</xsl:text><br/>
\r
84 <xsl:value-of select="substring-after(current(),',')"/>
\r
87 <!-- ====================================================================== -->
\r
89 <!-- Hack Glossary menu highlight -->
\r
91 <xsl:template match="div[@class='tabs menu']/ul[1]">
\r
93 <xsl:when test="//h1[.//text()='Glossary']">
\r
94 <xsl:call-template name="add-class">
\r
95 <xsl:with-param name="class">glossary</xsl:with-param>
\r
96 </xsl:call-template>
\r
100 <xsl:call-template name="copy-attributes"/>
\r
101 <xsl:apply-templates/>
\r
107 <!-- Autogenerate table-of-contents for a page -->
\r
109 <xsl:template match="div[@id='autotoc']">
\r
111 <xsl:call-template name="copy-attributes"/>
\r
114 <xsl:for-each select="following::h2|following::h3|following::h4">
\r
115 <xsl:element name="li">
\r
116 <xsl:attribute name="class">
\r
117 <xsl:value-of select="concat('level_',local-name())"/>
\r
119 <b><xsl:call-template name="section-number"/><xsl:text> </xsl:text></b>
\r
120 <xsl:element name="a">
\r
122 <xsl:when test="a/@name">
\r
123 <xsl:attribute name="href">
\r
124 <xsl:value-of select="concat('#',a/@name)"/>
\r
128 <xsl:attribute name="href">
\r
129 <xsl:text>#autotoc-</xsl:text>
\r
130 <xsl:call-template name="section-number"/>
\r
134 <xsl:value-of select="string(current())"/>
\r
142 <xsl:template name="section-number">
\r
143 <xsl:number level="any" from="div[@id='autotoc']" count="h2"/>
\r
144 <xsl:text>.</xsl:text>
\r
145 <xsl:if test="self::h3|self::h4">
\r
146 <xsl:number level="any" from="h2" count="h3"/>
\r
147 <xsl:text>.</xsl:text>
\r
149 <xsl:if test="self::h4">
\r
150 <xsl:number level="any" from="h3" count="h4"/>
\r
151 <xsl:text>.</xsl:text>
\r
155 <xsl:template match="h2|h3|h4">
\r
157 <xsl:call-template name="copy-attributes"/>
\r
159 <xsl:when test="preceding::div[@id='autotoc']">
\r
160 <xsl:call-template name="section-number"/>
\r
161 <xsl:text> </xsl:text>
\r
163 <xsl:when test="a">
\r
164 <xsl:apply-templates/>
\r
167 <xsl:element name="a">
\r
168 <xsl:attribute name="class"><xsl:text>anchor</xsl:text></xsl:attribute>
\r
169 <xsl:attribute name="name">
\r
170 <xsl:text>autotoc-</xsl:text>
\r
171 <xsl:call-template name="section-number"/>
\r
173 <xsl:apply-templates/>
\r
179 <xsl:apply-templates/>
\r
185 <!-- Build dia image-map from special div/span elements -->
\r
186 <xsl:template match="div[@class='diamap']">
\r
187 <xsl:element name="map">
\r
188 <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
\r
189 <xsl:for-each select="span">
\r
191 <xsl:variable name="name" select="string(a[1])"/>
\r
192 <xsl:element name="area">
\r
193 <xsl:attribute name="shape">rect</xsl:attribute>
\r
194 <xsl:attribute name="alt"><xsl:value-of select="$name"/></xsl:attribute>
\r
195 <xsl:attribute name="title"><xsl:value-of select="$name"/></xsl:attribute>
\r
196 <xsl:attribute name="href"><xsl:value-of select="a[1]/@href"/></xsl:attribute>
\r
197 <xsl:attribute name="coords"><xsl:value-of select="@coords"/></xsl:attribute>
\r
204 <!-- Add grouping to all-members page -->
\r
206 <xsl:template match="table[preceding-sibling::h1[1][contains(text(),'Member List')]]">
\r
207 <table class="allmembers">
\r
208 <tr><td colspan="3"><h2>Public static member functions</h2></td></tr>
\r
209 <xsl:apply-templates select="tr[contains(td[3],'static')][not(contains(td[3],'protected'))][not(contains(td[3],'private'))][not(contains(td[3],'friend'))][str:split(substring-before(concat(td[2]/a,'<'),'<'),'::')[position()=last()]!=string(td[1]/a)][not(starts-with(td[1]/a,'~'))]"/>
\r
211 <tr><td colspan="3"><h2>Public member functions</h2></td></tr>
\r
212 <xsl:apply-templates select="tr[not(contains(td[1],'typedef'))][not(contains(td[3],'static'))][not(contains(td[3],'protected'))][not(contains(td[3],'private'))][not(contains(td[3],'friend'))][str:split(substring-before(concat(td[2]/a,'<'),'<'),'::')[position()=last()]!=string(td[1]/a)][not(starts-with(td[1]/a,'~'))][not(contains(td[3],'pure virtual'))]"/>
\r
214 <tr><td colspan="r"><h2>Public typedefs</h2></td></tr>
\r
215 <xsl:apply-templates select="tr[contains(td[1],'typedef')][not(contains(td[3],'protected'))][not(contains(td[3],'private'))][not(contains(td[3],'friend'))][str:split(substring-before(concat(td[2]/a,'<'),'<'),'::')[position()=last()]!=string(td[1]/a)][not(starts-with(td[1]/a,'~'))][not(contains(td[3],'pure virtual'))]"/>
\r
217 <tr><td colspan="3"><h2>Non-public members</h2></td></tr>
\r
218 <xsl:apply-templates select="tr[contains(td[3],'protected') or contains(td[3],'private') or contains(td[3],'friend')][str:split(substring-before(concat(td[2]/a,'<'),'<'),'::')[position()=last()]!=string(td[1]/a)][not(starts-with(td[1]/a,'~'))][not(contains(td[3],'pure virtual'))]"/>
\r
223 <xsl:template match="table[preceding-sibling::h1[1][contains(text(),'Member List')]]/tr/td[2]/a/text()[contains(.,'<')]">
\r
224 <xsl:value-of select="substring-before(.,'<')"/>
\r
227 <xsl:template match="table[preceding-sibling::h1[1][contains(text(),'Member List')]]/tr/td[1]/a/text()[contains(.,'::')]">
\r
228 <xsl:value-of select="str:split(.,'::')[position()=last()]"/>
\r
231 <!-- Remove the automatically inserted search form (we build our own) -->
\r
232 <xsl:template match="li[form]">
\r
235 <xsl:template match="table[preceding-sibling::*[1][self::div][@class='qindex']]">
\r
236 <xsl:call-template name="add-class">
\r
237 <xsl:with-param name="class">qindextable</xsl:with-param>
\r
238 </xsl:call-template>
\r
241 <xsl:template match="dl[dt/b/a/text()='Bug:']">
\r
242 <xsl:call-template name="add-class">
\r
243 <xsl:with-param name="class">xref-bug</xsl:with-param>
\r
244 </xsl:call-template>
\r
247 <xsl:template match="dl[dt/b/a/text()='Fix:']">
\r
248 <xsl:call-template name="add-class">
\r
249 <xsl:with-param name="class">xref-fix</xsl:with-param>
\r
250 </xsl:call-template>
\r
253 <xsl:template match="dl[dt/b/a/text()='Todo:']">
\r
254 <xsl:call-template name="add-class">
\r
255 <xsl:with-param name="class">xref-todo</xsl:with-param>
\r
256 </xsl:call-template>
\r
259 <xsl:template match="dl[dt/b/a/text()='Idea:']">
\r
260 <xsl:call-template name="add-class">
\r
261 <xsl:with-param name="class">xref-idea</xsl:with-param>
\r
262 </xsl:call-template>
\r
265 <xsl:template match="dl[dt/b/text()='Parameters:']|dl[dt/b/text()='Template Parameters:']">
\r
266 <xsl:call-template name="add-class">
\r
267 <xsl:with-param name="class">parameters</xsl:with-param>
\r
268 </xsl:call-template>
\r
271 <xsl:template match="dl[dt/b/text()='Implementation note:']">
\r
272 <xsl:call-template name="add-class">
\r
273 <xsl:with-param name="class">implementation</xsl:with-param>
\r
274 </xsl:call-template>
\r
277 <xsl:template match="table[descendant::td[@class='memItemLeft']]">
\r
278 <xsl:call-template name="add-class">
\r
279 <xsl:with-param name="class">members</xsl:with-param>
\r
280 </xsl:call-template>
\r
283 <xsl:template match="a[@href=string(current())]" priority="1">
\r
284 <xsl:call-template name="add-class">
\r
285 <xsl:with-param name="class">literal</xsl:with-param>
\r
286 </xsl:call-template>
\r
289 <xsl:template match="a[contains(@href,'http://')]">
\r
290 <xsl:call-template name="add-class">
\r
291 <xsl:with-param name="class">ext</xsl:with-param>
\r
292 </xsl:call-template>
\r
295 <xsl:template match="a[not(@href)]">
\r
296 <xsl:call-template name="add-class">
\r
297 <xsl:with-param name="class">anchor</xsl:with-param>
\r
298 </xsl:call-template>
\r
301 <xsl:template match="div[@class='memdoc']/p[1]">
\r
302 <xsl:call-template name="add-class">
\r
303 <xsl:with-param name="class">memtitle</xsl:with-param>
\r
304 </xsl:call-template>
\r
307 <xsl:template match="p[starts-with(text(),'Definition at line ')]">
\r
308 <xsl:call-template name="add-class">
\r
309 <xsl:with-param name="class">sourceline</xsl:with-param>
\r
310 </xsl:call-template>
\r
313 <xsl:template match="div[@class='memdoc']/p[starts-with(text(),'References ')]">
\r
314 <xsl:call-template name="add-class">
\r
315 <xsl:with-param name="class">references</xsl:with-param>
\r
316 </xsl:call-template>
\r
319 <xsl:template match="div[@class='memdoc']/p[starts-with(text(),'Referenced by ')]">
\r
320 <xsl:call-template name="add-class">
\r
321 <xsl:with-param name="class">referencedby</xsl:with-param>
\r
322 </xsl:call-template>
\r
325 <xsl:template match="div[@class='memdoc']/p[starts-with(text(),'Reimplemented from ')]">
\r
326 <xsl:call-template name="add-class">
\r
327 <xsl:with-param name="class">reimplementedfrom</xsl:with-param>
\r
328 </xsl:call-template>
\r
331 <xsl:template match="div[@class='memdoc']/p[starts-with(text(),'Reimplemented in ')]">
\r
332 <xsl:call-template name="add-class">
\r
333 <xsl:with-param name="class">reimplementedin</xsl:with-param>
\r
334 </xsl:call-template>
\r
337 <xsl:template match="div[@class='memdoc']/p[starts-with(text(),'Implemented in ')]">
\r
338 <xsl:call-template name="add-class">
\r
339 <xsl:with-param name="class">implementedin</xsl:with-param>
\r
340 </xsl:call-template>
\r
343 <xsl:template match="p[starts-with(text(),'Inherited by ')]">
\r
344 <xsl:call-template name="break-comma"/>
\r
347 <xsl:template match="p[starts-with(text(),'Inherits ')]">
\r
348 <xsl:call-template name="break-comma"/>
\r
351 <!-- Remove external items from the namespace index -->
\r
352 <xsl:template match="div[@id='content2']/table[contains(preceding-sibling::h1/text(),'Namespace Reference')]/tr[td[@class='memItemRight']/a[1][@class='elRef'][@doxygen]]">
\r
355 <!-- Remove [external] references from the modules page -->
\r
356 <xsl:template match="div[@id='content2']/ul/li[a/@class='elRef'][a/@doxygen][code/text()='[external]'][not(ul)]">
\r
359 <!-- Insert 'senf/' into include paths -->
\r
360 <xsl:template match="code[starts-with(text(),'#include <')]/a">
\r
362 <xsl:call-template name="copy-attributes"/>
\r
363 <xsl:text>senf/</xsl:text>
\r
364 <xsl:apply-templates/>
\r