• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" ?>
2<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3<xsl:output method="xml" encoding="UTF-8" indent="yes" />
4<xsl:param name="which" />
5
6<xsl:template match="/">
7  <xsl:apply-templates select="/doxygen/compounddef[@kind!='file' and @kind!='dir']" />
8
9  <section id="{$which}-Functions">
10    <title>Functions</title>
11    <para />
12    <variablelist>
13      <xsl:apply-templates select="/doxygen/compounddef[@kind='file']/sectiondef/memberdef" />
14    </variablelist>
15  </section>
16
17</xsl:template>
18
19<xsl:template match="parameteritem">
20    <varlistentry>
21        <term>
22          <xsl:apply-templates select="parameternamelist/parametername"/>
23        </term>
24      <listitem>
25        <simpara><xsl:apply-templates select="parameterdescription"/></simpara>
26      </listitem>
27    </varlistentry>
28</xsl:template>
29
30<xsl:template match="parameterlist">
31  <xsl:if test="parameteritem">
32      <variablelist>
33        <xsl:apply-templates select="parameteritem" />
34      </variablelist>
35  </xsl:if>
36</xsl:template>
37
38<xsl:template match="ref">
39  <link linkend="{$which}-{@refid}"><xsl:value-of select="." /></link>
40</xsl:template>
41
42<xsl:template match="simplesect[@kind='return']">
43  <variablelist>
44    <varlistentry>
45      <term>Returns:</term>
46      <listitem>
47        <simpara><xsl:apply-templates /></simpara>
48      </listitem>
49    </varlistentry>
50  </variablelist>
51</xsl:template>
52
53<xsl:template match="simplesect[@kind='see']">
54  See also: <xsl:apply-templates />
55</xsl:template>
56
57<xsl:template match="simplesect[@kind='since']">
58  Since: <xsl:apply-templates />
59</xsl:template>
60
61<xsl:template match="simplesect[@kind='note']">
62  <emphasis>Note: <xsl:apply-templates /></emphasis>
63</xsl:template>
64
65<xsl:template match="sp">
66  <xsl:text> </xsl:text>
67</xsl:template>
68
69<xsl:template match="programlisting">
70  <programlisting><xsl:apply-templates /></programlisting>
71</xsl:template>
72
73<xsl:template match="itemizedlist">
74  <itemizedlist><xsl:apply-templates select="listitem" /></itemizedlist>
75</xsl:template>
76
77<xsl:template match="listitem">
78  <listitem><simpara><xsl:apply-templates /></simpara></listitem>
79</xsl:template>
80
81<!-- stops cross-references in the section titles -->
82<xsl:template match="briefdescription">
83  <xsl:value-of select="." />
84</xsl:template>
85
86<!-- this opens a para for each detaileddescription/para. I could not find a
87     way to extract the right text for the description from the
88     source otherwise. Downside: we can't use para for return value, "see
89     also", etc.  because they're already inside a para. So they're lists.
90
91     It also means we don't control the order of when something is added to
92     the output, it matches the input file
93     -->
94<xsl:template match="detaileddescription/para">
95  <para><xsl:apply-templates /></para>
96</xsl:template>
97
98<xsl:template match="detaileddescription">
99  <xsl:apply-templates select="para" />
100</xsl:template>
101
102<!-- methods -->
103<xsl:template match="memberdef" >
104  <xsl:if test="@kind = 'function' and @static = 'no' and @prot = 'public' or
105                @kind !='function' and normalize-space(briefdescription) != ''">
106    <varlistentry id="{$which}-{@id}">
107        <term>
108          <xsl:value-of select="name"/>
109          <xsl:if test="normalize-space(briefdescription) != ''">
110            - <xsl:apply-templates select="briefdescription" />
111          </xsl:if>
112        </term>
113        <listitem>
114          <synopsis>
115            <xsl:apply-templates select="definition"/><xsl:apply-templates select="argsstring"/>
116          </synopsis>
117          <xsl:apply-templates select="detaileddescription" />
118        </listitem>
119    </varlistentry>
120  </xsl:if>
121</xsl:template>
122
123<!-- classes -->
124<xsl:template match="compounddef" >
125    <section id="{$which}-{@id}">
126        <title>
127            <xsl:value-of select="compoundname" />
128            <xsl:if test="normalize-space(briefdescription) != ''">
129                - <xsl:apply-templates select="briefdescription" />
130            </xsl:if>
131        </title>
132        <xsl:choose>
133          <xsl:when test="normalize-space(detaileddescription) != ''">
134            <xsl:apply-templates select="detaileddescription" />
135          </xsl:when>
136          <xsl:otherwise>
137            <para />
138          </xsl:otherwise>
139        </xsl:choose>
140        <xsl:if test="sectiondef/memberdef[@kind='function' and @static='no']">
141          <variablelist>
142            <xsl:apply-templates select="sectiondef/memberdef" />
143          </variablelist>
144        </xsl:if>
145    </section>
146</xsl:template>
147</xsl:stylesheet>
148