Speed up Doxygen-to-Docbook conversion, enable partial syntax highlighting in the...
authorDean Camera <dean@fourwalledcubicle.com>
Thu, 25 Apr 2013 19:46:03 +0000 (19:46 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Thu, 25 Apr 2013 19:46:03 +0000 (19:46 +0000)
LUFA/CodeTemplates/DriverStubs/Dataflash.h
LUFA/StudioIntegration/HV1/lufa_docbook_transform.xslt
LUFA/StudioIntegration/HV1/lufa_hv1_transform.xslt

index 63ebcf0..d466e9b 100644 (file)
@@ -81,6 +81,7 @@
                        #define DATAFLASH_PAGES                      // TODO: Replace with the total number of pages inside one of the Dataflash ICs
 
                /* Inline Functions: */
                        #define DATAFLASH_PAGES                      // TODO: Replace with the total number of pages inside one of the Dataflash ICs
 
                /* Inline Functions: */
+               #if !defined(__DOXYGEN__)
                        /** Initializes the dataflash driver so that commands and data may be sent to an attached dataflash IC.
                         *  The microcontroller's SPI driver MUST be initialized before any of the dataflash commands are used.
                         */
                        /** Initializes the dataflash driver so that commands and data may be sent to an attached dataflash IC.
                         *  The microcontroller's SPI driver MUST be initialized before any of the dataflash commands are used.
                         */
                         *  \param[in] PageAddress  Page address within the selected dataflash IC
                         *  \param[in] BufferByte   Address within the dataflash's buffer
                         */
                         *  \param[in] PageAddress  Page address within the selected dataflash IC
                         *  \param[in] BufferByte   Address within the dataflash's buffer
                         */
-                       static inline void Dataflash_SendAddressBytes(uint16_t PageAddress, const uint16_t BufferByte)
+                       static inline void Dataflash_SendAddressBytes(uint16_t PageAddress,
+                                                                     const uint16_t BufferByte)
                        {
                                #if (DATAFLASH_TOTALCHIPS == 2)
                                        PageAddress >>= 1;
                        {
                                #if (DATAFLASH_TOTALCHIPS == 2)
                                        PageAddress >>= 1;
                                Dataflash_SendByte((PageAddress << 3) | (BufferByte >> 8));
                                Dataflash_SendByte(BufferByte);
                        }
                                Dataflash_SendByte((PageAddress << 3) | (BufferByte >> 8));
                                Dataflash_SendByte(BufferByte);
                        }
+               #endif
 
 #endif
 
 
 #endif
 
index 4247b47..9026dd6 100644 (file)
@@ -47,6 +47,7 @@
                <xsl:variable name="book.title">
                        <xsl:call-template name="generate.book.title"/>
                </xsl:variable>
                <xsl:variable name="book.title">
                        <xsl:call-template name="generate.book.title"/>
                </xsl:variable>
+
                <xsl:variable name="book.id">
                        <xsl:call-template name="generate.book.id">
                                <xsl:with-param name="book.title" select="$book.title"/>
                <xsl:variable name="book.id">
                        <xsl:call-template name="generate.book.id">
                                <xsl:with-param name="book.title" select="$book.title"/>
 
                        <!-- Add index chapter -->
                        <xsl:call-template name="generate.top.level.page">
 
                        <!-- Add index chapter -->
                        <xsl:call-template name="generate.top.level.page">
-                               <xsl:with-param name="top.level.page" select="compounddef[@kind = 'page' and contains(@id, 'index')]"/>
+                               <xsl:with-param name="top.level.page" select="compounddef[@kind = 'page' and @id = 'indexpage']"/>
                        </xsl:call-template>
 
                        <!-- Add free-floating chapters -->
                        </xsl:call-template>
 
                        <!-- Add free-floating chapters -->
-                       <xsl:for-each select="compounddef[@kind = 'page' and not(contains(@id, 'index'))]">
+                       <xsl:for-each select="compounddef[@kind = 'page' and not(@id = 'indexpage')]">
                                <xsl:if test="not(//innerpage[@refid = current()/@id])">
                                        <xsl:call-template name="generate.top.level.page">
                                                <xsl:with-param name="top.level.page" select="current()"/>
                                <xsl:if test="not(//innerpage[@refid = current()/@id])">
                                        <xsl:call-template name="generate.top.level.page">
                                                <xsl:with-param name="top.level.page" select="current()"/>
                                <xsl:value-of select="title"/>
                        </title>
 
                                <xsl:value-of select="title"/>
                        </title>
 
-                       <xsl:variable name="book.title">
-                               <xsl:call-template name="generate.book.title"/>
-                       </xsl:variable>
-
                        <xsl:variable name="name">
                                <xsl:choose>
                                        <xsl:when test="contains(compoundname, '_')">
                                                <xsl:value-of select="translate(compoundname, '_', '/')"/>
                                                <xsl:text>.h</xsl:text>
                                        </xsl:when>
                        <xsl:variable name="name">
                                <xsl:choose>
                                        <xsl:when test="contains(compoundname, '_')">
                                                <xsl:value-of select="translate(compoundname, '_', '/')"/>
                                                <xsl:text>.h</xsl:text>
                                        </xsl:when>
+
                                        <xsl:otherwise>
                                                <xsl:value-of select="compoundname"/>
                                                <xsl:text>.h</xsl:text>
                                        <xsl:otherwise>
                                                <xsl:value-of select="compoundname"/>
                                                <xsl:text>.h</xsl:text>
                                                <xsl:value-of select="translate(compoundname, '_', '.')"/>
                                                <xsl:text>.h</xsl:text>
                                        </xsl:when>
                                                <xsl:value-of select="translate(compoundname, '_', '.')"/>
                                                <xsl:text>.h</xsl:text>
                                        </xsl:when>
+
                                        <xsl:otherwise>
                                                <xsl:value-of select="compoundname"/>
                                                <xsl:text>.h</xsl:text>
                                        <xsl:otherwise>
                                                <xsl:value-of select="compoundname"/>
                                                <xsl:text>.h</xsl:text>
                                        <xsl:when test="@kind = 'struct'">
                                                <xsl:text>Struct </xsl:text>
                                        </xsl:when>
                                        <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:when test="@kind = 'union'">
                                                <xsl:text>Union </xsl:text>
                                        </xsl:when>
                                </xsl:choose>
+
                                <xsl:value-of select="$name"/>
                        </title>
 
                                <xsl:value-of select="$name"/>
                        </title>
 
 
                        <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 tabstyle="striped">
                                        <title>
                                                <xsl:value-of select="$name"/>
                                <table tabstyle="striped">
                                        <title>
                                                <xsl:value-of select="$name"/>
        </xsl:template>
 
        <xsl:template match="memberdef[@kind = 'function']">
        </xsl:template>
 
        <xsl:template match="memberdef[@kind = 'function']">
-               <xsl:variable name="name" select="name"/>
-
                <section id="{@id}" xreflabel="{name}">
                        <title>
                                <xsl:text>Function </xsl:text>
                <section id="{@id}" xreflabel="{name}">
                        <title>
                                <xsl:text>Function </xsl:text>
-                               <xsl:value-of select="$name"/>
+                               <xsl:value-of select="name"/>
                                <xsl:text>()</xsl:text>
                        </title>
 
                        <xsl:call-template name="generate.index.id">
                                <xsl:text>()</xsl:text>
                        </title>
 
                        <xsl:call-template name="generate.index.id">
-                               <xsl:with-param name="name" select="$name"/>
+                               <xsl:with-param name="name" select="name"/>
                        </xsl:call-template>
 
                        <para>
                        </xsl:call-template>
 
                        <para>
        </xsl:template>
 
        <xsl:template match="memberdef[@kind = 'define']">
        </xsl:template>
 
        <xsl:template match="memberdef[@kind = 'define']">
-               <xsl:variable name="name" select="name"/>
-
                <section id="{@id}" xreflabel="{name}">
                        <title>
                                <xsl:text>Macro </xsl:text>
                <section id="{@id}" xreflabel="{name}">
                        <title>
                                <xsl:text>Macro </xsl:text>
                        </title>
 
                        <xsl:call-template name="generate.index.id">
                        </title>
 
                        <xsl:call-template name="generate.index.id">
-                               <xsl:with-param name="name" select="$name"/>
+                               <xsl:with-param name="name" select="name"/>
                        </xsl:call-template>
 
                        <programlisting language="c">
                        </xsl:call-template>
 
                        <programlisting language="c">
        </xsl:template>
 
        <xsl:template match="memberdef[@kind = 'variable' or @kind = 'typedef']">
        </xsl:template>
 
        <xsl:template match="memberdef[@kind = 'variable' or @kind = 'typedef']">
-               <xsl:variable name="name" select="name"/>
-
                <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>
                <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')">
+                               <xsl:when test="contains(definition, 'typedef')">
                                        <title>
                                                <xsl:text>Type </xsl:text>
                                                <xsl:value-of select="name"/>
                                        </title>
 
                                        <xsl:call-template name="generate.index.id">
                                        <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:with-param name="name" select="name"/>
                                        </xsl:call-template>
 
                                        <programlisting language="c">
                                        </xsl:call-template>
 
                                        <programlisting language="c">
                                        </title>
 
                                        <xsl:call-template name="generate.index.id">
                                        </title>
 
                                        <xsl:call-template name="generate.index.id">
-                                               <xsl:with-param name="name" select="$name"/>
+                                               <xsl:with-param name="name" select="name"/>
                                        </xsl:call-template>
 
                                        <programlisting language="c">
                                        </xsl:call-template>
 
                                        <programlisting language="c">
 
        <xsl:template match="simplesect">
                <xsl:choose>
 
        <xsl:template match="simplesect">
                <xsl:choose>
-                       <xsl:when test="@kind = 'warning'">
-                               <warning>
-                                       <title>Warning</title>
+                       <xsl:when test="@kind = 'par'">
+                               <note>
+                                       <title>
+                                               <xsl:value-of select="title"/>
+                                       </title>
                                        <xsl:apply-templates select="para"/>
                                        <xsl:apply-templates select="para"/>
-                               </warning>
+                               </note>
                        </xsl:when>
 
                        <xsl:when test="@kind = 'return'">
                        </xsl:when>
 
                        <xsl:when test="@kind = 'return'">
                                </note>
                        </xsl:when>
 
                                </note>
                        </xsl:when>
 
-                       <xsl:when test="@kind = 'pre'">
-                               <note>
-                                       <title>Precondition</title>
+                       <xsl:when test="@kind = 'warning'">
+                               <warning>
+                                       <title>Warning</title>
                                        <xsl:apply-templates select="para"/>
                                        <xsl:apply-templates select="para"/>
-                               </note>
+                               </warning>
                        </xsl:when>
 
                        </xsl:when>
 
-                       <xsl:when test="@kind = 'par'">
+                       <xsl:when test="@kind = 'pre'">
                                <note>
                                <note>
-                                       <title>
-                                               <xsl:value-of select="title"/>
-                                       </title>
+                                       <title>Precondition</title>
                                        <xsl:apply-templates select="para"/>
                                </note>
                        </xsl:when>
                                        <xsl:apply-templates select="para"/>
                                </note>
                        </xsl:when>
                                                <xsl:when test="not(descendant::parametername/@direction)">
                                                        <emphasis role="italic">?</emphasis>
                                                </xsl:when>
                                                <xsl:when test="not(descendant::parametername/@direction)">
                                                        <emphasis role="italic">?</emphasis>
                                                </xsl:when>
+
                                                <xsl:otherwise>
                                                        <emphasis role="bold">
                                                                [<xsl:value-of select="descendant::parametername/@direction"/>]
                                                <xsl:otherwise>
                                                        <emphasis role="bold">
                                                                [<xsl:value-of select="descendant::parametername/@direction"/>]
                                <xsl:value-of select="."/>
                        </xsl:when>
 
                                <xsl:value-of select="."/>
                        </xsl:when>
 
+                       <!-- Don't show links to file compound definitions, as they are discarded -->
+                       <xsl:when test="ancestor::*/compounddef[@kind = 'file' and @id = current()/@refid]">
+                               <xsl:value-of select="."/>
+                       </xsl:when>
+
                        <!-- Show links outside program listings -->
                        <xsl:otherwise>
                                <link linkend="{@refid}">
                        <!-- Show links outside program listings -->
                        <xsl:otherwise>
                                <link linkend="{@refid}">
                                        <xsl:call-template name="write.table.content"/>
                                </table>
                        </xsl:when>
                                        <xsl:call-template name="write.table.content"/>
                                </table>
                        </xsl:when>
+
                        <xsl:otherwise>
                                <informaltable tabstyle="striped">
                                        <xsl:call-template name="write.table.content"/>
                        <xsl:otherwise>
                                <informaltable tabstyle="striped">
                                        <xsl:call-template name="write.table.content"/>
 
        <xsl:template match="itemizedlist">
                <itemizedlist>
 
        <xsl:template match="itemizedlist">
                <itemizedlist>
-                       <xsl:apply-templates select="listitem"/>
+                       <xsl:apply-templates/>
                </itemizedlist>
        </xsl:template>
 
        <xsl:template match="orderedlist">
                <orderedlist>
                </itemizedlist>
        </xsl:template>
 
        <xsl:template match="orderedlist">
                <orderedlist>
-                       <xsl:apply-templates select="listitem"/>
+                       <xsl:apply-templates/>
                </orderedlist>
        </xsl:template>
 
                </orderedlist>
        </xsl:template>
 
        </xsl:template>
 
        <xsl:template match="highlight">
        </xsl:template>
 
        <xsl:template match="highlight">
-               <emphasis role="{@class}">
+<!--           <emphasis role="{@class}"> -->
                        <xsl:apply-templates/>
                        <xsl:apply-templates/>
-               </emphasis>
+<!--           </emphasis> -->
        </xsl:template>
 
        <xsl:template match="sp[ancestor::codeline]">
        </xsl:template>
 
        <xsl:template match="sp[ancestor::codeline]">
index ff381ea..ee8a383 100644 (file)
 \r
        <xsl:output method="xml" indent="no"/>\r
 \r
 \r
        <xsl:output method="xml" indent="no"/>\r
 \r
-<!--\r
        <xsl:template match="emphasis[@role = 'keyword' or @role = 'keywordtype' or @role = 'keywordflow']">\r
        <xsl:template match="emphasis[@role = 'keyword' or @role = 'keywordtype' or @role = 'keywordflow']">\r
-               <span class="hl-keyword" style="color: #0079C1; display:inline-block">\r
+               <span class="hl-keyword" style="color: #0079C1">\r
                        <xsl:apply-templates/>\r
                </span>\r
        </xsl:template>\r
 \r
        <xsl:template match="emphasis[@role = 'stringliteral' or @role = 'charliteral']">\r
                        <xsl:apply-templates/>\r
                </span>\r
        </xsl:template>\r
 \r
        <xsl:template match="emphasis[@role = 'stringliteral' or @role = 'charliteral']">\r
-               <span class="hl-string" style="color: #800000; display:inline-block">\r
+               <span class="hl-string" style="color: #800000">\r
                        <xsl:apply-templates/>\r
                </span>\r
        </xsl:template>\r
 \r
        <xsl:template match="emphasis[@role = 'comment']">\r
                        <xsl:apply-templates/>\r
                </span>\r
        </xsl:template>\r
 \r
        <xsl:template match="emphasis[@role = 'comment']">\r
-               <span class="hl-comment" style="color: #008000; display:inline-block">\r
+               <em class="hl-comment" style="color: #008000">\r
                        <xsl:apply-templates/>\r
                        <xsl:apply-templates/>\r
-               </span>\r
+               </em>\r
        </xsl:template>\r
 \r
        <xsl:template match="emphasis[@role = 'preprocessor']">\r
        </xsl:template>\r
 \r
        <xsl:template match="emphasis[@role = 'preprocessor']">\r
-               <span class="hl-preprocessor" style="color: #A000A0; display:inline-block">\r
+               <span class="hl-preprocessor" style="color: #A000A0">\r
                        <xsl:apply-templates/>\r
                </span>\r
        </xsl:template>\r
 \r
        <xsl:template match="emphasis[@role = 'normal' and ancestor::programlisting]">\r
                        <xsl:apply-templates/>\r
                </span>\r
        </xsl:template>\r
 \r
        <xsl:template match="emphasis[@role = 'normal' and ancestor::programlisting]">\r
-               <span>\r
-                       <xsl:apply-templates/>\r
-               </span>\r
+               <xsl:apply-templates />\r
        </xsl:template>\r
        </xsl:template>\r
--->\r
 \r
 </xsl:stylesheet>\r
 \r
 </xsl:stylesheet>\r