]> granicus.if.org Git - docbook-dsssl/commitdiff
This is a first attempt at ensuring that list content nested in
authorMichael Smith <xmldoc@users.sourceforge.net>
Tue, 2 Jan 2007 10:23:06 +0000 (10:23 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Tue, 2 Jan 2007 10:23:06 +0000 (10:23 +0000)
itemizedlist and orderedlist instances is properly indented. This
is a switch from using .TP to format those lists to using .RS/.RE
to format them instead (because .TP does not allow nesting). This
probably breaks something else and therefore will likely need some
refinement after more testing. Closes bug #1602616. Thanks to
Daniel Leidert.

xsl/manpages/lists.xsl
xsl/params/man.string.subst.map.xml

index 951d7114c16c5d4b13cd0f625bfe4c9d9dcf4e08..167dfaa4612283861be4551b78b9b44309f95662 100644 (file)
   <!-- * the roff bullet) because, when we do character-map -->
   <!-- * processing before final output, the character-map will -->
   <!-- * handle conversion of the &#x2022; to "\(bu" for us -->
-  <xsl:text>&#x2022;&#10;</xsl:text>
-  <xsl:apply-templates/>
-  <xsl:if test="following-sibling::listitem">
-    <xsl:text>.TP</xsl:text> 
+  <xsl:text>&#10;</xsl:text>
+  <xsl:text>.RS</xsl:text>
+  <xsl:if test="not($list-indent = '')">
+    <xsl:text> </xsl:text>
+    <xsl:value-of select="$list-indent"/>
+  </xsl:if>
+  <xsl:text>&#10;</xsl:text>
+  <xsl:text>\h'-</xsl:text>
     <xsl:if test="not($list-indent = '')">
-      <xsl:text> </xsl:text>
-      <xsl:value-of select="$list-indent"/>
-    </xsl:if>
-    <xsl:text>&#10;</xsl:text>
+    <xsl:text>0</xsl:text>
+    <xsl:value-of select="$list-indent"/>
+  </xsl:if>
+  <xsl:text>'</xsl:text>
+  <xsl:text>&#x2022;</xsl:text>
+  <xsl:text>\h'+</xsl:text>
+    <xsl:if test="not($list-indent = '')">
+    <xsl:text>0</xsl:text>
+    <xsl:value-of select="$list-indent - 1"/>
+  <xsl:text>'</xsl:text>
   </xsl:if>
+  <xsl:apply-templates/>
+  <xsl:text>.RE&#10;</xsl:text>
 </xsl:template>
 
 <xsl:template match="orderedlist/listitem|procedure/step">
-  <xsl:number format="1."/>
   <xsl:text>&#10;</xsl:text>
-  <xsl:apply-templates/>
-  <xsl:if test="position()!=last()">
-    <xsl:text>.TP</xsl:text> 
+  <xsl:text>.RS</xsl:text>
+  <xsl:if test="not($list-indent = '')">
+    <xsl:text> </xsl:text>
+    <xsl:value-of select="$list-indent"/>
+  </xsl:if>
+  <xsl:text>&#10;</xsl:text>
+  <xsl:text>\h'-</xsl:text>
     <xsl:if test="not($list-indent = '')">
-      <xsl:text> </xsl:text>
-      <xsl:value-of select="$list-indent"/>
-    </xsl:if>
-    <xsl:text>&#10;</xsl:text>
+    <xsl:text>0</xsl:text>
+    <xsl:value-of select="$list-indent"/>
+  </xsl:if>
+  <xsl:text>'</xsl:text>
+  <xsl:if test="count(preceding-sibling::listitem) &lt; 9">
+    <xsl:text> </xsl:text>
   </xsl:if>
+  <xsl:number format="1."/>
+  <xsl:text>\h'+</xsl:text>
+    <xsl:if test="not($list-indent = '')">
+    <xsl:text>0</xsl:text>
+    <xsl:value-of select="$list-indent - 2"/>
+  <xsl:text>'</xsl:text>
+  </xsl:if>
+  <xsl:apply-templates/>
+  <xsl:text>.RE&#10;</xsl:text>
+  <xsl:text>&#10;</xsl:text>
 </xsl:template>
 
 <xsl:template match="itemizedlist|orderedlist|procedure">
   <!-- * content (if any) before getting the list items -->
   <xsl:apply-templates
       select="*[not(self::listitem) and not(self::title)]"/>
-  <xsl:text>.TP</xsl:text> 
-  <xsl:if test="not($list-indent = '')">
-    <xsl:text> </xsl:text>
-    <xsl:value-of select="$list-indent"/>
-  </xsl:if>
-  <xsl:text>&#10;</xsl:text>
   <xsl:apply-templates select="listitem"/>
   <!-- * If this list is a child of para and has content following -->
   <!-- * it, within the same para, then add a blank line and move -->
 <xsl:template match="itemizedlist[ancestor::listitem or ancestor::step  or ancestor::glossdef]|
                     orderedlist[ancestor::listitem or ancestor::step or ancestor::glossdef]|
                      procedure[ancestor::listitem or ancestor::step or ancestor::glossdef]">
-  <xsl:text>.RS</xsl:text> 
-  <xsl:if test="not($list-indent = '')">
-    <xsl:text> </xsl:text>
-    <xsl:value-of select="$list-indent"/>
-  </xsl:if>
-  <xsl:text>&#10;</xsl:text>
   <xsl:if test="title">
     <xsl:text>.PP&#10;</xsl:text>
     <xsl:apply-templates mode="bold" select="title"/>
     <xsl:text>&#10;</xsl:text>
   </xsl:if>
-  <xsl:text>.TP</xsl:text> 
-  <xsl:if test="not($list-indent = '')">
-    <xsl:text> </xsl:text>
-    <xsl:value-of select="$list-indent"/>
-  </xsl:if>
-  <xsl:text>&#10;</xsl:text>
   <xsl:apply-templates/>
-  <xsl:text>.RE&#10;</xsl:text>
   <xsl:if test="following-sibling::node() or
                 parent::para[following-sibling::node()] or
                 parent::simpara[following-sibling::node()] or
index c2a0c06a341ca5f8d8e9da1ebe29816fe7f09ef9..93771437aeb1eed7289ce0da0dc406fdb8a2bda5 100644 (file)
@@ -20,6 +20,7 @@
   <substitution oldstring="\\fI" newstring="\fI"/>
   <substitution oldstring="\\fR" newstring="\fR"/>
   <substitution oldstring="\\n"  newstring="\n"/>
+  <substitution oldstring="\\h"  newstring="\h"/>
   <!-- * requests in .SH sectsions output from Refsect1-level source -->
   <!-- * end up getting capitalized... -->
   <substitution oldstring="\\FB" newstring="\fB"/>
@@ -37,6 +38,7 @@
   <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"/>