doc: Each class in doxygen output is a section
authorBill Spitzak <spitzak@gmail.com>
Fri, 19 Dec 2014 04:15:07 +0000 (20:15 -0800)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Fri, 19 Dec 2014 14:21:36 +0000 (16:21 +0200)
All the methods belonging to the class are listed with it, making
it much easier to find them.

I dumped all other functions into a section called "Functions" at
the end.

Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
doc/publican/doxygen-to-publican.xsl

index 0ed7030..08a71e7 100644 (file)
       'SC', 'sc')"/>.
     </para>
 
-    <xsl:if test="/doxygen/compounddef[@kind='class']">
+    <xsl:apply-templates select="/doxygen/compounddef[@kind='class']" />
+
+    <section id="{$which}-Functions">
+      <title>Functions</title>
+      <para />
       <variablelist>
-        <xsl:apply-templates select="/doxygen/compounddef" />
+        <xsl:apply-templates select="/doxygen/compounddef[@kind!='class']/sectiondef/memberdef" />
       </variablelist>
-    </xsl:if>
-
-    <para>Methods for the respective classes.</para>
+    </section>
 
-    <variablelist>
-      <xsl:apply-templates select="/doxygen/compounddef/sectiondef/memberdef" />
-    </variablelist>
   </appendix>
 </xsl:template>
 
   <programlisting><xsl:apply-templates /></programlisting>
 </xsl:template>
 
+<!-- stops cross-references in the section titles -->
+<xsl:template match="briefdescription">
+  <xsl:value-of select="." />
+</xsl:template>
+
 <!-- this opens a para for each detaileddescription/para. I could not find a
      way to extract the right text for the description from the
      source otherwise. Downside: we can't use para for return value, "see
 <!-- classes -->
 <xsl:template match="compounddef" >
   <xsl:if test="@kind = 'class'">
-    <varlistentry id="{$which}-{@id}">
-        <term>
+    <section id="{$which}-{@id}">
+        <title>
             <xsl:value-of select="compoundname" />
             <xsl:if test="normalize-space(briefdescription) != ''">
                 - <xsl:apply-templates select="briefdescription" />
             </xsl:if>
-        </term>
+        </title>
 
-        <listitem>
-          <xsl:apply-templates select="detaileddescription" />
-        </listitem>
-    </varlistentry>
+        <xsl:apply-templates select="detaileddescription" />
+
+        <variablelist>
+          <xsl:apply-templates select="sectiondef/memberdef" />
+        </variablelist>
+    </section>
   </xsl:if>
 </xsl:template>
 </xsl:stylesheet>