Update Doxygen-to-Docbook transform with the latest transform rules for functions, enums, structs, type definitions and variables.

pull/1469/head
Dean Camera 12 years ago
parent cc44591b58
commit f515e8412f

@ -1,3 +1,11 @@
<!--
LUFA Library
Copyright (C) Dean Camera, 2013.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
-->
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title>LUFA Help</title> <title>LUFA Help</title>

@ -182,8 +182,14 @@
<section id="{@id}" xreflabel="{$name}"> <section id="{@id}" xreflabel="{$name}">
<title> <title>
<xsl:value-of select="@kind"/> <xsl:choose>
<xsl:text> </xsl:text> <xsl:when test="@kind = 'struct'">
<xsl:text>Struct </xsl:text>
</xsl:when>
<xsl:when test="@kind = 'union'">
<xsl:text>Union </xsl:text>
</xsl:when>
</xsl:choose>
<xsl:value-of select="$name"/> <xsl:value-of select="$name"/>
</title> </title>
@ -194,7 +200,7 @@
<xsl:apply-templates select="detaileddescription"/> <xsl:apply-templates select="detaileddescription"/>
<xsl:for-each select="sectiondef[@kind='public-attrib']"> <xsl:for-each select="sectiondef[@kind='public-attrib']">
<table abstyle="striped"> <table tabstyle="striped">
<title> <title>
<xsl:value-of select="$name"/> <xsl:value-of select="$name"/>
</title> </title>
@ -204,8 +210,8 @@
<spanspec spanname="full" namest="start.col" nameend="stop.col"/> <spanspec spanname="full" namest="start.col" nameend="stop.col"/>
<thead> <thead>
<row> <row>
<entry>Data type</entry> <entry>Type</entry>
<entry>Field name</entry> <entry>Name</entry>
<entry>Description</entry> <entry>Description</entry>
</row> </row>
</thead> </thead>
@ -217,6 +223,9 @@
</entry> </entry>
<entry> <entry>
<xsl:value-of select="name"/> <xsl:value-of select="name"/>
<xsl:if test="starts-with(argsstring, '[')">
<xsl:text>[]</xsl:text>
</xsl:if>
<indexterm id="{$keyword.namespace}.{$name}.{name}"/> <indexterm id="{$keyword.namespace}.{$name}.{name}"/>
</entry> </entry>
<entry> <entry>
@ -252,9 +261,34 @@
</para> </para>
<programlisting language="c"> <programlisting language="c">
<xsl:value-of select="definition"/> <emphasis role="keyword">
<xsl:text> </xsl:text> <xsl:value-of select="type"/>
<xsl:apply-templates select="argsstring"/> </emphasis>
<xsl:text> </xsl:text>
<xsl:value-of select="name"/>
<xsl:text>(</xsl:text>
<xsl:choose>
<xsl:when test="argsstring = '(void)'">
<emphasis role="keyword">void</emphasis>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="param">
<xsl:if test="position() > 1">
<xsl:text>,</xsl:text>
</xsl:if>
<xsl:text>&#10;&#9;&#9;</xsl:text>
<emphasis role="keyword">
<xsl:value-of select="type"/>
</emphasis>
<xsl:text> </xsl:text>
<xsl:value-of select="declname"/>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<xsl:text>)</xsl:text>
</programlisting> </programlisting>
<xsl:apply-templates select="detaileddescription"/> <xsl:apply-templates select="detaileddescription"/>
@ -276,7 +310,8 @@
<xsl:apply-templates select="detaileddescription"/> <xsl:apply-templates select="detaileddescription"/>
<informaltable tabstyle="striped"> <table tabstyle="striped">
<title>Members</title>
<tgroup cols="2"> <tgroup cols="2">
<thead> <thead>
<row> <row>
@ -299,7 +334,7 @@
</xsl:for-each> </xsl:for-each>
</tbody> </tbody>
</tgroup> </tgroup>
</informaltable> </table>
</section> </section>
</xsl:template> </xsl:template>
@ -317,27 +352,29 @@
</xsl:call-template> </xsl:call-template>
<programlisting language="c"> <programlisting language="c">
<xsl:text>#define </xsl:text> <emphasis role="preprocessor">
<xsl:value-of select="name"/> <xsl:text>#define </xsl:text>
<xsl:if test="count(param) &gt; 0"> <xsl:value-of select="name"/>
<xsl:text>(</xsl:text> <xsl:if test="count(param) > 0">
<xsl:for-each select="param/defname"> <xsl:text>(</xsl:text>
<xsl:if test="position() &gt; 1"> <xsl:for-each select="param/defname">
<xsl:text>,</xsl:text> <xsl:if test="position() > 1">
</xsl:if> <xsl:text>,</xsl:text>
<xsl:value-of select="."/> </xsl:if>
</xsl:for-each> <xsl:value-of select="."/>
<xsl:text>)</xsl:text> </xsl:for-each>
</xsl:if> <xsl:text>)</xsl:text>
</xsl:if>
<xsl:text> </xsl:text> <xsl:text> </xsl:text>
<!-- Split long macro definitions across multiple lines --> <!-- Split long macro definitions across multiple lines -->
<xsl:if test="(string-length(initializer) &gt; 50) or (count(param) &gt; 0)"> <xsl:if test="(string-length(initializer) > 50) or (count(param) > 0)">
<xsl:text>\</xsl:text> <xsl:text>\&#10;&#09;&#9;</xsl:text>
</xsl:if> </xsl:if>
<xsl:value-of select="initializer"/> <xsl:value-of select="initializer"/>
</emphasis>
<xsl:text> </xsl:text>
</programlisting> </programlisting>
<xsl:apply-templates select="detaileddescription"/> <xsl:apply-templates select="detaileddescription"/>
@ -348,29 +385,51 @@
<xsl:variable name="name" select="name"/> <xsl:variable name="name" select="name"/>
<section id="{@id}" xreflabel="{name}"> <section id="{@id}" xreflabel="{name}">
<title> <!-- Doxygen gets confused and thinks function pointer type definitions
<!-- Doxygen gets confused and thinks function pointer type definitions are variables, so we need to map them to this common section and
are variables, so we need to map them to this common section and check the definition to see which of the two it is. -->
check the definition to see which of the two it is. --> <xsl:choose>
<xsl:choose> <xsl:when test="contains(definition,'typedef')">
<xsl:when test="contains(definition,'typedef')"> <title>
<xsl:text>Type </xsl:text> <xsl:text>Type </xsl:text>
</xsl:when> <xsl:value-of select="name"/>
<xsl:otherwise> </title>
<xsl:text>Variable </xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="name"/> <xsl:call-template name="generate.index.id">
</title> <xsl:with-param name="name" select="$name"/>
</xsl:call-template>
<xsl:call-template name="generate.index.id"> <programlisting language="c">
<xsl:with-param name="name" select="$name"/> <emphasis role="keyword">
</xsl:call-template> <xsl:text>typedef </xsl:text>
<xsl:value-of select="type"/>
</emphasis>
<xsl:text> </xsl:text>
<xsl:value-of select="name"/>
<xsl:text> </xsl:text>
<xsl:value-of select="argsstring"/>
</programlisting>
</xsl:when>
<programlisting language="c"> <xsl:otherwise>
<xsl:value-of select="definition"/> <title>
</programlisting> <xsl:text>Variable </xsl:text>
<xsl:value-of select="name"/>
</title>
<xsl:call-template name="generate.index.id">
<xsl:with-param name="name" select="$name"/>
</xsl:call-template>
<programlisting language="c">
<emphasis role="keyword">
<xsl:value-of select="type"/>
</emphasis>
<xsl:text> </xsl:text>
<xsl:value-of select="name"/>
</programlisting>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="detaileddescription"/> <xsl:apply-templates select="detaileddescription"/>
</section> </section>

@ -1,3 +1,11 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
.programlisting { .programlisting {
display: block; display: block;
margin-left: 15px; margin-left: 15px;

Loading…
Cancel
Save