Pseudo-port the host mode demos for possible later multi-arch support.
[pub/USBasp.git] / LUFA / StudioIntegration / HV1 / lufa_docbook_transform.xslt
index fc16f61..24a5dfa 100644 (file)
@@ -88,7 +88,7 @@
                        </xsl:attribute>
 
                        <xsl:variable name="name">
-                               <xsl:text>LUFA.Page.</xsl:text>
+                               <xsl:text>LUFA.</xsl:text>
                                <xsl:value-of select="translate(compoundname, '_', '/')"/>
                        </xsl:variable>
 
                        </title>
 
                        <xsl:variable name="name">
-                               <xsl:text>LUFA.Group.</xsl:text>
+                               <xsl:text>LUFA.</xsl:text>
                                <xsl:value-of select="translate(compoundname, '_', '/')"/>
                        </xsl:variable>
 
                                        <title>
                                                <xsl:value-of select="$name"/>
                                        </title>
+
                                        <tgroup cols="3">
-                                               <colspec colnum="1" colname="start.col"/>
-                                               <colspec colnum="3" colname="stop.col"/>
-                                               <spanspec spanname="full" namest="start.col" nameend="stop.col"/>
                                                <thead>
                                                        <row>
                                                                <entry>Type</entry>
                                                                <entry>Description</entry>
                                                        </row>
                                                </thead>
+
                                                <tbody>
                                                        <xsl:for-each select="memberdef">
                                                                <row id="{@id}" xreflabel="{name}">
                                                                                <xsl:if test="starts-with(argsstring, '[')">
                                                                                        <xsl:text>[]</xsl:text>
                                                                                </xsl:if>
-                                                                               <indexterm id="{$keyword.namespace}.{$name}.{name}"/>
+
+                                                                               <xsl:variable name="struct.element.name">
+                                                                                       <xsl:value-of select="$name"/>
+                                                                                       <xsl:text>.</xsl:text>
+                                                                                       <xsl:value-of select="name"/>
+                                                                               </xsl:variable>
+
+                                                                               <xsl:call-template name="generate.index.id">
+                                                                                       <xsl:with-param name="name" select="$struct.element.name"/>
+                                                                               </xsl:call-template>
                                                                        </entry>
                                                                        <entry>
                                                                                <xsl:apply-templates select="detaileddescription"/>
                                                        <entry>Description</entry>
                                                </row>
                                        </thead>
+
                                        <tbody>
                                                <xsl:for-each select="enumvalue">
                                                        <row>
                                                                <entry>
                                                                        <para id="{@id}" xreflabel="{name}">
                                                                                <xsl:value-of select="name"/>
-                                                                               <indexterm id="{$keyword.namespace}.{name}"/>
+
+                                                                               <xsl:call-template name="generate.index.id">
+                                                                                       <xsl:with-param name="name" select="name"/>
+                                                                               </xsl:call-template>
                                                                        </para>
                                                                </entry>
                                                                <entry>
                </section>
        </xsl:template>
 
-       <xsl:template match="memberdef[@kind = 'variable' or @kind = 'typedef']">
+       <xsl:template match="memberdef[@kind = 'typedef']">
                <section id="{@id}" xreflabel="{name}">
-                       <!-- Doxygen gets confused and thinks function pointer type definitions
-                                are variables, so we need to map them to this common section and
-                                check the definition to see which of the two it is. -->
-                       <xsl:choose>
-                               <xsl:when test="contains(definition, 'typedef')">
-                                       <title>
-                                               <xsl:text>Type </xsl:text>
-                                               <xsl:value-of select="name"/>
-                                       </title>
+                       <title>
+                               <xsl:text>Type </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: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>
-
-                               <xsl:otherwise>
-                                       <title>
-                                               <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: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:apply-templates select="detaileddescription"/>
+               </section>
+       </xsl:template>
 
-                                       <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:template match="memberdef[@kind = 'variable']">
+               <section id="{@id}" xreflabel="{name}">
+                       <title>
+                               <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:apply-templates select="detaileddescription"/>
                </section>
        </xsl:template>
 
        <xsl:template match="linebreak | simplesectsep">
+               <!-- MUST be on two separate lines, as this is a *literal* newline -->
                <literallayout>
                </literallayout>
        </xsl:template>
        </xsl:template>
 
        <xsl:template match="mdash | ndash">
+               <!-- Doxygen bug; double dashed are replaced with single HTML dash
+                    entities, even in verbatim-like <tt> sections -->
                <xsl:text>--</xsl:text>
        </xsl:template>
 
                                        </row>
                                </xsl:for-each>
                        </thead>
+
                        <tbody>
                                <xsl:for-each select="row[position() != 1]">
                                        <row>