]> granicus.if.org Git - docbook-dsssl/commitdiff
Changed backend handling for generating titles for SH sections and
authorMichael Smith <xmldoc@users.sourceforge.net>
Tue, 26 Feb 2008 10:09:01 +0000 (10:09 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Tue, 26 Feb 2008 10:09:01 +0000 (10:09 +0000)
for cross-references to those sections. This should have no effect
on TTY output (behavior should remain the same hopefully) but
results in titles in normal case (instead of uppercase) in PS
output.

xsl/manpages/refentry.xsl

index 15d59b9873d30067afbb95e589bafe75e15cf335..7f42d2f4f0be0ef28b115bf0c0dea96c0d3c021a 100644 (file)
@@ -24,7 +24,7 @@
       <xsl:otherwise>
         <xsl:call-template name="mark.subheading"/>
         <xsl:text>.SH "</xsl:text>
-        <xsl:apply-templates select="." mode="title.markup"/>
+        <xsl:apply-templates select="." mode="subheading.markup"/>
         <xsl:text>"</xsl:text>
         <xsl:text>&#10;</xsl:text>
       </xsl:otherwise>
   </xsl:template>
 
   <xsl:template match="refsynopsisdiv">
-    <xsl:call-template name="mark.subheading"/>
-    <xsl:text>.SH "</xsl:text>
-    <xsl:apply-templates select="." mode="title.markup"/>
-    <xsl:text>"&#10;</xsl:text>
-    <xsl:call-template name="mark.subheading"/>
+    <xsl:call-template name="make.subheading">
+      <xsl:with-param name="title">
+        <xsl:apply-templates select="." mode="subheading.markup"/>
+      </xsl:with-param>
+    </xsl:call-template>
     <xsl:apply-templates/>
   </xsl:template>
 
   <xsl:template match="refsect1|refentry/refsection">
     <xsl:variable name="title">
-      <xsl:apply-templates select="." mode="title.markup"/>
+      <xsl:apply-templates select="." mode="subheading.markup"/>
     </xsl:variable>
-    <xsl:call-template name="mark.subheading"/>
-    <xsl:text>.SH "</xsl:text>
-    <xsl:value-of select="normalize-space($title)"/>
-    <xsl:text>"&#10;</xsl:text>
-    <xsl:call-template name="mark.subheading"/>
+    <xsl:call-template name="make.subheading">
+      <xsl:with-param name="title">
+        <xsl:value-of select="normalize-space($title)"/>
+      </xsl:with-param>
+    </xsl:call-template>
     <xsl:apply-templates/>
   </xsl:template>
 
@@ -92,7 +92,6 @@
                   |refsectioninfo/title
                   |refsect1info/title
                   |title)[1]/node()"/>
-      
     </xsl:variable>
     <xsl:text>.SS "</xsl:text>
     <xsl:value-of select="normalize-space($title)"/>
 
   <!-- ==================================================================== -->
 
-  <!-- * Use uppercase to render titles of all instances of Refsect1 or -->
-  <!-- * top-level Refsection, including in cross-references -->
   <xsl:template match="refsect1|refentry/refsection"
-                mode="title.markup">
+                mode="subheading.markup">
     <xsl:variable name="title" select="(info/title
-                                       |refsectioninfo/title
-                                       |refsect1info/title
-                                       |title)[1]"/>
-    <xsl:call-template name="string.upper">
-      <xsl:with-param name="string">
+      |refsectioninfo/title
+      |refsect1info/title
+      |title)[1]"/>
+    <xsl:variable name="string">
+      <xsl:apply-templates select="$title" mode="title.markup"/>
+    </xsl:variable>
+    <xsl:call-template name="make.title.pair">
+      <xsl:with-param name="title" select="$string"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="refsect1|refentry/refsection"
+    mode="title.markup">
+    <!-- * Note: This template is used just for generating the text for -->
+    <!-- * cross-references to Refsect1 or top-level Refsection instances. -->
+    <xsl:variable name="title" select="(info/title
+      |refsectioninfo/title
+      |refsect1info/title
+      |title)[1]"/>
+    <xsl:call-template name="process.SH.xref">
+      <xsl:with-param name="title">
         <xsl:apply-templates select="$title" mode="title.markup"/>
       </xsl:with-param>
     </xsl:call-template>
   <!-- * Output of Titles from Xref with Endterm needs to be handled -->
   <!-- * separately from output for Endterm-less Xref -->
   <xsl:template match="refsect1/title
-                       |refentry/refsection/title
-                       |refsynopsisdiv/title"
-                mode="endterm">
-    <xsl:call-template name="string.upper">
-      <xsl:with-param name="string">
+    |refentry/refsection/title
+    |refsynopsisdiv/title"
+    mode="endterm">
+    <xsl:call-template name="process.SH.xref">
+      <xsl:with-param name="title">
         <xsl:apply-templates/>
       </xsl:with-param>
     </xsl:call-template>
   </xsl:template>
 
-  <!-- * Use uppercase to render titles of all instances of Refsynopsisdiv, -->
-  <!-- * including in cross-references -->
+  <xsl:template match="refsynopsisdiv" mode="subheading.markup">
+    <xsl:param name="allow-anchors" select="0"/>
+    <xsl:variable name="title">
+      <xsl:call-template name="get.refsynopsisdiv.title">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+      </xsl:call-template>
+    </xsl:variable>
+    <xsl:call-template name="make.title.pair">
+      <xsl:with-param name="title" select="$title"/>
+    </xsl:call-template>
+  </xsl:template>
+
   <xsl:template match="refsynopsisdiv" mode="title.markup">
+    <!-- * Note: This template is used just for generating the text for -->
+    <!-- * cross-references to Refsynopsisdiv instances. -->
     <xsl:param name="allow-anchors" select="0"/>
-    <xsl:call-template name="string.upper">
-      <xsl:with-param name="string">
-        <xsl:choose>
-          <xsl:when test="info/title
-                          |refsynopsisdivinfo/title
-                          |title">
-            <xsl:apply-templates
-                select="(info/title
-                        |refsynopsisdivinfo/title
-                        |title)[1]" mode="title.markup">
-              <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
-            </xsl:apply-templates>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:call-template name="gentext">
-              <xsl:with-param name="key" select="'RefSynopsisDiv'"/>
-            </xsl:call-template>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:with-param>
+    <xsl:variable name="title">
+      <xsl:call-template name="get.refsynopsisdiv.title">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+      </xsl:call-template>
+    </xsl:variable>
+    <xsl:call-template name="process.SH.xref">
+      <xsl:with-param name="title" select="$title"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template name="get.refsynopsisdiv.title">
+    <xsl:param name="allow-anchors"/>
+    <xsl:choose>
+      <xsl:when test="info/title
+        |refsynopsisdivinfo/title
+        |title">
+        <xsl:apply-templates
+          select="(info/title
+          |refsynopsisdivinfo/title
+          |title)[1]" mode="title.markup">
+          <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+        </xsl:apply-templates>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="gentext">
+          <xsl:with-param name="key" select="'RefSynopsisDiv'"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="refnamediv" mode="subheading.markup">
+    <xsl:call-template name="gentext">
+      <xsl:with-param name="key" select="'RefName'"/>
     </xsl:call-template>
   </xsl:template>
 
-  <!-- * Use uppercase to render titles of all instances of Refnamediv, -->
-  <!-- * including in cross-references -->
   <xsl:template match="refnamediv" mode="title.markup">
-    <xsl:call-template name="string.upper">
-      <xsl:with-param name="string">
+    <xsl:call-template name="process.SH.xref">
+      <xsl:with-param name="title">
         <xsl:call-template name="gentext">
           <xsl:with-param name="key" select="'RefName'"/>
         </xsl:call-template>
     <xsl:apply-templates select="." mode="title.markup"/>
   </xsl:template>
 
-  <!-- ==================================================================== -->
-
   <!-- * suppress any title we don't otherwise process elsewhere -->
-
   <xsl:template match="title"/>
 
+  <!-- ==================================================================== -->
+
+  <xsl:template name="process.SH.xref">
+    <xsl:param name="title"/>
+    <xsl:text>\c</xsl:text>
+    <xsl:text>&#x2592;</xsl:text>
+    <xsl:text>.SH-xref </xsl:text>
+    <xsl:text>"</xsl:text>
+    <xsl:value-of select="$title"/>
+    <xsl:text>\c"</xsl:text>
+    <xsl:text>&#x2592;</xsl:text>
+    <xsl:text>\&amp;</xsl:text>
+  </xsl:template>
+
 </xsl:stylesheet>