Simplify LUFA Doxygen to Docbook transform, use parameterized page compounddef template.

pull/1469/head
Dean Camera 12 years ago
parent 9891bf7cc3
commit f6d0cdb817

@ -60,53 +60,35 @@
</title> </title>
<!-- Add index chapter --> <!-- Add index chapter -->
<xsl:call-template name="generate.top.level.page"> <xsl:apply-templates select="compounddef[@kind = 'page' and @id = 'indexpage']">
<xsl:with-param name="top.level.page" select="compounddef[@kind = 'page' and @id = 'indexpage']"/> <xsl:with-param name="element.type" select="'chapter'"/>
<xsl:with-param name="top.level.page.title" select="'Library Information'"/> <xsl:with-param name="page.title" select="'Library Information'"/>
</xsl:call-template> </xsl:apply-templates>
<!-- Add free-floating chapters --> <!-- Add free-floating chapters -->
<xsl:for-each select="compounddef[@kind = 'page' and not(@id = 'indexpage')]"> <xsl:apply-templates select="compounddef[@kind = 'page' and not(@id = 'indexpage') and not(//innerpage/@refid = @id)]">
<xsl:if test="not(//innerpage/@refid = current()/@id)"> <xsl:with-param name="element.type" select="'chapter'"/>
<xsl:call-template name="generate.top.level.page"> </xsl:apply-templates>
<xsl:with-param name="top.level.page" select="current()"/>
</xsl:call-template>
</xsl:if>
</xsl:for-each>
<!-- Add Modules chapter --> <!-- Add Modules chapter -->
<chapter> <chapter>
<title>Modules</title> <title>Modules</title>
<xsl:for-each select="compounddef[@kind = 'group']"> <xsl:apply-templates select="compounddef[@kind = 'group' and not(//innergroup/@refid = @id)]"/>
<xsl:if test="not(//innergroup/@refid = current()/@id)">
<xsl:apply-templates select="current()"/>
</xsl:if>
</xsl:for-each>
</chapter> </chapter>
</book> </book>
</xsl:template> </xsl:template>
<xsl:template name="generate.top.level.page"> <xsl:template match="compounddef[@kind = 'page']">
<xsl:param name="top.level.page"/> <xsl:param name="element.type" select="'section'"/>
<xsl:param name="top.level.page.title" select="$top.level.page/title"/> <xsl:param name="page.title" select="title"/>
<chapter id="{$top.level.page/@id}">
<title>
<xsl:value-of select="$top.level.page.title"/>
</title>
<xsl:apply-templates select="$top.level.page/detaileddescription"/>
<xsl:for-each select="$top.level.page/innerpage"> <xsl:element name="{$element.type}">
<xsl:apply-templates select="ancestor::*/compounddef[@kind = 'page' and @id = current()/@refid]"/> <xsl:attribute name="id">
</xsl:for-each> <xsl:value-of select="@id"/>
</chapter> </xsl:attribute>
</xsl:template>
<xsl:template match="compounddef[@kind = 'page']">
<section id="{@id}">
<title> <title>
<xsl:value-of select="title"/> <xsl:value-of select="$page.title"/>
</title> </title>
<xsl:apply-templates select="detaileddescription"/> <xsl:apply-templates select="detaileddescription"/>
@ -114,7 +96,7 @@
<xsl:for-each select="innerpage"> <xsl:for-each select="innerpage">
<xsl:apply-templates select="ancestor::*/compounddef[@kind = 'page' and @id = current()/@refid]"/> <xsl:apply-templates select="ancestor::*/compounddef[@kind = 'page' and @id = current()/@refid]"/>
</xsl:for-each> </xsl:for-each>
</section> </xsl:element>
</xsl:template> </xsl:template>
<xsl:template match="compounddef[@kind = 'group']"> <xsl:template match="compounddef[@kind = 'group']">

Loading…
Cancel
Save