diff options
Diffstat (limited to 'doc/dbus/spec-to-docbook.xsl')
-rw-r--r-- | doc/dbus/spec-to-docbook.xsl | 72 |
1 files changed, 42 insertions, 30 deletions
diff --git a/doc/dbus/spec-to-docbook.xsl b/doc/dbus/spec-to-docbook.xsl index 1864414..f69bebd 100644 --- a/doc/dbus/spec-to-docbook.xsl +++ b/doc/dbus/spec-to-docbook.xsl @@ -74,9 +74,15 @@ <refsect1 role="desc"> <title role="desc.title">Description</title> - <para> - <xsl:apply-templates select="//interface/doc:doc"/> - </para> + <xsl:choose> + <xsl:when test="count(//interface/doc:doc) > 0"> + <xsl:apply-templates select="//interface/doc:doc"/> + </xsl:when> + <xsl:otherwise> + <para> + </para> + </xsl:otherwise> + </xsl:choose> </refsect1> <refsect1 role="details"> @@ -115,13 +121,17 @@ <xsl:template name="property-doc"> <xsl:apply-templates select="doc:doc/doc:description"/> - <variablelist role="params"> - <xsl:for-each select="arg"> + <xsl:choose> + <xsl:when test="count(arg) > 0"> + <variablelist role="params"> + <xsl:for-each select="arg"> <varlistentry><term><parameter><xsl:value-of select="@name"/></parameter>:</term> <listitem><simpara><xsl:value-of select="doc:doc/doc:summary"/></simpara></listitem> </varlistentry> - </xsl:for-each> - </variablelist> + </xsl:for-each> + </variablelist> + </xsl:when> + </xsl:choose> <xsl:apply-templates select="doc:doc/doc:since"/> <xsl:apply-templates select="doc:doc/doc:deprecated"/> @@ -143,23 +153,25 @@ <indexterm><primary><xsl:value-of select="@name"/></primary><secondary><xsl:value-of select="$basename"/></secondary></indexterm> <programlisting>'<xsl:value-of select="@name"/>'<xsl:call-template name="pad-spaces"><xsl:with-param name="width" select="2"/></xsl:call-template> <xsl:call-template name="property-args"><xsl:with-param name="indent" select="string-length(@name) + 2"/></xsl:call-template></programlisting> - </refsect2> - <xsl:call-template name="property-doc"/> - + </refsect2> </xsl:for-each> </xsl:template> <xsl:template name="signal-doc"> <xsl:apply-templates select="doc:doc/doc:description"/> - <variablelist role="params"> - <xsl:for-each select="arg"> + <xsl:choose> + <xsl:when test="count(arg) > 0"> + <variablelist role="params"> + <xsl:for-each select="arg"> <varlistentry><term><parameter><xsl:value-of select="@name"/></parameter>:</term> <listitem><simpara><xsl:value-of select="doc:doc/doc:summary"/></simpara></listitem> </varlistentry> - </xsl:for-each> - </variablelist> + </xsl:for-each> + </variablelist> + </xsl:when> + </xsl:choose> <xsl:apply-templates select="doc:doc/doc:since"/> <xsl:apply-templates select="doc:doc/doc:deprecated"/> @@ -179,10 +191,8 @@ <title><anchor role="function"><xsl:attribute name="id"><xsl:value-of select="$basename"/>::<xsl:value-of select="@name"/></xsl:attribute></anchor>The <xsl:value-of select="@name"/> signal</title> <indexterm><primary><xsl:value-of select="@name"/></primary><secondary><xsl:value-of select="$basename"/></secondary></indexterm> <programlisting><xsl:value-of select="@name"/> (<xsl:call-template name="signal-args"><xsl:with-param name="indent" select="string-length(@name) + 2"/><xsl:with-param name="prefix" select="."/></xsl:call-template>)</programlisting> - </refsect2> - <xsl:call-template name="signal-doc"/> - + </refsect2> </xsl:for-each> </xsl:template> @@ -238,10 +248,10 @@ <xsl:template name="do-listitems"> <xsl:for-each select="doc:item"> - <listitem> + <listitem><para> <xsl:call-template name="listitems-do-term"><xsl:with-param name="str" select="doc:term"/></xsl:call-template> <xsl:apply-templates select="doc:definition"/> - </listitem> + </para></listitem> </xsl:for-each> </xsl:template> @@ -371,20 +381,24 @@ See also: <xsl:template name="method-doc"> <xsl:apply-templates select="doc:doc/doc:description"/> - <variablelist role="params"> - <xsl:for-each select="arg"> + <xsl:choose> + <xsl:when test="count(arg) > 0"> + <variablelist role="params"> + <xsl:for-each select="arg"> <varlistentry><term><parameter><xsl:value-of select="@name"/></parameter>:</term> <listitem><simpara><xsl:apply-templates select="doc:doc/doc:summary"/></simpara></listitem> </varlistentry> - </xsl:for-each> - </variablelist> + </xsl:for-each> + </variablelist> + </xsl:when> + </xsl:choose> <xsl:apply-templates select="doc:doc/doc:since"/> <xsl:apply-templates select="doc:doc/doc:deprecated"/> <xsl:choose> <xsl:when test="count(doc:doc/doc:errors) > 0"> - <refsect3> + <note> <title>Errors</title> <variablelist role="errors"> <xsl:for-each select="doc:doc/doc:errors/doc:error"> @@ -394,16 +408,16 @@ See also: </varlistentry> </xsl:for-each> </variablelist> - </refsect3> + </note> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="count(doc:doc/doc:permission) > 0"> - <refsect3> + <note> <title>Permissions</title> <xsl:apply-templates select="doc:doc/doc:permission"/> - </refsect3> + </note> </xsl:when> </xsl:choose> @@ -422,10 +436,8 @@ See also: <title><anchor role="function"><xsl:attribute name="id"><xsl:value-of select="$basename"/>.<xsl:value-of select="@name"/></xsl:attribute></anchor><xsl:value-of select="@name"/> ()</title> <indexterm><primary><xsl:value-of select="@name"/></primary><secondary><xsl:value-of select="$basename"/></secondary></indexterm> <programlisting><xsl:value-of select="@name"/> (<xsl:call-template name="method-args"><xsl:with-param name="indent" select="string-length(@name) + 2"/><xsl:with-param name="prefix" select="."/></xsl:call-template>)</programlisting> - </refsect2> - <xsl:call-template name="method-doc"/> - + </refsect2> </xsl:for-each> </xsl:template> |