1 <?xml version="1.0" encoding="utf-8"?>
\r
2 <xsl:stylesheet version="1.0"
\r
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
\r
4 xmlns:str="http://exslt.org/strings"
\r
5 extension-element-prefixes="str">
\r
10 doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
\r
11 doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
\r
13 <xsl:param name="topdir" select="''"/>
\r
15 <xsl:template match="*" name="copy">
\r
17 <xsl:call-template name="copy-attributes"/>
\r
18 <xsl:apply-templates/>
\r
22 <xsl:template name="copy-attributes">
\r
23 <xsl:for-each select="@*">
\r
24 <xsl:attribute name="{name(current())}">
\r
26 <xsl:when test="contains(current(),'@TOPDIR@')">
\r
27 <xsl:value-of select="substring-before(current(),'@TOPDIR@')"/>
\r
28 <xsl:value-of select="$topdir"/>
\r
29 <xsl:value-of select="substring-after(current(),'@TOPDIR@')"/>
\r
32 <xsl:value-of select="current()"/>
\r
39 <!-- Replace @TOPDIR@ with relative top directory path -->
\r
41 <xsl:template match="@*[contains(current(),'@TOPDIR@')]">
\r
42 <xsl:value-of select="substring-before(current(),'@TOPDIR@')"/>
\r
43 <xsl:value-of select="$topdir"/>
\r
44 <xsl:value-of select="substring-after(current(),'@TOPDIR@')"/>
\r
47 <!-- Add 'class' attribute to some special paragraphs/lists -->
\r
49 <xsl:template name="add-class">
\r
50 <xsl:param name="class"/>
\r
52 <xsl:call-template name="copy-attributes"/>
\r
53 <xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute>
\r
54 <xsl:apply-templates/>
\r
58 <!-- Add '<br/>' tag after every ', ' -->
\r
59 <!-- This code is not very robust, it works with the doxygen output though -->
\r
61 <xsl:template name="break-comma">
\r
63 <xsl:call-template name="copy-attributes"/>
\r
64 <xsl:attribute name="class">commalist</xsl:attribute>
\r
65 <xsl:apply-templates mode="break-comma"/>
\r
69 <xsl:template match="text()[1]" mode="break-comma">
\r
70 <xsl:value-of select="current()"/><br/>
\r
73 <xsl:template match="*" mode="break-comma">
\r
74 <xsl:call-template name="copy"/>
\r
77 <xsl:template match="text()[contains(current(),' and') or contains(current(),'and ')]" mode="break-comma" priority="1">
\r
78 <xsl:value-of select="substring-before(current(),'and')"/>
\r
80 <xsl:value-of select="substring-after(current(),'and')"/>
\r
83 <xsl:template match="text()[contains(current(),',')]" mode="break-comma">
\r
84 <xsl:value-of select="substring-before(current(),',')"/>
\r
85 <xsl:text>,</xsl:text><br/>
\r
86 <xsl:value-of select="substring-after(current(),',')"/>
\r
89 <!-- ====================================================================== -->
\r
91 <!-- Hack Glossary menu highlight -->
\r
93 <xsl:template match="div[@class='tabs menu']/ul[1]">
\r
95 <xsl:when test="//h1[.//text()='Glossary']">
\r
96 <xsl:call-template name="add-class">
\r
97 <xsl:with-param name="class">glossary</xsl:with-param>
\r
98 </xsl:call-template>
\r
102 <xsl:call-template name="copy-attributes"/>
\r
103 <xsl:apply-templates/>
\r
109 <!-- Autogenerate table-of-contents for a page -->
\r
111 <xsl:template match="div[@id='autotoc']">
\r
113 <xsl:call-template name="copy-attributes"/>
\r
116 <xsl:for-each select="following::h2|following::h3|following::h4">
\r
117 <xsl:element name="li">
\r
118 <xsl:attribute name="class">
\r
119 <xsl:value-of select="concat('level_',local-name())"/>
\r
121 <b><xsl:call-template name="section-number"/><xsl:text> </xsl:text></b>
\r
122 <xsl:element name="a">
\r
124 <xsl:when test="a/@name">
\r
125 <xsl:attribute name="href">
\r
126 <xsl:value-of select="concat('#',a/@name)"/>
\r
130 <xsl:attribute name="href">
\r
131 <xsl:text>#autotoc-</xsl:text>
\r
132 <xsl:call-template name="section-number"/>
\r
136 <xsl:value-of select="string(current())"/>
\r
144 <xsl:template name="section-number">
\r
145 <xsl:number level="any" from="div[@id='autotoc']" count="h2"/>
\r
146 <xsl:text>.</xsl:text>
\r
147 <xsl:if test="self::h3|self::h4">
\r
148 <xsl:number level="any" from="h2" count="h3"/>
\r
149 <xsl:text>.</xsl:text>
\r
151 <xsl:if test="self::h4">
\r
152 <xsl:number level="any" from="h3" count="h4"/>
\r
153 <xsl:text>.</xsl:text>
\r
157 <xsl:template match="h2|h3|h4">
\r
159 <xsl:call-template name="copy-attributes"/>
\r
161 <xsl:when test="preceding::div[@id='autotoc']">
\r
162 <xsl:call-template name="section-number"/>
\r
163 <xsl:text> </xsl:text>
\r
165 <xsl:when test="a">
\r
166 <xsl:apply-templates/>
\r
169 <xsl:element name="a">
\r
170 <xsl:attribute name="class"><xsl:text>anchor</xsl:text></xsl:attribute>
\r
171 <xsl:attribute name="name">
\r
172 <xsl:text>autotoc-</xsl:text>
\r
173 <xsl:call-template name="section-number"/>
\r
175 <xsl:apply-templates/>
\r
181 <xsl:apply-templates/>
\r
187 <!-- Build dia image-map from special div/span elements -->
\r
188 <xsl:template match="div[@class='diamap']">
\r
189 <xsl:element name="map">
\r
190 <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
\r
191 <xsl:for-each select="span">
\r
193 <xsl:variable name="name" select="string(a[1])"/>
\r
194 <xsl:element name="area">
\r
195 <xsl:attribute name="shape">rect</xsl:attribute>
\r
196 <xsl:attribute name="alt"><xsl:value-of select="$name"/></xsl:attribute>
\r
197 <xsl:attribute name="title"><xsl:value-of select="$name"/></xsl:attribute>
\r
198 <xsl:attribute name="href"><xsl:value-of select="a[1]/@href"/></xsl:attribute>
\r
199 <xsl:attribute name="coords"><xsl:value-of select="@coords"/></xsl:attribute>
\r
206 <!-- Add grouping to all-members page -->
\r
208 <xsl:template match="table[preceding-sibling::h1[1][contains(text(),'Member List')]]">
\r
209 <table class="allmembers">
\r
210 <tr><td colspan="3"><h2>Public static member functions</h2></td></tr>
\r
211 <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
213 <tr><td colspan="3"><h2>Public member functions</h2></td></tr>
\r
214 <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
216 <tr><td colspan="r"><h2>Public typedefs</h2></td></tr>
\r
217 <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
219 <tr><td colspan="3"><h2>Non-public members</h2></td></tr>
\r
220 <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
225 <xsl:template match="table[preceding-sibling::h1[1][contains(text(),'Member List')]]/tr/td[2]/a/text()[contains(.,'<')]">
\r
226 <xsl:value-of select="substring-before(.,'<')"/>
\r
229 <xsl:template match="table[preceding-sibling::h1[1][contains(text(),'Member List')]]/tr/td[1]/a/text()[contains(.,'::')]">
\r
230 <xsl:value-of select="str:split(.,'::')[position()=last()]"/>
\r
233 <!-- Remove the automatically inserted search form (we build our own) -->
\r
234 <xsl:template match="li[form]">
\r
237 <xsl:template match="table[preceding-sibling::*[1][self::div][@class='qindex']]">
\r
238 <xsl:call-template name="add-class">
\r
239 <xsl:with-param name="class">qindextable</xsl:with-param>
\r
240 </xsl:call-template>
\r
243 <xsl:template match="dl[dt/b/a/text()='Bug:']">
\r
244 <xsl:call-template name="add-class">
\r
245 <xsl:with-param name="class">xref-bug</xsl:with-param>
\r
246 </xsl:call-template>
\r
249 <xsl:template match="dl[dt/b/a/text()='Fix:']">
\r
250 <xsl:call-template name="add-class">
\r
251 <xsl:with-param name="class">xref-fix</xsl:with-param>
\r
252 </xsl:call-template>
\r
255 <xsl:template match="dl[dt/b/a/text()='Todo:']">
\r
256 <xsl:call-template name="add-class">
\r
257 <xsl:with-param name="class">xref-todo</xsl:with-param>
\r
258 </xsl:call-template>
\r
261 <xsl:template match="dl[dt/b/a/text()='Idea:']">
\r
262 <xsl:call-template name="add-class">
\r
263 <xsl:with-param name="class">xref-idea</xsl:with-param>
\r
264 </xsl:call-template>
\r
267 <xsl:template match="dl[dt/b/text()='Parameters:']|dl[dt/b/text()='Template Parameters:']">
\r
268 <xsl:call-template name="add-class">
\r
269 <xsl:with-param name="class">parameters</xsl:with-param>
\r
270 </xsl:call-template>
\r
273 <xsl:template match="dl[dt/b/text()='Implementation note:']">
\r
274 <xsl:call-template name="add-class">
\r
275 <xsl:with-param name="class">implementation</xsl:with-param>
\r
276 </xsl:call-template>
\r
279 <xsl:template match="table[descendant::td[@class='memItemLeft']]">
\r
280 <xsl:call-template name="add-class">
\r
281 <xsl:with-param name="class">members</xsl:with-param>
\r
282 </xsl:call-template>
\r
285 <xsl:template match="a[@href=string(current())]" priority="1">
\r
286 <xsl:call-template name="add-class">
\r
287 <xsl:with-param name="class">literal</xsl:with-param>
\r
288 </xsl:call-template>
\r
291 <xsl:template match="a[contains(@href,'http://')]">
\r
292 <xsl:call-template name="add-class">
\r
293 <xsl:with-param name="class">ext</xsl:with-param>
\r
294 </xsl:call-template>
\r
297 <xsl:template match="a[not(@href)]">
\r
298 <xsl:call-template name="add-class">
\r
299 <xsl:with-param name="class">anchor</xsl:with-param>
\r
300 </xsl:call-template>
\r
303 <xsl:template match="div[@class='memdoc']/p[1]">
\r
304 <xsl:call-template name="add-class">
\r
305 <xsl:with-param name="class">memtitle</xsl:with-param>
\r
306 </xsl:call-template>
\r
309 <xsl:template match="p[starts-with(text(),'Definition at line ')]">
\r
310 <xsl:call-template name="add-class">
\r
311 <xsl:with-param name="class">sourceline</xsl:with-param>
\r
312 </xsl:call-template>
\r
315 <xsl:template match="div[@class='memdoc']/p[starts-with(text(),'References ')]">
\r
316 <xsl:call-template name="add-class">
\r
317 <xsl:with-param name="class">references</xsl:with-param>
\r
318 </xsl:call-template>
\r
321 <xsl:template match="div[@class='memdoc']/p[starts-with(text(),'Referenced by ')]">
\r
322 <xsl:call-template name="add-class">
\r
323 <xsl:with-param name="class">referencedby</xsl:with-param>
\r
324 </xsl:call-template>
\r
327 <xsl:template match="div[@class='memdoc']/p[starts-with(text(),'Reimplemented from ')]">
\r
328 <xsl:call-template name="add-class">
\r
329 <xsl:with-param name="class">reimplementedfrom</xsl:with-param>
\r
330 </xsl:call-template>
\r
333 <xsl:template match="div[@class='memdoc']/p[starts-with(text(),'Reimplemented in ')]">
\r
334 <xsl:call-template name="add-class">
\r
335 <xsl:with-param name="class">reimplementedin</xsl:with-param>
\r
336 </xsl:call-template>
\r
339 <xsl:template match="div[@class='memdoc']/p[starts-with(text(),'Implemented in ')]">
\r
340 <xsl:call-template name="add-class">
\r
341 <xsl:with-param name="class">implementedin</xsl:with-param>
\r
342 </xsl:call-template>
\r
345 <xsl:template match="p[starts-with(text(),'Inherited by ')]">
\r
346 <xsl:call-template name="break-comma"/>
\r
349 <xsl:template match="p[starts-with(text(),'Inherits ')]">
\r
350 <xsl:call-template name="break-comma"/>
\r
353 <!-- Remove external items from the namespace index -->
\r
354 <xsl:template match="div[@id='content2']/table[contains(preceding-sibling::h1/text(),'Namespace Reference')]/tr[td[@class='memItemRight']/a[1][@class='elRef'][@doxygen]]">
\r
357 <!-- Remove [external] references from the modules page -->
\r
358 <xsl:template match="div[@id='content2']/ul/li[a/@class='elRef'][a/@doxygen][code/text()='[external]'][not(ul)]">
\r
361 <!-- Insert 'senf/' into include paths -->
\r
362 <xsl:template match="code[starts-with(text(),'#include <')]/a">
\r
364 <xsl:call-template name="copy-attributes"/>
\r
365 <xsl:text>senf/</xsl:text>
\r
366 <xsl:apply-templates/>
\r