]> granicus.if.org Git - docbook-dsssl/commitdiff
Count refsynopsisdiv as a section for counting section levels; attempt to support...
authorNorman Walsh <ndw@nwalsh.com>
Fri, 31 Dec 2004 13:21:35 +0000 (13:21 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Fri, 31 Dec 2004 13:21:35 +0000 (13:21 +0000)
xsl/html/refentry.xsl

index 2020e1a753f6f6f2cd6efa27448280217c50b5e8..3fa0918d0790f050bef2812b668ad425a3565372 100644 (file)
   <xsl:variable name="refentrytitle" select="$refmeta//refentrytitle"/>
   <xsl:variable name="refnamediv" select="$node//refnamediv"/>
   <xsl:variable name="refname" select="$refnamediv//refname"/>
+  <xsl:variable name="refdesc" select="$refnamediv//refdescriptor"/>
   <xsl:variable name="title">
     <xsl:choose>
       <xsl:when test="$refentrytitle">
         <xsl:apply-templates select="$refentrytitle[1]" mode="title"/>
       </xsl:when>
+      <xsl:when test="$refdesc">
+       <xsl:apply-templates select="$refdesc[1]" mode="title"/>
+      </xsl:when>
       <xsl:when test="$refname">
         <xsl:apply-templates select="$refname[1]" mode="title"/>
       </xsl:when>
@@ -89,7 +93,7 @@
 
 <xsl:template match="refentry/docinfo|refentry/refentryinfo"></xsl:template>
 
-<xsl:template match="refentrytitle|refname" mode="title">
+<xsl:template match="refentrytitle|refname|refdescriptor" mode="title">
   <xsl:apply-templates/>
 </xsl:template>
 
 </xsl:template>
 
 <xsl:template match="refname">
-  <xsl:apply-templates/>
-  <xsl:if test="following-sibling::refname">
-    <xsl:text>, </xsl:text>
+  <xsl:if test="not(preceding-sibling::refdescriptor)">
+    <xsl:apply-templates/>
+    <xsl:if test="following-sibling::refname">
+      <xsl:text>, </xsl:text>
+    </xsl:if>
   </xsl:if>
 </xsl:template>
 
 </xsl:template>
 
 <xsl:template match="refdescriptor">
-  <!-- todo: finish this -->
+  <xsl:apply-templates/>
 </xsl:template>
 
 <xsl:template match="refclass">
 <xsl:template match="refsection/title">
   <!-- the ID is output in the block.object call for refsect1 -->
   <xsl:variable name="level" select="count(ancestor-or-self::refsection)"/>
+  <xsl:variable name="refsynopsisdiv">
+    <xsl:text>0</xsl:text>
+    <xsl:if test="ancestor::refsynopsisdiv">1</xsl:if>
+  </xsl:variable>
   <xsl:variable name="hlevel">
     <xsl:choose>
-      <xsl:when test="$level &gt; 5">6</xsl:when>
+      <xsl:when test="$level+$refsynopsisdiv &gt; 5">6</xsl:when>
       <xsl:otherwise>
-        <xsl:value-of select="$level+1"/>
+        <xsl:value-of select="$level+1+$refsynopsisdiv"/>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:variable>