forked from espressif/esp-idf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
doxygen_xml_to_rst.xslt
58 lines (51 loc) · 2.41 KB
/
doxygen_xml_to_rst.xslt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?xml version="1.0" encoding="UTF-8"?>
<!-- This XSL transform converts Doxygen XML output for a header file into Sphinx/Breathe compatible list of APIs -->
<!-- Usage: xsltproc doxygen_xml_to_rst.xslt xml/esp__xxxx_8h.xml -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="UTF-8"/>
<xsl:template match="/">
<xsl:text>Macros
</xsl:text>
<xsl:text>^^^^^^

</xsl:text>
<xsl:for-each select="doxygen/compounddef/sectiondef/memberdef[@kind='define']">
<xsl:text>.. doxygendefine:: </xsl:text>
<xsl:value-of select="name"/>
<xsl:text>
</xsl:text>
</xsl:for-each>
<xsl:text>
</xsl:text>
<xsl:text>Type Definitions
</xsl:text>
<xsl:text>^^^^^^^^^^^^^^^^

</xsl:text>
<xsl:for-each select="doxygen/compounddef/sectiondef/memberdef[@kind='typedef']">
<xsl:text>.. doxygentypedef:: </xsl:text>
<xsl:value-of select="name"/>
<xsl:text>
</xsl:text>
</xsl:for-each>
<xsl:text>
</xsl:text>
<xsl:text>Enumerations
</xsl:text>
<xsl:text>^^^^^^^^^^^^

</xsl:text>
<xsl:for-each select="doxygen/compounddef/sectiondef/memberdef[@kind='enum']">
<xsl:text>.. doxygenenum:: </xsl:text>
<xsl:value-of select="name"/>
<xsl:text>
</xsl:text>
</xsl:for-each>
<xsl:text>
</xsl:text>
<!-- TODO: figure out why structures are listed as innerclass instances -->
<xsl:text>Structures
</xsl:text>
<xsl:text>^^^^^^^^^^

</xsl:text>
<xsl:for-each select="doxygen/compounddef/innerclass">
<xsl:text>.. doxygenstruct:: </xsl:text>
<xsl:value-of select="."/>
<xsl:text>
</xsl:text>
<xsl:text> :members:
</xsl:text>
<xsl:text>
</xsl:text>
</xsl:for-each>
<xsl:text>
</xsl:text>
<xsl:text>Functions
</xsl:text>
<xsl:text>^^^^^^^^^

</xsl:text>
<xsl:for-each select="doxygen/compounddef/sectiondef/memberdef[@kind='function']">
<xsl:text>.. doxygenfunction:: </xsl:text>
<xsl:value-of select="name"/>
<xsl:text>
</xsl:text>
</xsl:for-each>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>