]> granicus.if.org Git - docbook-dsssl/commitdiff
Changed manpages stylesheet to always output a U+2591 character as
authorMichael Smith <xmldoc@users.sourceforge.net>
Mon, 15 Jan 2007 17:15:40 +0000 (17:15 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Mon, 15 Jan 2007 17:15:40 +0000 (17:15 +0000)
the internal representation of a dash. The string-substitution
map is then used to output a real dash when the final contents are
serialized. Also, made a change that causes dots and dashes in the
top comment to be unescaped.

xsl/manpages/info.xsl
xsl/manpages/lists.xsl
xsl/manpages/other.xsl
xsl/manpages/synop.xsl
xsl/manpages/table.xsl
xsl/manpages/utility.xsl
xsl/params/man.string.subst.map.xml

index ba46e9d25194e63671376d6350e5328aee374f34..a6e7840149961099bff390713c2ed47c5eef40a3 100644 (file)
 
   <xsl:template name="publisher.attribution">
     <xsl:text>&#10;</xsl:text>
-    <xsl:text>&#x2302;sp -1n&#10;</xsl:text>
+    <xsl:text>&#x2302;sp &#x2591;1n&#10;</xsl:text>
     <xsl:text>&#x2302;IP ""</xsl:text> 
     <xsl:if test="not($blurb-indent = '')">
       <xsl:text> </xsl:text>
       <!-- * Editor, then render the corresponding localized gentext -->
       <xsl:when test="self::author">
         <xsl:text>&#10;</xsl:text>
-        <xsl:text>&#x2302;sp -1n&#10;</xsl:text>
+        <xsl:text>&#x2302;sp &#x2591;1n&#10;</xsl:text>
         <xsl:text>&#x2302;IP ""</xsl:text> 
         <xsl:if test="not($blurb-indent = '')">
           <xsl:text> </xsl:text>
       </xsl:when>
       <xsl:when test="self::editor">
         <xsl:text>&#10;</xsl:text>
-        <xsl:text>&#x2302;sp -1n&#10;</xsl:text>
+        <xsl:text>&#x2302;sp &#x2591;1n&#10;</xsl:text>
         <xsl:text>&#x2302;IP ""</xsl:text> 
         <xsl:if test="not($blurb-indent = '')">
           <xsl:text> </xsl:text>
         <xsl:choose>
           <xsl:when test="@class and @class != 'other'">
             <xsl:text>&#10;</xsl:text>
-            <xsl:text>&#x2302;sp -1n&#10;</xsl:text>
+            <xsl:text>&#x2302;sp &#x2591;1n&#10;</xsl:text>
             <xsl:text>&#x2302;IP ""</xsl:text> 
             <xsl:if test="not($blurb-indent = '')">
               <xsl:text> </xsl:text>
                 |../othername|../lineage|../honorific
                 |../affiliation|../email|../address">
         <xsl:text>&#10;</xsl:text>
-        <xsl:text>&#x2302;sp -1n&#10;</xsl:text>
+        <xsl:text>&#x2302;sp &#x2591;1n&#10;</xsl:text>
         <xsl:text>&#x2302;IP ""</xsl:text> 
         <xsl:if test="not($blurb-indent = '')">
           <xsl:text> </xsl:text>
index 2a00b3ad3ac5c2e7e37118c15f21fa87933d8b63..dbdb3beea0eb489163a2459f1a5ffd2f99204b65 100644 (file)
     <xsl:value-of select="$list-indent"/>
   </xsl:if>
   <xsl:text>&#10;</xsl:text>
-  <xsl:text>\h'-</xsl:text>
+  <xsl:text>\h'&#x2591;</xsl:text>
     <xsl:if test="not($list-indent = '')">
     <xsl:text>0</xsl:text>
     <xsl:value-of select="$list-indent"/>
     <xsl:value-of select="$list-indent"/>
   </xsl:if>
   <xsl:text>&#10;</xsl:text>
-  <xsl:text>\h'-</xsl:text>
+  <xsl:text>\h'&#x2591;</xsl:text>
     <xsl:if test="not($list-indent = '')">
     <xsl:text>0</xsl:text>
     <xsl:value-of select="$list-indent"/>
   <!-- * .TE = "Table End" -->
   <xsl:text>&#x2302;TE&#10;</xsl:text>
   <xsl:text>&#x2302;\" line length decrease back to previous value&#10;</xsl:text>
-  <xsl:text>&#x2302;ll -(\n(LLu * 62u / 100u)&#10;</xsl:text>
+  <xsl:text>&#x2302;ll &#x2591;(\n(LLu * 62u / 100u)&#10;</xsl:text>
   <!-- * put a blank line of space below the table -->
   <xsl:text>&#x2302;sp&#10;</xsl:text>
 </xsl:template>
index cc3f6a1b5a609280bdb3075993670e137c19d6e4..532758b396cc5d505d5e08bedfebd314b9e5dd5e 100644 (file)
@@ -170,30 +170,39 @@ db:manvolnum
     <xsl:param name="manual"/>
     <xsl:param name="source"/>
     <xsl:text>&#x2302;\"     Title: </xsl:text>
-    <xsl:value-of select="$title"/>
+    <xsl:call-template name="replace.dots.and.dashes">
+      <xsl:with-param name="content" select="$title"/>
+    </xsl:call-template>
     <xsl:text>&#10;</xsl:text>
     <xsl:text>&#x2302;\"    Author: </xsl:text>
-      <xsl:call-template name="make.roff.metadata.author">
-        <xsl:with-param name="info" select="$info"/>
-      </xsl:call-template>
+    <xsl:call-template name="replace.dots.and.dashes">
+      <xsl:with-param name="content">
+        <xsl:call-template name="make.roff.metadata.author">
+          <xsl:with-param name="info" select="$info"/>
+        </xsl:call-template>
+      </xsl:with-param>
+    </xsl:call-template>
     <xsl:text>&#10;</xsl:text>
     <xsl:text>&#x2302;\" Generator: DocBook XSL Stylesheets v</xsl:text>
-    <xsl:value-of select="$VERSION"/>
-    <xsl:text> &lt;http://docbook.sf.net/></xsl:text>
+    <xsl:call-template name="replace.dots.and.dashes">
+      <xsl:with-param name="content" select="$VERSION"/>
+    </xsl:call-template>
+    <xsl:text> &lt;http://docbook&#x2302;sf&#x2302;net/></xsl:text>
     <xsl:text>&#10;</xsl:text>
     <xsl:text>&#x2302;\"      Date: </xsl:text>
-      <xsl:call-template name="string.subst">
-        <!-- * replace hyphens in date with dots -->
-        <xsl:with-param name="string" select="$date"/>
-        <xsl:with-param name="target" select="'-'"/>
-        <xsl:with-param name="replacement" select="'.'"/>
-      </xsl:call-template>
+    <xsl:call-template name="replace.dots.and.dashes">
+      <xsl:with-param name="content" select="$date"/>
+    </xsl:call-template>
     <xsl:text>&#10;</xsl:text>
     <xsl:text>&#x2302;\"    Manual: </xsl:text>
-    <xsl:value-of select="$manual"/>
+    <xsl:call-template name="replace.dots.and.dashes">
+      <xsl:with-param name="content" select="$manual"/>
+    </xsl:call-template>
     <xsl:text>&#10;</xsl:text>
     <xsl:text>&#x2302;\"    Source: </xsl:text>
-    <xsl:value-of select="$source"/>
+    <xsl:call-template name="replace.dots.and.dashes">
+      <xsl:with-param name="content" select="$source"/>
+    </xsl:call-template>
     <xsl:text>&#10;</xsl:text>
     <xsl:text>&#x2302;\"</xsl:text>
     <xsl:text>&#10;</xsl:text>
index 9fc95c19a144b446eff662a4ad2846048c0faa79..f5d92120da0d87afb50c70d2ab8474a5967b072d 100644 (file)
@@ -50,7 +50,7 @@
   <!-- * up one line vertically to negate the line of vertical space -->
   <!-- * that's added by the .HP macro -->
   <xsl:if test="preceding-sibling::*[1][self::synopfragment]">
-    <xsl:text>&#x2302;sp -1n&#10;</xsl:text>
+    <xsl:text>&#x2302;sp &#x2591;1n&#10;</xsl:text>
   </xsl:if>
   <xsl:text>&#x2302;HP </xsl:text>
   <!-- * For each Synopfragment, make a hanging paragraph, with the -->
   <!-- * (because funcdef is always followed by one open paren char) -->
   <xsl:value-of select="string-length (normalize-space ($funcprototype.string.value)) + 1"/>
   <xsl:text>&#10;</xsl:text>
-  <xsl:text>.</xsl:text>
+  <xsl:text>&#x2302;</xsl:text>
   <xsl:value-of select="$man.font.funcprototype"/>
   <xsl:text> </xsl:text>
   <!-- * The following quotation mark (and the one further below) are -->
index 3405bc6b723668ec5c43e912296ab960df57e9eb..24873d76f5929efa510b98e8672358244992a039 100644 (file)
         </xsl:if>
         <xsl:value-of select="normalize-space($title)"/>
         <xsl:text>&#10;</xsl:text>
-        <xsl:text>&#x2302;sp -1n&#10;</xsl:text>
+        <xsl:text>&#x2302;sp &#x2591;1n&#10;</xsl:text>
       </xsl:if>
       
       <!-- * mark the start of the table -->
index 39409d4c27d905a906686f0880d3acdbb85a4c93..ba953e0ae56ddea3b9db596383bdede614694ca0 100644 (file)
 
   <!-- ================================================================== -->
 
+  <!-- * The replace.dots.and.dashes template is used to cause real -->
+  <!-- * dots and dashes to be output in the top comment (instead of -->
+  <!-- * escaped ones as in the source for the text displayed in the -->
+  <!-- * body of the page) -->
+  <xsl:template name="replace.dots.and.dashes">
+    <xsl:param name="content">
+      <xsl:apply-templates/>
+    </xsl:param>
+    <xsl:variable name="dot-content">
+      <xsl:call-template name="string.subst">
+        <xsl:with-param name="string" select="$content"/>
+        <xsl:with-param name="target" select="'.'"/>
+        <xsl:with-param name="replacement" select="'&#x2302;'"/>
+      </xsl:call-template>
+    </xsl:variable>
+    <xsl:call-template name="string.subst">
+      <xsl:with-param name="string" select="$dot-content"/>
+      <xsl:with-param name="target" select="'-'"/>
+      <xsl:with-param name="replacement" select="'&#x2591;'"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <!-- ================================================================== -->
+
   <!-- * The nested-section-title template is called for refsect3, and any -->
   <!-- * refsection nested more than 2 levels deep. -->
   <xsl:template name="nested-section-title">
     <!-- * The next few lines are some arcane roff code to control line -->
     <!-- * spacing after headings. -->
     <xsl:text>&#x2302;sp&#10;</xsl:text>
-    <xsl:text>&#x2302;it 1 an-trap&#10;</xsl:text>
-    <xsl:text>&#x2302;nr an-no-space-flag 1&#10;</xsl:text>
-    <xsl:text>&#x2302;nr an-break-flag 1&#10;</xsl:text>
+    <xsl:text>&#x2302;it 1 an&#x2591;trap&#10;</xsl:text>
+    <xsl:text>&#x2302;nr an&#x2591;no&#x2591;space&#x2591;flag 1&#10;</xsl:text>
+    <xsl:text>&#x2302;nr an&#x2591;break&#x2591;flag 1&#10;</xsl:text>
     <xsl:text>&#x2302;br&#10;</xsl:text>
     <!-- * make title wrapper so that we can use mode="bold" template to -->
     <!-- * apply character formatting to it -->
index dd2229b9393cb1ae48a1577f20fc9c63f039d63d..13cfcbf3ab97890f5b5c430bece5c8b6538f20d4 100644 (file)
   <!-- * argument for a command across a line, if that argument contains -->
   <!-- * a dash/hyphen); so, we must globally change all hyphens to "\-" -->
   <substitution oldstring="-" newstring="\-"/>
-  <!-- * now, we need to restore single-hypens in all roff requests -->
-  <!-- * (because the substitution above added backslashes before them) -->
-  <substitution oldstring="\h'\-" newstring="\h'-"/>
-  <substitution oldstring=".sp \-" newstring=".sp -"/>
-  <substitution oldstring=".it 1 an\-trap" newstring=".it 1 an-trap"/>
-  <substitution oldstring=".nr an\-no\-space\-flag 1" newstring=".nr an-no-space-flag 1"/>
-  <substitution oldstring=".nr an\-break\-flag 1" newstring=".nr an-break-flag 1"/>
-  <substitution oldstring=".ll \-" newstring=".ll -"/>
+  <!-- * restore dashes in all roff requests and comments -->
+  <substitution oldstring="&#x2591;" newstring="-"/>
   <!-- * squeeze multiple newlines before a roff request  -->
   <substitution oldstring="&#10;&#10;." newstring="&#10;."/>
   <!-- * remove any .sp occurences that directly follow a .PP  -->