[PATCH 3/7] doc: Each class in doxygen output is a section

Bill Spitzak spitzak at gmail.com
Thu Dec 18 20:15:07 PST 2014


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.
---
 doc/publican/doxygen-to-publican.xsl |   36 ++++++++++++++++++++--------------
 1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/doc/publican/doxygen-to-publican.xsl b/doc/publican/doxygen-to-publican.xsl
index 0ed7030..08a71e7 100644
--- a/doc/publican/doxygen-to-publican.xsl
+++ b/doc/publican/doxygen-to-publican.xsl
@@ -36,17 +36,16 @@
       '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>
 
@@ -104,6 +103,11 @@
   <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
@@ -143,18 +147,20 @@
 <!-- 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>
-- 
1.7.9.5



More information about the wayland-devel mailing list