]> granicus.if.org Git - docbook-dsssl/commitdiff
Added options for controlling indentation in lists and in *blurb
authorMichael Smith <xmldoc@users.sourceforge.net>
Fri, 14 Apr 2006 08:25:36 +0000 (08:25 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Fri, 14 Apr 2006 08:25:36 +0000 (08:25 +0000)
output in the AUTHORS section. Controlled through the
man.indentation.lists.adjust, man.indentation.lists.value,
man.indentation.authors.adjust, and man.indentation.authors.value
parameters. Default is 3 characters (instead of the roff default
of 8 characters). Closes #1449369.

Also, removed the indent that was being set on informalexample
outuput. I will instead add an option for indenting verbatims,
which I think is what the informalexample indent was intended for
originally.

xsl/manpages/block.xsl
xsl/manpages/docbook.xsl
xsl/manpages/info.xsl
xsl/manpages/lists.xsl

index ac554bae883313bec24fbee01be2c569319dabb9..2ca5a955022cab605da5da70f035b6abb4d7e470 100644 (file)
@@ -54,6 +54,8 @@
   <xsl:text>.sp&#10;</xsl:text>
 </xsl:template>
 
+<!-- ==================================================================== -->
+
 <xsl:template match="literallayout|programlisting|screen|
                      address|synopsis|funcsynopsisinfo">
   <!-- * Yes, address, synopsis, and funcsynopsisinfo are verbatim environments. -->
   </xsl:if>
 </xsl:template>
 
+<!-- ==================================================================== -->
+
 <xsl:template match="informalexample">
-  <xsl:text>.IP&#10;</xsl:text>
   <xsl:apply-templates/>
 </xsl:template>
 
-
 <!-- ==================================================================== -->
 
 <xsl:template match="figure">
index 9c4b42e98b9c6433d379dfd7194b943c2b4d775d..40f0fd0ecac7beafe45e661473e40f5ebfede450 100644 (file)
   <xsl:include href="links.xsl"/>
   <xsl:include href="table.xsl"/>
 
-  <xsl:param name="man.manifest.enabled">0</xsl:param>
+  <xsl:param name="man.manifest.enabled" select="0"/>
   <xsl:param name="man.manifest.filename">MAN.MANIFEST</xsl:param>
-  <xsl:param name="man.segtitle.suppress">0</xsl:param>
-  <xsl:param name="man.indentation.default.adjust">0</xsl:param>
+  <xsl:param name="man.segtitle.suppress" select="0"/>
+  <xsl:param name="man.indentation.default.adjust" select="0"/>
   <xsl:param name="man.indentation.default.value">3n</xsl:param>
+  <xsl:param name="man.indentation.lists.adjust" select="1"/>
+  <xsl:param name="man.indentation.lists.value">3n</xsl:param>
+  <xsl:param name="man.indentation.authors.adjust" select="1"/>
+  <xsl:param name="man.indentation.authors.value">3n</xsl:param>
   <xsl:param name="man.funcprototype.font">BI</xsl:param>
   <xsl:param name="man.funcsynopsisinfo.font">B</xsl:param>
   <xsl:param name="man.table.headings.font">B</xsl:param>
index 6bfcaa7214467a832aa3b643a6d37aea3bceec61..3e63b96a6cf46f495f3874758f07e2a6d489b036 100644 (file)
 
      ******************************************************************** -->
 
+  <xsl:variable name="authors-indent">
+    <xsl:choose>
+      <xsl:when test="not($man.indentation.authors.adjust = 0)">
+        <xsl:value-of select="$man.indentation.authors.value"/>
+      </xsl:when>
+      <xsl:when test="not($man.indentation.default.adjust = 0)">
+        <!-- * "zq" is the name of a register we set for preserving the -->
+        <!-- * original default indent value when -->
+        <!-- * $man.indentation.default.adjust is non-zero; -->
+        <!-- * "u" is a roff unit specifier -->
+        <xsl:text>\n(zqu</xsl:text>
+      </xsl:when>
+      <xsl:otherwise/> <!-- * otherwise, just leave it empty -->
+    </xsl:choose>
+  </xsl:variable>
+
+  <!-- ================================================================== -->
   <!-- * About the $info param used in this stylesheet -->
   <!-- * -->
   <!-- * The $info param is a "master info" node set that contains -->
 
   <xsl:template name="publisher.attribution">
     <xsl:text>&#10;.sp -1n&#10;</xsl:text>
-    <xsl:text>.IP&#10;</xsl:text>
+    <xsl:text>.IP ""</xsl:text> 
+    <xsl:if test="not($authors-indent = '')">
+      <xsl:text> </xsl:text>
+      <xsl:value-of select="$authors-indent"/>
+    </xsl:if>
+    <xsl:text>&#10;</xsl:text>
     <xsl:call-template name="gentext">
       <xsl:with-param name="key" select="'Publisher'"/>
     </xsl:call-template>
       <!-- * Editor, then render the corresponding localized gentext -->
       <xsl:when test="self::author">
         <xsl:text>&#10;.sp -1n&#10;</xsl:text>
-        <xsl:text>.IP&#10;</xsl:text>
+        <xsl:text>.IP ""</xsl:text> 
+        <xsl:if test="not($authors-indent = '')">
+          <xsl:text> </xsl:text>
+          <xsl:value-of select="$authors-indent"/>
+        </xsl:if>
+        <xsl:text>&#10;</xsl:text>
         <xsl:call-template name="gentext">
           <xsl:with-param name="key" select="'Author'"/>
         </xsl:call-template>
       </xsl:when>
       <xsl:when test="self::editor">
         <xsl:text>&#10;.sp -1n&#10;</xsl:text>
-        <xsl:text>.IP&#10;</xsl:text>
+        <xsl:text>.IP ""</xsl:text> 
+        <xsl:if test="not($authors-indent = '')">
+          <xsl:text> </xsl:text>
+          <xsl:value-of select="$authors-indent"/>
+        </xsl:if>
+        <xsl:text>&#10;</xsl:text>
         <xsl:call-template name="gentext">
           <xsl:with-param name="key" select="'Editor'"/>
         </xsl:call-template>
         <xsl:choose>
           <xsl:when test="@class and @class != 'other'">
             <xsl:text>&#10;.sp -1n&#10;</xsl:text>
-            <xsl:text>.IP&#10;</xsl:text>
+            <xsl:text>.IP ""</xsl:text> 
+            <xsl:if test="not($authors-indent = '')">
+              <xsl:text> </xsl:text>
+              <xsl:value-of select="$authors-indent"/>
+            </xsl:if>
+            <xsl:text>&#10;</xsl:text>
             <xsl:call-template name="gentext">
               <xsl:with-param name="key" select="@class"/>
             </xsl:call-template>
 
   <xsl:template match="personblurb|authorblurb" mode="authorsect">
     <xsl:text>&#10;.sp -1n&#10;</xsl:text>
-    <xsl:text>.IP&#10;</xsl:text>
+    <xsl:text>.IP ""</xsl:text> 
+    <xsl:if test="not($authors-indent = '')">
+      <xsl:text> </xsl:text>
+      <xsl:value-of select="$authors-indent"/>
+    </xsl:if>
+    <xsl:text>&#10;</xsl:text>
     <!-- * yeah, it's possible for a *blurb to have a "title" -->
     <xsl:apply-templates select="title"/>
     <xsl:for-each select="*[name() != 'title']">
     <!-- * We treat Contrib the same as Personblurb/Authorblurb -->
     <!-- * except that we don't need to check for a title. -->
     <xsl:text>&#10;.sp -1n&#10;</xsl:text>
-    <xsl:text>&#10;.IP&#10;</xsl:text>
+    <xsl:text>&#10;.IP ""</xsl:text>
+    <xsl:if test="not($authors-indent = '')">
+      <xsl:text> </xsl:text>
+      <xsl:value-of select="$authors-indent"/>
+    </xsl:if>
+    <xsl:text>&#10;</xsl:text>
     <xsl:apply-templates/>
   </xsl:template>
 
index e58e47bd476d988bf0975c1a0b1278dbcbab32e4..7895b24a9305ee2e540bb807d0c6a757b4a25534 100644 (file)
      copyright and other information.
 
      ******************************************************************** -->
+
+<xsl:variable name="list-indent">
+  <xsl:choose>
+    <xsl:when test="not($man.indentation.lists.adjust = 0)">
+      <xsl:value-of select="$man.indentation.lists.value"/>
+    </xsl:when>
+    <xsl:when test="not($man.indentation.default.adjust = 0)">
+      <!-- * "zq" is the name of a register we set for preserving the -->
+      <!-- * original default indent value when -->
+      <!-- * $man.indentation.default.adjust is non-zero; -->
+      <!-- * "u" is a roff unit specifier -->
+      <xsl:text>\n(zqu</xsl:text>
+    </xsl:when>
+    <xsl:otherwise/> <!-- * otherwise, just leave it empty -->
+  </xsl:choose>
+</xsl:variable>
+
+<!-- ================================================================== -->
+
 <xsl:template match="para[ancestor::listitem or ancestor::step or ancestor::glossdef]|
                     simpara[ancestor::listitem or ancestor::step or ancestor::glossdef]|
                     remark[ancestor::listitem or ancestor::step or ancestor::glossdef]">
       <xsl:text>.PP&#10;</xsl:text> 
     </xsl:when>
     <xsl:otherwise> <!-- * we only have one term, so use .TP -->
-      <xsl:text>.TP&#10;</xsl:text> 
+      <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:otherwise>
   </xsl:choose>
   <xsl:for-each select="term|glossterm">
     <!-- * if we have multiple terms in the same varlistentry, we need to-->
     <!-- *  manually indent the listitem using .RS and .RE -->
     <xsl:when test="count(term) > 1">
-      <xsl:text>.RS&#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:apply-templates/>
       <xsl:text>.RE&#10;</xsl:text>
     </xsl:when>
 <xsl:template match="glossentry/glossterm"/>
 
 <xsl:template match="variablelist[ancestor::listitem or ancestor::step or ancestor::glossdef]|
-                    glosslist[ancestor::listitem or ancestor::step or ancestor::glossdef]">
-  <xsl:text>.RS&#10;</xsl:text>
+                     glosslist[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: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
                 parent::remark[following-sibling::node()]">
-    <xsl:text>.IP&#10;</xsl:text>
+    <xsl:text>.IP ""</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>
 </xsl:template>
 
   <xsl:text>&#x2022;&#10;</xsl:text>
   <xsl:apply-templates/>
   <xsl:if test="following-sibling::listitem">
-    <xsl:text>.TP&#10;</xsl:text>
+    <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:if>
 </xsl:template>
 
   <xsl:text>&#10;</xsl:text>
   <xsl:apply-templates/>
   <xsl:if test="position()!=last()">
-    <xsl:text>.TP&#10;</xsl:text>
+    <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:if>
 </xsl:template>
 
     <xsl:apply-templates mode="bold" select="title"/>
     <xsl:text>&#10;</xsl:text>
   </xsl:if>
-  <xsl:text>.TP 3&#10;</xsl:text>
+  <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:if test="following-sibling::node()">
-  <xsl:text>.sp&#10;</xsl:text>
-  <xsl:text>.RE&#10;</xsl:text>
+    <xsl:text>.sp&#10;</xsl:text>
+    <xsl:text>.RE&#10;</xsl:text>
   </xsl:if>
 </xsl:template>
 
 <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&#10;</xsl:text>
+                     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 3&#10;</xsl:text>
+  <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
                 parent::remark[following-sibling::node()]">
-    <xsl:text>.IP&#10;</xsl:text>
+    <xsl:text>.IP ""</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>
 </xsl:template>
 
 <!-- * list (ignoring the values of the type and columns attributes) -->
 <xsl:template match="simplelist">
   <xsl:for-each select="member">
-    <xsl:text>.IP&#10;</xsl:text>
+    <xsl:text>.IP ""</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>&#10;</xsl:text>
   </xsl:for-each>