diff options
author | Daniel Elstner <danielk@openismus.com> | 2009-09-03 18:25:11 +0200 |
---|---|---|
committer | Daniel Elstner <danielk@openismus.com> | 2009-09-03 18:25:11 +0200 |
commit | cb406024b3a8269bfb5e931db36162552469abd9 (patch) | |
tree | c3baf2b482ee77584ae11f06a70d39f74576d71a /util | |
parent | 01695da9518c0f79a9082b28fffc2d6094070079 (diff) | |
download | mm-common-cb406024b3a8269bfb5e931db36162552469abd9.tar.gz |
Create Devhelp chapters only for existing content
* util/tagfile-to-devhelp2.xsl (chapters): Output the <sub> elements
only if they will have at least one child node. This way, there will
be no broken chapter link in the Devhelp documentation if the module
does not define any Doxygen groups, for instance.
Diffstat (limited to 'util')
-rw-r--r-- | util/tagfile-to-devhelp2.xsl | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/util/tagfile-to-devhelp2.xsl b/util/tagfile-to-devhelp2.xsl index f534074..f834051 100644 --- a/util/tagfile-to-devhelp2.xsl +++ b/util/tagfile-to-devhelp2.xsl @@ -29,21 +29,38 @@ <book title="{$book_title}" name="{$book_name}" base="{$book_base}" link="index.html" version="2" language="c++"> <chapters> - <sub name="Modules" link="modules.html"> + <xsl:variable name="modules"> <xsl:apply-templates select="tagfile/compound[@kind='group']" mode="module"> <xsl:sort lang="en" select="title"/> </xsl:apply-templates> - </sub> - <sub name="Namespaces" link="namespaces.html"> + </xsl:variable> + <xsl:if test="$modules"> + <sub name="Modules" link="modules.html"> + <xsl:copy-of select="$modules"/> + </sub> + </xsl:if> + + <xsl:variable name="namespaces"> <xsl:apply-templates select="tagfile/compound[@kind='namespace']" mode="sub"> <xsl:sort lang="en" case-order="upper-first" select="name"/> </xsl:apply-templates> - </sub> - <sub name="Classes" link="classes.html"> + </xsl:variable> + <xsl:if test="$namespaces"> + <sub name="Namespaces" link="namespaces.html"> + <xsl:copy-of select="$namespaces"/> + </sub> + </xsl:if> + + <xsl:variable name="classes"> <xsl:apply-templates select="tagfile/compound[@kind='class' or @kind='struct']" mode="sub"> <xsl:sort lang="en" case-order="upper-first" select="name"/> </xsl:apply-templates> - </sub> + </xsl:variable> + <xsl:if test="$classes"> + <sub name="Classes" link="classes.html"> + <xsl:copy-of select="$classes"/> + </sub> + </xsl:if> </chapters> <functions> <xsl:apply-templates select="tagfile/compound" mode="compound"> |