doc: preserve links produced by Doxygen
authorBill Spitzak <spitzak@gmail.com>
Wed, 12 Nov 2014 02:42:56 +0000 (18:42 -0800)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Tue, 25 Nov 2014 14:14:51 +0000 (16:14 +0200)
These links are pretty useful for navigation, though sometimes excessive
(you can turn them off by putting % before the word in the comment).

I had to turn off validation because it failed on missing and duplicate
target id's, which this produces.

doc/publican/Makefile.am
doc/publican/doxygen-to-publican.xsl

index b30a471..9fc4e0b 100644 (file)
@@ -47,6 +47,7 @@ if HAVE_XMLTO
 if HAVE_XSLTPROC
 noinst_DATA = Wayland $(publican_targets)
 XMLTO_PARAM = \
+       --skip-validation \
        --stringparam chunk.section.depth=0 \
        --stringparam toc.section.depth=1 \
        --stringparam html.stylesheet=css/default.css
index 99193e1..7f7abe9 100644 (file)
@@ -61,7 +61,7 @@
 </xsl:template>
 
 <xsl:template match="ref">
-  <emphasis><xsl:apply-templates /></emphasis>
+  <link linkend="{@refid}"><xsl:value-of select="." /></link>
 </xsl:template>
 
 <xsl:template match="simplesect[@kind='return']">
   <itemizedlist>
     <listitem>
       <para>
-        See also:
-        <xsl:for-each select="para/ref">
-          <emphasis><xsl:apply-templates /><xsl:text> </xsl:text></emphasis>
-        </xsl:for-each>
+        See also: <xsl:apply-templates />
       </para>
     </listitem>
   </itemizedlist>
@@ -94,7 +91,7 @@
   <itemizedlist>
     <listitem>
       <para>
-        Since: <xsl:apply-templates select="para"/>
+        Since: <xsl:apply-templates />
       </para>
     </listitem>
   </itemizedlist>
   <emphasis>Note: <xsl:apply-templates /></emphasis>
 </xsl:template>
 
-<xsl:template match="programlisting//sp">
-  <xsl:text> </xsl:text>
-</xsl:template>
-
 <xsl:template match="sp">
   <xsl:text> </xsl:text>
 </xsl:template>
 <!-- methods -->
 <xsl:template match="memberdef" >
   <xsl:if test="@kind = 'function' and @static = 'no'">
-    <varlistentry>
+    <varlistentry id="{@id}">
         <term>
-          <xsl:apply-templates select="name"/>
+          <xsl:value-of select="name"/>
         - <xsl:apply-templates select="briefdescription" />
         </term>
         <listitem>
 
 <!-- classes -->
 <xsl:template match="compounddef" >
-    <xsl:if test="@kind = 'class' ">
-    <varlistentry>
+    <xsl:if test="@kind = 'class'">
+    <varlistentry id="{@id}">
         <term>
             <xsl:apply-templates select="compoundname" />
             <xsl:if test="briefdescription">
         </term>
 
         <listitem>
-          <xsl:apply-templates select="detaileddescription/para" />
+          <xsl:apply-templates select="detaileddescription" />
         </listitem>
     </varlistentry>
     </xsl:if>