Update to latest Doxygen configurations, patch Doxygen->Docbook transform due to...
[pub/lufa.git] / LUFA / StudioIntegration / HV1 / lufa_docbook_transform.xslt
index 111b75a..f1e9239 100644 (file)
 
        <xsl:template match="programlisting">
                <programlisting language="c">
-                       <xsl:for-each select="codeline[position() > 1 or highlight]">
-                               <xsl:apply-templates select="."/>
-                               <xsl:text>&#10;</xsl:text>
-                       </xsl:for-each>
+                       <xsl:apply-templates/>
                </programlisting>
        </xsl:template>
 
+       <xsl:template match="codeline">
+               <xsl:apply-templates/>
+               <xsl:text>&#10;</xsl:text>
+       </xsl:template>
+
+       <xsl:template match="codeline[last()]">
+               <xsl:if test="text() != '*'">
+                       <xsl:apply-templates/>
+               </xsl:if>
+       </xsl:template>
+
        <xsl:template match="highlight">
                <emphasis role="{@class}">
                        <xsl:apply-templates/>
                </emphasis>
        </xsl:template>
 
+       <xsl:template match="highlight[1]/text()">
+               <xsl:choose>
+                       <xsl:when test="substring(., 1, 1) = '*'">
+                               <xsl:value-of select="substring(., 2)"/>
+                       </xsl:when>
+
+                       <xsl:otherwise>
+                               <xsl:value-of select="."/>
+                       </xsl:otherwise>
+               </xsl:choose>
+       </xsl:template>
+
        <xsl:template match="sp[ancestor::codeline]">
                <xsl:text> </xsl:text>
        </xsl:template>