From: Michael S. <xm...@us...> - 2005-09-28 09:36:53
|
Update of /cvsroot/docbook/xsl/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19515/html Modified Files: lists.xsl param.ent param.xweb Log Message: Added two new parameters for handling of multi-term varlistentry elements: variablelist.term.break.after: When the variablelist.term.break.after is non-zero, it will generate a line break after each term multi-term varlistentry. variablelist.term.separator: When a varlistentry contains multiple term elements, the string specified in the value of the variablelist.term.separator parameter is placed after each term except the last. The default is ", " (a comma followed by a space). To suppress rendering of the separator, set the value of variablelist.term.separator to the empty string (""). These parameters are primarily intended to be useful if you have multi-term varlistentries that have long terms. Closes #1306676. Thanks to Sam Steingold for providing an example "lots of long terms" doc that demonstrated the value of having these options. Also, added normalize-space() call to processing of each term. This change affects all output formats (HTML, PDF, manpages). The default behavior should pretty much remain the same as before, but it is possible (as always) that the change may introduce some new bugginess. Index: lists.xsl =================================================================== RCS file: /cvsroot/docbook/xsl/html/lists.xsl,v retrieving revision 1.47 retrieving revision 1.48 diff -u -U2 -r1.47 -r1.48 --- lists.xsl 24 May 2005 06:55:18 -0000 1.47 +++ lists.xsl 28 Sep 2005 09:36:46 -0000 1.48 @@ -443,13 +443,20 @@ <span class="term"> <xsl:call-template name="anchor"/> - <xsl:apply-templates/> - <xsl:text>, </xsl:text> - </span> -</xsl:template> - -<xsl:template match="varlistentry/term[position()=last()]" priority="2"> - <span class="term"> - <xsl:call-template name="anchor"/> - <xsl:apply-templates/> + <xsl:variable name="content"> + <xsl:apply-templates/> + </xsl:variable> + <xsl:value-of select="normalize-space($content)"/> + <xsl:choose> + <xsl:when test="position() = last()"/> <!-- do nothing --> + <xsl:otherwise> + <!-- * if we have multiple terms in the same varlistentry, generate --> + <!-- * a separator (", " by default) and/or an additional line --> + <!-- * break after each one except the last --> + <xsl:value-of select="$variablelist.term.separator"/> + <xsl:if test="not($variablelist.term.break.after = '0')"> + <br/> + </xsl:if> + </xsl:otherwise> + </xsl:choose> </span> </xsl:template> Index: param.ent =================================================================== RCS file: /cvsroot/docbook/xsl/html/param.ent,v retrieving revision 1.85 retrieving revision 1.86 diff -u -U2 -r1.85 -r1.86 --- param.ent 14 Jul 2005 17:04:24 -0000 1.85 +++ param.ent 28 Sep 2005 09:36:46 -0000 1.86 @@ -229,4 +229,6 @@ <!ENTITY use.svg SYSTEM "../params/use.svg.xml"> <!ENTITY variablelist.as.table SYSTEM "../params/variablelist.as.table.xml"> +<!ENTITY variablelist.term.separator SYSTEM "../params/variablelist.term.separator.xml"> +<!ENTITY variablelist.term.break.after SYSTEM "../params/variablelist.term.break.after.xml"> <!ENTITY para.propagates.style SYSTEM "../params/para.propagates.style.xml"> <!ENTITY html.cellpadding SYSTEM "../params/html.cellpadding.xml"> Index: param.xweb =================================================================== RCS file: /cvsroot/docbook/xsl/html/param.xweb,v retrieving revision 1.92 retrieving revision 1.93 diff -u -U2 -r1.92 -r1.93 --- param.xweb 14 Jul 2005 17:04:25 -0000 1.92 +++ param.xweb 28 Sep 2005 09:36:46 -0000 1.93 @@ -224,4 +224,11 @@ </reference> +<reference id="lists"><title>Lists</title> +&segmentedlist.as.table; +&variablelist.as.table; +&variablelist.term.separator; +&variablelist.term.break.after; +</reference> + <reference><title>Bibliography</title> &biblioentry.item.separator; @@ -247,6 +254,4 @@ &shade.verbatim.style; &punct.honorific; -&segmentedlist.as.table; -&variablelist.as.table; &tex.math.in.alt; &tex.math.file; @@ -697,4 +702,6 @@ <src:fragref linkend="use.svg.frag"/> <src:fragref linkend="variablelist.as.table.frag"/> +<src:fragref linkend="variablelist.term.separator.frag"/> +<src:fragref linkend="variablelist.term.break.after.frag"/> <src:fragref linkend="xref.with.number.and.title.frag"/> <src:fragref linkend="xref.label-title.separator.frag"/> |