]> granicus.if.org Git - docbook-dsssl/commitdiff
Handle refsection as well as refsect1|refsect2 in the manpages stylesheet.
authorTim Waugh <twaugh@redhat.com>
Thu, 15 May 2003 15:11:47 +0000 (15:11 +0000)
committerTim Waugh <twaugh@redhat.com>
Thu, 15 May 2003 15:11:47 +0000 (15:11 +0000)
xsl/manpages/docbook.xsl

index 5013c17b936dbfae0e39f9b9c03bd2a734c95866..a0354397d8b7e5baf9aa2818638d2b3717f5ed9f 100644 (file)
   <xsl:text>\fR</xsl:text>
 </xsl:template>
 
-<xsl:template match="refsect2">
-  <xsl:text>&#10;.SS "</xsl:text>
-  <xsl:value-of select="title[1]"/>
-  <xsl:text>"&#10;</xsl:text>
-  <xsl:apply-templates/>
-</xsl:template>
-
 <xsl:template match="caution|important|note|tip|warning">
   <xsl:text>&#10;.RS&#10;.Sh "</xsl:text>
   <!-- capitalize word -->
   <xsl:text>&#10;.RE&#10;</xsl:text>
 </xsl:template> 
 
-<xsl:template match="refsect1">
-  <xsl:text>&#10;.SH "</xsl:text>
-  <xsl:value-of select="translate(title[1],'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
-  <xsl:text>"
-</xsl:text>
+<xsl:template match="refsection|refsect1">
+  <xsl:choose>
+    <xsl:when test="ancestor::refsection">
+      <xsl:text>&#10;.SS "</xsl:text>
+      <xsl:value-of select="title[1]"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:text>&#10;.SH "</xsl:text>
+      <xsl:value-of select="translate(title[1],'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
+    </xsl:otherwise>
+  </xsl:choose>
+  <xsl:text>"&#10;</xsl:text>
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="refsect2">
+  <xsl:text>&#10;.SS "</xsl:text>
+  <xsl:value-of select="title[1]"/>
+  <xsl:text>"&#10;</xsl:text>
   <xsl:apply-templates/>
 </xsl:template>