Packets: Really fix WLANPacket desaster
[senf.git] / doclib / html-munge.xsl
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
6 \r
7   <xsl:output \r
8     method="html" \r
9     encoding="html" \r
10     doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"\r
11     doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>\r
12 \r
13   <xsl:param name="topdir" select="''"/>\r
14   \r
15   <xsl:template match="*" name="copy">\r
16     <xsl:copy>\r
17       <xsl:call-template name="copy-attributes"/>\r
18       <xsl:apply-templates/>\r
19     </xsl:copy>\r
20   </xsl:template>\r
21 \r
22   <xsl:template name="copy-attributes">\r
23     <xsl:for-each select="@*">\r
24       <xsl:attribute name="{name(current())}">\r
25         <xsl:choose>\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
30           </xsl:when>\r
31           <xsl:otherwise>\r
32             <xsl:value-of select="current()"/>\r
33           </xsl:otherwise>\r
34         </xsl:choose>\r
35       </xsl:attribute>\r
36     </xsl:for-each>\r
37   </xsl:template>\r
38 \r
39   <!-- Replace @TOPDIR@ with relative top directory path -->\r
40 \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
45   </xsl:template>\r
46   \r
47   <!-- Add 'class' attribute  -->\r
48   \r
49   <xsl:template name="add-class">\r
50     <xsl:param name="class"/>\r
51     <xsl:copy>\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
55     </xsl:copy>\r
56   </xsl:template>\r
57 \r
58   <!-- Add '<br/>' tag after every ', ' -->\r
59   <!-- This code is not very robust, it works with the doxygen output though -->\r
60 \r
61   <xsl:template name="break-comma">\r
62     <xsl:copy>\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
66     </xsl:copy>\r
67   </xsl:template>\r
68  \r
69   <xsl:template match="text()[1]" mode="break-comma">\r
70     <xsl:value-of select="current()"/><br/>\r
71   </xsl:template>\r
72 \r
73   <xsl:template match="*" mode="break-comma">\r
74     <xsl:call-template name="copy"/>\r
75   </xsl:template>\r
76 \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
79     <br/>\r
80     <xsl:value-of select="substring-after(current(),'and')"/>\r
81   </xsl:template>\r
82 \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
87   </xsl:template>\r
88 \r
89   <!-- ====================================================================== -->\r
90 \r
91   <!-- Hack Glossary menu highlight -->\r
92 \r
93   <xsl:template match="div[@class='tabs menu']/ul[1]">\r
94     <xsl:choose>\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
99       </xsl:when>\r
100       <xsl:otherwise>\r
101         <xsl:copy>\r
102           <xsl:call-template name="copy-attributes"/>\r
103           <xsl:apply-templates/>\r
104         </xsl:copy>\r
105       </xsl:otherwise>\r
106     </xsl:choose>\r
107   </xsl:template>\r
108 \r
109   <!-- Autogenerate table-of-contents for a page -->\r
110 \r
111   <xsl:template match="div[@id='autotoc']">\r
112     <xsl:copy>\r
113       <xsl:call-template name="copy-attributes"/>\r
114       <h1>Contents</h1>\r
115       <ul>\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
120             </xsl:attribute>\r
121             <b><xsl:call-template name="section-number"/><xsl:text> </xsl:text></b>\r
122             <xsl:element name="a">\r
123               <xsl:choose>\r
124                 <xsl:when test="a/@name">\r
125                   <xsl:attribute name="href">\r
126                     <xsl:value-of select="concat('#',a/@name)"/>\r
127                   </xsl:attribute>\r
128                 </xsl:when>\r
129                 <xsl:otherwise>\r
130                   <xsl:attribute name="href">\r
131                     <xsl:text>#autotoc-</xsl:text>\r
132                     <xsl:call-template name="section-number"/>\r
133                   </xsl:attribute>\r
134                 </xsl:otherwise>\r
135               </xsl:choose>\r
136               <xsl:value-of select="string(current())"/>\r
137             </xsl:element>\r
138           </xsl:element>\r
139         </xsl:for-each>\r
140       </ul>\r
141     </xsl:copy>\r
142   </xsl:template>\r
143 \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
150     </xsl:if>\r
151     <xsl:if test="self::h4">\r
152       <xsl:number level="any" from="h3" count="h4"/>\r
153       <xsl:text>.</xsl:text>\r
154     </xsl:if>\r
155   </xsl:template>\r
156   \r
157   <xsl:template match="h2|h3|h4">\r
158     <xsl:copy>\r
159       <xsl:call-template name="copy-attributes"/>\r
160       <xsl:choose>\r
161         <xsl:when test="preceding::div[@id='autotoc']">\r
162           <xsl:call-template name="section-number"/>\r
163           <xsl:text> </xsl:text>\r
164           <xsl:choose>\r
165             <xsl:when test="a">\r
166               <xsl:apply-templates/>\r
167             </xsl:when>\r
168             <xsl:otherwise>\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
174                 </xsl:attribute>\r
175                 <xsl:apply-templates/>\r
176               </xsl:element>\r
177             </xsl:otherwise>\r
178           </xsl:choose>\r
179         </xsl:when>\r
180         <xsl:otherwise>\r
181           <xsl:apply-templates/>\r
182         </xsl:otherwise>\r
183       </xsl:choose>\r
184     </xsl:copy>\r
185   </xsl:template>\r
186 \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
192         <xsl:if test="a">\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
200           </xsl:element>\r
201         </xsl:if>\r
202       </xsl:for-each>\r
203     </xsl:element>\r
204   </xsl:template>\r
205 \r
206   <!-- Reformat detailed member documentation -->\r
207 \r
208   <xsl:template match="table[@class='memname']">\r
209     <xsl:variable name="name1"><xsl:value-of select="str:split(tr/td[@class='memname'],'::')[position()=last()]"/></xsl:variable>\r
210     <xsl:variable name="name2"><xsl:value-of select="str:split(tr/td[@class='memname'],' ')[position()=last()]"/></xsl:variable>\r
211     <xsl:variable name="name"><xsl:value-of select="substring($name1,string-length($name1)-string-length($name2))"/></xsl:variable>\r
212     <xsl:element name="table">\r
213       <xsl:attribute name="class">\r
214         <xsl:text>memname</xsl:text>\r
215         <xsl:if test="contains(tr/td[@class='memname'],'#define')"><xsl:text> macro</xsl:text></xsl:if>\r
216       </xsl:attribute>\r
217       <tr>\r
218         <td class="memtype" colspan="5">\r
219           <xsl:for-each select="tr/td[@class='memname']/*|tr/td[@class='memname']/text()">\r
220             <xsl:choose>\r
221               <xsl:when test="position()=last()">\r
222                 <xsl:value-of select="substring(.,1,string-length(.)-string-length($name))"/>\r
223               </xsl:when>\r
224               <xsl:otherwise>\r
225                 <xsl:copy-of select="."/>\r
226               </xsl:otherwise>\r
227             </xsl:choose>\r
228           </xsl:for-each>\r
229         </td>\r
230       </tr>\r
231 \r
232       <xsl:choose>\r
233         <xsl:when test="tr/td[@class='paramtype']">\r
234           <tr>\r
235             <td class="memname"><xsl:copy-of select="$name"/></td>\r
236             <td class="memparen">(</td>\r
237             <xsl:copy-of select="tr[1]/td[@class='paramtype']"/>\r
238             <xsl:copy-of select="tr[1]/td[@class='paramname']"/>\r
239             <td class="memparen"><xsl:if test="not(tr[td[@class='paramkey']])">)</xsl:if></td>\r
240           </tr>\r
241 \r
242           <xsl:for-each select="tr[td[@class='paramkey']]">\r
243             <tr>\r
244               <td class="memname"></td>\r
245               <td class="memparen"></td>\r
246               <xsl:copy-of select="td[@class='paramtype']"/>\r
247               <xsl:copy-of select="td[@class='paramname']"/>\r
248               <td class="memparen"><xsl:if test="position()=last()">)</xsl:if></td>\r
249             </tr>\r
250           </xsl:for-each>\r
251         </xsl:when>\r
252         <xsl:otherwise>\r
253           <tr>\r
254             <td class="memname"><xsl:copy-of select="$name"/></td>\r
255             <td class="memparen"><xsl:if test="tr/td[.='(']">()</xsl:if></td>\r
256             <td class="paramtype"></td>\r
257             <td class="paramname"></td>\r
258             <td class="memparen"></td>\r
259           </tr>\r
260         </xsl:otherwise>\r
261       </xsl:choose>\r
262       <tr>\r
263         <td colspan="5" class="memattrs"><xsl:copy-of select="tr/td[@width='100%']/*|tr/td[@width='100%']/text()"/></td>\r
264       </tr>\r
265     </xsl:element>\r
266   </xsl:template>\r
267 \r
268   <!-- no idea, where these &nbsp;'s come frome ... -->\r
269   <xsl:template match="div[@class='memproto']/text()[.='&#160;&#x0a;']">\r
270   </xsl:template>\r
271 \r
272   <!-- Add grouping to all-members page -->\r
273 \r
274   <xsl:template match="table[preceding-sibling::h1[1][contains(text(),'Member List')]]">\r
275     <table class="allmembers">\r
276 \r
277       <!-- We need to filter the table rows by looking for indications on the object type       -->\r
278       <!-- The table has 3 acolumns:                                                            -->\r
279       <!--    td[1] is the name of the object,                                                  -->\r
280       <!--    td[2] is the name of the class the object is defined in                           -->\r
281       <!--    td[3] contains additional flags                                                   -->\r
282       <!--                                                                                      -->\r
283       <!-- The conditions we have are:                                                          -->\r
284       <!--                                                                                      -->\r
285       <!--    contains(td[3],'static')        static member (variable or function)              -->\r
286       <!--    contains(td[3],'protected')     protected member of arbitrary type                -->\r
287       <!--    contains(td[3],'private')       private member of arbitrary type                  -->\r
288       <!--    contains(td{3],'friend')        friend declaration (function or class)            -->\r
289       <!--    contains(td[3],'pure virtual')  entry is a pure-virtual member function           -->\r
290       <!--    starts-with(td[1]/text(),'(')   function entry (member, static or friend)         -->\r
291       <!--    contains(td[1], 'typedef')      entry is a typdef                                 -->\r
292       <!--    contains(td[1], 'enum ')        entry is enum type or enumerator                  -->\r
293       <!--    contains(td[1], 'enum name')    entry is the name of an enum type                 -->\r
294       <!--    contains(td[1], 'enum value')   entry is an enumerator value                      -->\r
295       <!--    str:split(substring-before(concat(td[2]/a,'&lt;'),'&lt;'),'::')[position()=last()]==string(td[1]/a) -->\r
296       <!--                                    entry is a constructor                            -->\r
297       <!--    not(starts-with(td[1]/a,'~'))   entry is a destructor                             -->\r
298 \r
299       <xsl:variable name="public-static-memfn">\r
300         <xsl:apply-templates select="tr[contains(td[3],'static')][not(contains(td[3],'protected'))][not(contains(td[3],'private'))][not(contains(td[3],'friend'))][starts-with(td[1]/text(),'(')]"/>\r
301       </xsl:variable>\r
302       <xsl:if test="string($public-static-memfn)">\r
303         <tr><td colspan="3"><h2>Static Public Member Functions</h2></td></tr>\r
304         <xsl:copy-of select="$public-static-memfn"/>\r
305       </xsl:if>\r
306 \r
307       <xsl:variable name="public-static-var">\r
308         <xsl:apply-templates select="tr[not(contains(td[1],'typedef'))][contains(td[3],'static')][not(contains(td[3],'protected'))][not(contains(td[3],'private'))][not(starts-with(td[1]/text(),'('))]"/>\r
309       </xsl:variable>\r
310       <xsl:if test="string($public-static-var)">\r
311         <tr><td colspan="3"><h2>Static Public Attributes</h2></td></tr>\r
312         <xsl:copy-of select="$public-static-var"/>\r
313       </xsl:if>\r
314       \r
315       <xsl:variable name="public-memfn">\r
316         <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'))][starts-with(td[1]/text(),'(')][str:split(substring-before(concat(td[2]/a,'&lt;'),'&lt;'),'::')[position()=last()]!=string(td[1]/a)][not(starts-with(td[1]/a,'~'))][not(contains(td[3],'pure virtual'))]"/>\r
317       </xsl:variable>\r
318       <xsl:if test="string($public-memfn)">\r
319         <tr><td colspan="3"><h2>Public Member Functions</h2></td></tr>\r
320         <xsl:copy-of select="$public-memfn"/>\r
321       </xsl:if>\r
322 \r
323       <xsl:variable name="public-var">\r
324         <xsl:apply-templates select="tr[not(contains(td[1],'typedef'))][not(contains(td[1],'enum '))][not(contains(td[3],'static'))][not(contains(td[3],'protected'))][not(contains(td[3],'private'))][not(starts-with(td[1]/text(),'('))]"/>\r
325       </xsl:variable>\r
326       <xsl:if test="string($public-var)">\r
327         <tr><td colspan="3"><h2>Public Attributes</h2></td></tr>\r
328         <xsl:copy-of select="$public-var"/>\r
329       </xsl:if>\r
330       \r
331       <xsl:variable name="public-enum">\r
332         <xsl:apply-templates select="tr[contains(td[1],'enum value')][not(contains(td[3],'protected'))][not(contains(td[3],'private'))]"/>\r
333       </xsl:variable>\r
334       <xsl:if test="string($public-enum)">\r
335         <tr><td colspan="3"><h2>Public Enumerators</h2></td></tr>\r
336         <xsl:copy-of select="$public-enum"/>\r
337       </xsl:if>\r
338       \r
339       <xsl:variable name="public-type">\r
340         <xsl:apply-templates select="tr[contains(td[1],'typedef') or contains(td[1],'enum name')][not(contains(td[3],'protected'))][not(contains(td[3],'private'))][not(contains(td[3],'friend'))]"/>\r
341       </xsl:variable>\r
342       <xsl:if test="string($public-type)">\r
343         <tr><td colspan="r"><h2>Public Types</h2></td></tr>\r
344         <xsl:copy-of select="$public-type"/>\r
345       </xsl:if>\r
346       \r
347       <xsl:variable name="non-public">\r
348         <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,'&lt;'),'&lt;'),'::')[position()=last()]!=string(td[1]/a)][not(starts-with(td[1]/a,'~'))][not(contains(td[3],'pure virtual'))]"/>\r
349       </xsl:variable>\r
350       <xsl:if test="string($non-public)">\r
351         <tr><td colspan="3"><h2>Non-Public Members</h2></td></tr>\r
352         <xsl:copy-of select="$non-public"/>\r
353       </xsl:if>\r
354 \r
355     </table>\r
356   </xsl:template>\r
357 \r
358   <xsl:template match="table[preceding-sibling::h1[1][contains(text(),'Member List')]]/tr/td[2]/a/text()[contains(.,'&lt;')]">\r
359     <!-- this removes the template args form the second column to make the table more compact -->\r
360     <xsl:value-of select="substring-before(.,'&lt;')"/>\r
361   </xsl:template>\r
362 \r
363   <xsl:template match="table[preceding-sibling::h1[1][contains(text(),'Member List')]]/tr/td[1]/a/text()[contains(.,'::')]">\r
364     <!-- for some weird reason, some members have a fully qualified name in the first column -->\r
365     <!-- remove the qualification here -->\r
366     <xsl:value-of select="str:split(.,'::')[position()=last()]"/>\r
367   </xsl:template>\r
368 \r
369   <!-- Remove the automatically inserted search form (we build our own) -->\r
370   <xsl:template match="li[form]"> \r
371   </xsl:template>\r
372 \r
373   <!-- Add CSS class to alphabetical class index table -->\r
374   <xsl:template match="table[preceding-sibling::*[1][self::div][@class='qindex']]">\r
375     <xsl:call-template name="add-class">\r
376       <xsl:with-param name="class">qindextable</xsl:with-param>\r
377     </xsl:call-template>\r
378   </xsl:template>\r
379 \r
380   <!-- Add CSS class to special paragraphs -->\r
381 \r
382   <xsl:template match="dl[dt/b/a/text()='Bug:']">\r
383     <xsl:call-template name="add-class">\r
384       <xsl:with-param name="class">xref-bug</xsl:with-param>\r
385     </xsl:call-template>\r
386   </xsl:template>\r
387 \r
388   <xsl:template match="dl[dt/b/a/text()='Fix:']">\r
389     <xsl:call-template name="add-class">\r
390       <xsl:with-param name="class">xref-fix</xsl:with-param>\r
391     </xsl:call-template>\r
392   </xsl:template>\r
393 \r
394   <xsl:template match="dl[dt/b/a/text()='Todo:']">\r
395     <xsl:call-template name="add-class">\r
396       <xsl:with-param name="class">xref-todo</xsl:with-param>\r
397     </xsl:call-template>\r
398   </xsl:template>\r
399 \r
400   <xsl:template match="dl[dt/b/a/text()='Idea:']">\r
401     <xsl:call-template name="add-class">\r
402       <xsl:with-param name="class">xref-idea</xsl:with-param>\r
403     </xsl:call-template>\r
404   </xsl:template>\r
405 \r
406   <xsl:template match="dl[dt/b/text()='Parameters:']|dl[dt/b/text()='Template Parameters:']">\r
407     <xsl:call-template name="add-class">\r
408       <xsl:with-param name="class">parameters</xsl:with-param>\r
409     </xsl:call-template>\r
410   </xsl:template>\r
411 \r
412   <xsl:template match="dl[dt/b/text()='Implementation note:']">\r
413     <xsl:call-template name="add-class">\r
414       <xsl:with-param name="class">implementation</xsl:with-param>\r
415     </xsl:call-template>\r
416   </xsl:template>\r
417 \r
418   <xsl:template match="p[starts-with(text(),'Definition at line ')]">\r
419     <xsl:call-template name="add-class">\r
420       <xsl:with-param name="class">sourceline</xsl:with-param>\r
421     </xsl:call-template>\r
422   </xsl:template>\r
423 \r
424   <xsl:template match="div[@class='memdoc']/p[starts-with(text(),'References ')]">\r
425     <xsl:call-template name="add-class">\r
426       <xsl:with-param name="class">references</xsl:with-param>\r
427     </xsl:call-template>\r
428   </xsl:template>\r
429 \r
430   <xsl:template match="div[@class='memdoc']/p[starts-with(text(),'Referenced by ')]">\r
431     <xsl:call-template name="add-class">\r
432       <xsl:with-param name="class">referencedby</xsl:with-param>\r
433     </xsl:call-template>\r
434   </xsl:template>\r
435 \r
436   <xsl:template match="div[@class='memdoc']/p[starts-with(text(),'Reimplemented from ')]">\r
437     <xsl:call-template name="add-class">\r
438       <xsl:with-param name="class">reimplementedfrom</xsl:with-param>\r
439     </xsl:call-template>\r
440   </xsl:template>\r
441 \r
442   <xsl:template match="div[@class='memdoc']/p[starts-with(text(),'Reimplemented in ')]">\r
443     <xsl:call-template name="add-class">\r
444       <xsl:with-param name="class">reimplementedin</xsl:with-param>\r
445     </xsl:call-template>\r
446   </xsl:template>\r
447 \r
448   <xsl:template match="div[@class='memdoc']/p[starts-with(text(),'Implemented in ')]">\r
449     <xsl:call-template name="add-class">\r
450       <xsl:with-param name="class">implementedin</xsl:with-param>\r
451     </xsl:call-template>\r
452   </xsl:template>\r
453 \r
454   <!-- Break the following lists after each komma -->\r
455 \r
456   <xsl:template match="p[starts-with(text(),'Inherited by ')]">\r
457     <xsl:call-template name="break-comma"/>\r
458   </xsl:template>\r
459 \r
460   <xsl:template match="p[starts-with(text(),'Inherits ')]">\r
461     <xsl:call-template name="break-comma"/>\r
462   </xsl:template>\r
463 \r
464   <!-- Add CSS class to the member overview table of a class documentation -->\r
465   <xsl:template match="table[descendant::td[@class='memItemLeft']]">\r
466     <xsl:call-template name="add-class">\r
467       <xsl:with-param name="class">members</xsl:with-param>\r
468     </xsl:call-template>\r
469   </xsl:template>\r
470 \r
471   <!-- Add CSS class to literal links (links, where link text and href attribute are the same -->\r
472   <xsl:template match="a[@href=string(current())]" priority="1">\r
473     <xsl:call-template name="add-class">\r
474       <xsl:with-param name="class">literal</xsl:with-param>\r
475     </xsl:call-template>\r
476   </xsl:template>\r
477 \r
478   <!-- Add CSS class to external links -->\r
479   <xsl:template match="a[contains(@href,'http://')]">\r
480     <xsl:call-template name="add-class">\r
481       <xsl:with-param name="class">ext</xsl:with-param>\r
482     </xsl:call-template>\r
483   </xsl:template>\r
484 \r
485   <!-- Add CSS class to anchor-only links -->\r
486   <xsl:template match="a[not(@href)]">\r
487     <xsl:call-template name="add-class">\r
488       <xsl:with-param name="class">anchor</xsl:with-param>\r
489     </xsl:call-template>\r
490   </xsl:template>\r
491 \r
492   <!-- Add CSS class to the brief documentation paragraph of the member documentation -->\r
493   <xsl:template match="div[@class='memdoc']/p[1][not(contains(.,'Definition at line'))]">\r
494     <xsl:call-template name="add-class">\r
495       <xsl:with-param name="class">memtitle</xsl:with-param>\r
496     </xsl:call-template>\r
497   </xsl:template>\r
498 \r
499   <!-- Remove external items from the namespace index -->\r
500   <xsl:template match="div[@id='content2']/table[contains(preceding-sibling::h1/text(),'Namespace Reference')]/tr[td[@class='memItemRight']/a[1][@class='elRef'][@doxygen]]">\r
501   </xsl:template>\r
502   \r
503   <!-- Remove [external] references from the modules page -->\r
504   <xsl:template match="div[@id='content2']/ul/li[a/@class='elRef'][a/@doxygen][code/text()='[external]'][not(ul)]">\r
505   </xsl:template>\r
506 \r
507   <!-- Insert 'senf/'  into include paths -->\r
508   <xsl:template match="code[starts-with(text(),'#include &lt;')]/a">\r
509     <xsl:copy>\r
510       <xsl:call-template name="copy-attributes"/>\r
511       <xsl:text>senf/</xsl:text>\r
512       <xsl:apply-templates/>\r
513     </xsl:copy>\r
514   </xsl:template>\r
515 \r
516 </xsl:stylesheet>\r