Add generate_help target to the Studio Integration makefile.
[pub/USBasp.git] / LUFA / StudioIntegration / HV1 / lufa_docbook_transform.xslt
index 12b37ed..d543bc0 100644 (file)
                        </title>
 
                        <!-- Add index chapter -->
-                       <xsl:call-template name="generate.top.level.page">
-                               <xsl:with-param name="top.level.page" select="compounddef[@kind = 'page' and @id = 'indexpage']"/>
-                               <xsl:with-param name="top.level.page.title" select="'Library Information'"/>
-                       </xsl:call-template>
+                       <xsl:apply-templates select="compounddef[@kind = 'page' and @id = 'indexpage']">
+                               <xsl:with-param name="element.type" select="'chapter'"/>
+                               <xsl:with-param name="page.title"   select="'Library Information'"/>
+                       </xsl:apply-templates>
 
                        <!-- Add free-floating chapters -->
-                       <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:call-template>
-                               </xsl:if>
-                       </xsl:for-each>
+                       <xsl:apply-templates select="compounddef[@kind = 'page' and not(@id = 'indexpage') and not(//innerpage/@refid = @id)]">
+                               <xsl:with-param name="element.type" select="'chapter'"/>
+                       </xsl:apply-templates>
 
                        <!-- Add Modules chapter -->
                        <chapter>
                                <title>Modules</title>
-                               <xsl:for-each select="compounddef[@kind = 'group']">
-                                       <xsl:if test="not(//innergroup[@refid = current()/@id])">
-                                               <xsl:apply-templates select="current()"/>
-                                       </xsl:if>
-                               </xsl:for-each>
+                               <xsl:apply-templates select="compounddef[@kind = 'group' and not(//innergroup/@refid = @id)]"/>
                        </chapter>
                </book>
        </xsl:template>
 
-       <xsl:template name="generate.top.level.page">
-               <xsl:param name="top.level.page"/>
-               <xsl:param name="top.level.page.title" select="$top.level.page/title"/>
+       <xsl:template match="compounddef[@kind = 'page']">
+               <xsl:param name="element.type" select="'section'"/>
+               <xsl:param name="page.title"   select="title"/>
 
-               <chapter id="{$top.level.page/@id}">
-                       <title>
-                               <xsl:value-of select="$top.level.page.title"/>
-                       </title>
+               <xsl:element name="{$element.type}">
+                       <xsl:attribute name="id">
+                               <xsl:value-of select="@id"/>
+                       </xsl:attribute>
 
-                       <xsl:apply-templates select="$top.level.page/detaileddescription"/>
+                       <xsl:variable name="name">
+                               <xsl:text>LUFA.</xsl:text>
+                               <xsl:value-of select="translate(compoundname, '_', '/')"/>
+                       </xsl:variable>
 
-                       <xsl:for-each select="$top.level.page/innerpage">
-                               <xsl:apply-templates select="ancestor::*/compounddef[@kind = 'page' and @id = current()/@refid]"/>
-                       </xsl:for-each>
-               </chapter>
-       </xsl:template>
+                       <xsl:call-template name="generate.index.id">
+                               <xsl:with-param name="name" select="$name"/>
+                       </xsl:call-template>
 
-       <xsl:template match="compounddef[@kind = 'page']">
-               <section id="{@id}">
                        <title>
-                               <xsl:value-of select="title"/>
+                               <xsl:value-of select="$page.title"/>
                        </title>
 
                        <xsl:apply-templates select="detaileddescription"/>
                        <xsl:for-each select="innerpage">
                                <xsl:apply-templates select="ancestor::*/compounddef[@kind = 'page' and @id = current()/@refid]"/>
                        </xsl:for-each>
-               </section>
+               </xsl:element>
        </xsl:template>
 
        <xsl:template match="compounddef[@kind = 'group']">
                        </title>
 
                        <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:choose>
+                               <xsl:text>LUFA.</xsl:text>
+                               <xsl:value-of select="translate(compoundname, '_', '/')"/>
                        </xsl:variable>
 
-                       <xsl:variable name="name.escaped">
-                               <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:choose>
-                       </xsl:variable>
-
-                       <indexterm id="{$keyword.namespace}.{$name.escaped}">
-                               <primary>Header</primary>
-                               <secondary>
-                                       <xsl:value-of select="$name"/>
-                               </secondary>
-                       </indexterm>
-
                        <xsl:call-template name="generate.index.id">
                                <xsl:with-param name="name" select="$name"/>
                        </xsl:call-template>
 
-                       <indexterm>
-                               <primary>
-                                       <xsl:value-of select="$name"/>
-                               </primary>
-                       </indexterm>
-
-                       <xsl:apply-templates select="detaileddescription" />
+                       <xsl:apply-templates select="detaileddescription"/>
 
-                       <xsl:apply-templates select="sectiondef" />
+                       <xsl:apply-templates select="sectiondef"/>
 
                        <xsl:for-each select="innerclass">
                                <xsl:apply-templates select="ancestor::*/compounddef[@id = current()/@refid]"/>
                                                                                <xsl:if test="starts-with(argsstring, '[')">
                                                                                        <xsl:text>[]</xsl:text>
                                                                                </xsl:if>
-                                                                               <indexterm id="{$keyword.namespace}.{$name}.{name}"/>
+
+                                                                               <xsl:variable name="struct.element.name">
+                                                                                       <xsl:value-of select="$name"/>
+                                                                                       <xsl:text>.</xsl:text>
+                                                                                       <xsl:value-of select="name"/>
+                                                                               </xsl:variable>
+
+                                                                               <xsl:call-template name="generate.index.id">
+                                                                                       <xsl:with-param name="name" select="$struct.element.name"/>
+                                                                               </xsl:call-template>
                                                                        </entry>
                                                                        <entry>
                                                                                <xsl:apply-templates select="detaileddescription"/>
                                                                <entry>
                                                                        <para id="{@id}" xreflabel="{name}">
                                                                                <xsl:value-of select="name"/>
-                                                                               <indexterm id="{$keyword.namespace}.{name}"/>
+
+                                                                               <xsl:call-template name="generate.index.id">
+                                                                                       <xsl:with-param name="name" select="name"/>
+                                                                               </xsl:call-template>
                                                                        </para>
                                                                </entry>
                                                                <entry>
 
        <xsl:template match="title"/>
 
+       <xsl:template match="htmlonly"/>
+
        <xsl:template match="*">
                <xsl:message>NO XSL TEMPLATE MATCH: <xsl:value-of select="name()"/></xsl:message>
        </xsl:template>