Add check to the Doxygen->Docbook transform to warning on untemplated items. Add additional templates to ensure the output documentation does not have unescaped or unformatted entries.

Dean Camera 12 years ago
parent db929fd4c8
commit fd5e98d380
  1. 60
      LUFA/StudioIntegration/HV1/lufa_docbook_transform.xslt

@ -103,10 +103,6 @@
</chapter> </chapter>
</xsl:template> </xsl:template>
<xsl:template match="compounddef">
<!-- Discard compounddef elements unless a later template matches -->
</xsl:template>
<xsl:template match="compounddef[@kind = 'page']"> <xsl:template match="compounddef[@kind = 'page']">
<section id="{@id}"> <section id="{@id}">
<title> <title>
@ -305,16 +301,14 @@
</xsl:template> </xsl:template>
<xsl:template match="memberdef[@kind = 'enum']"> <xsl:template match="memberdef[@kind = 'enum']">
<xsl:variable name="name" select="name"/>
<section id="{@id}" xreflabel="{name}"> <section id="{@id}" xreflabel="{name}">
<title> <title>
<xsl:text>Enum </xsl:text> <xsl:text>Enum </xsl:text>
<xsl:value-of select="$name"/> <xsl:value-of select="name"/>
</title> </title>
<xsl:call-template name="generate.index.id"> <xsl:call-template name="generate.index.id">
<xsl:with-param name="name" select="$name"/> <xsl:with-param name="name" select="name"/>
</xsl:call-template> </xsl:call-template>
<xsl:apply-templates select="detaileddescription"/> <xsl:apply-templates select="detaileddescription"/>
@ -334,7 +328,7 @@
<entry> <entry>
<para id="{@id}" xreflabel="{name}"> <para id="{@id}" xreflabel="{name}">
<xsl:value-of select="name"/> <xsl:value-of select="name"/>
<indexterm id="{$keyword.namespace}.{$name}.{name}"/> <indexterm id="{$keyword.namespace}.{name}"/>
</para> </para>
</entry> </entry>
<entry> <entry>
@ -588,16 +582,16 @@
</entry> </entry>
</xsl:template> </xsl:template>
<xsl:template match="type"> <xsl:template match="parameterdescription">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="para">
<para> <para>
<xsl:apply-templates/> <xsl:apply-templates/>
</para> </para>
</xsl:template> </xsl:template>
<xsl:template match="type">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="bold"> <xsl:template match="bold">
<emphasis role="bold"> <emphasis role="bold">
<xsl:apply-templates/> <xsl:apply-templates/>
@ -614,12 +608,20 @@
<xsl:apply-templates/> <xsl:apply-templates/>
</xsl:template> </xsl:template>
<xsl:template match="computeroutput"> <xsl:template match="mdash | ndash">
<xsl:text>--</xsl:text>
</xsl:template>
<xsl:template match="computeroutput | preformatted">
<computeroutput> <computeroutput>
<xsl:apply-templates/> <xsl:apply-templates/>
</computeroutput> </computeroutput>
</xsl:template> </xsl:template>
<xsl:template match="codeline">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="ulink"> <xsl:template match="ulink">
<ulink url="{@url}"> <ulink url="{@url}">
<xsl:value-of select="."/> <xsl:value-of select="."/>
@ -638,6 +640,12 @@
</subscript> </subscript>
</xsl:template> </xsl:template>
<xsl:template match="para">
<para>
<xsl:apply-templates/>
</para>
</xsl:template>
<xsl:template match="ref"> <xsl:template match="ref">
<xsl:choose> <xsl:choose>
<!-- Don't show links inside program listings --> <!-- Don't show links inside program listings -->
@ -659,6 +667,12 @@
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<xsl:template match="entry">
<entry>
<xsl:apply-templates/>
</entry>
</xsl:template>
<xsl:template match="table"> <xsl:template match="table">
<xsl:choose> <xsl:choose>
<xsl:when test="caption"> <xsl:when test="caption">
@ -683,22 +697,14 @@
<thead> <thead>
<xsl:for-each select="row[1]"> <xsl:for-each select="row[1]">
<row> <row>
<xsl:for-each select="entry"> <xsl:apply-templates select="entry"/>
<entry>
<xsl:apply-templates select="."/>
</entry>
</xsl:for-each>
</row> </row>
</xsl:for-each> </xsl:for-each>
</thead> </thead>
<tbody> <tbody>
<xsl:for-each select="row[position() != 1]"> <xsl:for-each select="row[position() != 1]">
<row> <row>
<xsl:for-each select="entry"> <xsl:apply-templates select="entry"/>
<entry>
<xsl:apply-templates select="."/>
</entry>
</xsl:for-each>
</row> </row>
</xsl:for-each> </xsl:for-each>
</tbody> </tbody>
@ -783,4 +789,8 @@
<xsl:template match="title"/> <xsl:template match="title"/>
<xsl:template match="*">
<xsl:message>NO XSL TEMPLATE MATCH: <xsl:value-of select="name()"/></xsl:message>
</xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

Loading…
Cancel
Save