doc: Reduce the validation errors of the docbook input
authorBill Spitzak <spitzak@gmail.com>
Fri, 19 Dec 2014 04:15:05 +0000 (20:15 -0800)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Fri, 19 Dec 2014 14:10:36 +0000 (16:10 +0200)
(this is different from previous version as it removes some
broken and irrelevant changes to the protocol appendix).

This removes all the validation errors except for missing link
targets. You can test this by removing the --skip-validation
from doc/publican/Makefile.am.

Main changes are to avoid nesting <para> commands. I also used
<simpara> in some places to reduce the amount of blank space.
And the reference id's are prefixed with the chapter name to
avoid collisions between libclient and libserver.

PS: it would be useful if somebody who actually knows something
about xslt would come up with a way to translate a block of text
makde of <para> commands unchanged, but add <para> around plain
text. Most of the difficulty is that doxygen's output is rather
inconsistent here.

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

index 47bdc5a..5adbfa6 100644 (file)
     </para>
 
     <xsl:if test="/doxygen/compounddef[@kind='class']">
-      <para>
-        <variablelist>
-          <xsl:apply-templates select="/doxygen/compounddef" />
-        </variablelist>
-      </para>
+      <variablelist>
+        <xsl:apply-templates select="/doxygen/compounddef" />
+      </variablelist>
     </xsl:if>
 
     <para>Methods for the respective classes.</para>
 
-    <para>
     <variablelist>
-    <xsl:apply-templates select="/doxygen/compounddef/sectiondef/memberdef" />
+      <xsl:apply-templates select="/doxygen/compounddef/sectiondef/memberdef" />
     </variablelist>
-    </para>
   </appendix>
 </xsl:template>
 
@@ -60,7 +56,7 @@
           <xsl:apply-templates select="parameternamelist/parametername"/>
         </term>
       <listitem>
-        <xsl:apply-templates select="parameterdescription"/>
+        <simpara><xsl:apply-templates select="parameterdescription"/></simpara>
       </listitem>
     </varlistentry>
 </xsl:template>
@@ -74,7 +70,7 @@
 </xsl:template>
 
 <xsl:template match="ref">
-  <link linkend="{@refid}"><xsl:value-of select="." /></link>
+  <link linkend="{$which}{@refid}"><xsl:value-of select="." /></link>
 </xsl:template>
 
 <xsl:template match="simplesect[@kind='return']">
     <varlistentry>
       <term>Returns:</term>
       <listitem>
-        <xsl:apply-templates />
+        <simpara><xsl:apply-templates /></simpara>
       </listitem>
     </varlistentry>
   </variablelist>
 </xsl:template>
 
 <xsl:template match="simplesect[@kind='see']">
-  <para>
-    See also: <xsl:apply-templates />
-  </para>
+  See also: <xsl:apply-templates />
 </xsl:template>
 
 <xsl:template match="simplesect[@kind='since']">
-  <para>
-    Since: <xsl:apply-templates />
-  </para>
+  Since: <xsl:apply-templates />
 </xsl:template>
 
 <xsl:template match="simplesect[@kind='note']">
 <!-- methods -->
 <xsl:template match="memberdef" >
   <xsl:if test="@kind = 'function' and @static = 'no'">
-    <varlistentry id="{@id}">
+    <varlistentry id="{$which}{@id}">
         <term>
           <xsl:value-of select="name"/>
           <xsl:if test="normalize-space(briefdescription) != ''">
           </xsl:if>
         </term>
         <listitem>
-          <para>
-            <synopsis>
-              <xsl:apply-templates select="definition"/><xsl:apply-templates select="argsstring"/>
-            </synopsis>
-          </para>
+          <synopsis>
+            <xsl:apply-templates select="definition"/><xsl:apply-templates select="argsstring"/>
+          </synopsis>
           <xsl:apply-templates select="detaileddescription" />
         </listitem>
     </varlistentry>
-    </xsl:if>
+  </xsl:if>
 </xsl:template>
 
 <!-- classes -->
 <xsl:template match="compounddef" >
-    <xsl:if test="@kind = 'class'">
-    <varlistentry id="{@id}">
+  <xsl:if test="@kind = 'class'">
+    <varlistentry id="{$which}{@id}">
         <term>
             <xsl:value-of select="compoundname" />
             <xsl:if test="normalize-space(briefdescription) != ''">
           <xsl:apply-templates select="detaileddescription" />
         </listitem>
     </varlistentry>
-    </xsl:if>
+  </xsl:if>
 </xsl:template>
 </xsl:stylesheet>
index fb1a816..57b3139 100644 (file)
   <term>
     <link linkend="protocol-spec-interface-{@name}">
       <xsl:value-of select="@name" />
-      <xsl:if test="description/@summary">
-        - <xsl:value-of select="description/@summary" />
-      </xsl:if>
     </link>
   </term>
+  <listitem>
+    <simpara>
+      <xsl:value-of select="description/@summary" />
+    </simpara>
+  </listitem>
 </varlistentry>
 </xsl:template>
 
index 443228d..a43c9fa 100644 (file)
@@ -95,9 +95,7 @@
           <para>Value: <xsl:value-of select="@value"/></para>
         </xsl:if>
         <xsl:if test="@summary" >
-          <para>
-            <xsl:value-of select="@summary"/>
-          </para>
+          <para><xsl:value-of select="@summary"/></para>
         </xsl:if>
     </listitem>
   </varlistentry>