<!-- * Check to see if this verbatim item is within a parent element that -->
<!-- * allows mixed content. -->
<!-- * -->
- <!-- * If it is within a mixed-content parent, then a line break is -->
+ <!-- * If it is within a mixed-content parent, then a line space is -->
<!-- * already added before it by the mixed-block template, so we don't -->
<!-- * need to add one here. -->
<!-- * -->
<!-- * If it is not within a mixed-content parent, then we need to add a -->
- <!-- * line break before it. -->
+ <!-- * line space before it. -->
<xsl:when test="parent::caption|parent::entry|parent::para|
parent::td|parent::th" /> <!-- do nothing -->
<xsl:otherwise>
- <xsl:text> </xsl:text>
+ <xsl:text>.sp </xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:text>.nf </xsl:text>
******************************************************************** -->
-<xsl:template match="para[ancestor::listitem or ancestor::step]|
- simpara[ancestor::listitem or ancestor::step]|
- remark[ancestor::listitem or ancestor::step]">
+<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:call-template name="mixed-block"/>
<xsl:text> </xsl:text>
</xsl:if>
</xsl:template>
+<xsl:template match="variablelist|glosslist">
+ <xsl:if test="title">
+ <xsl:text>.PP </xsl:text>
+ <xsl:apply-templates mode="bold" select="title"/>
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ <xsl:apply-templates/>
+</xsl:template>
+
<xsl:template match="varlistentry|glossentry">
<xsl:text>.TP </xsl:text>
<!-- * read in contents of all terms or glossterms so that we can run -->
<xsl:template match="varlistentry/term"/>
<xsl:template match="glossentry/glossterm"/>
-<xsl:template match="variablelist[ancestor::listitem or ancestor::step]|
- glosslist[ancestor::listitem or ancestor::step]">
+<xsl:template match="variablelist[ancestor::listitem or ancestor::step or ancestor::glossdef]|
+ glosslist[ancestor::listitem or ancestor::step or ancestor::glossdef]">
<xsl:text>.RS </xsl:text>
<xsl:apply-templates/>
<xsl:text>.RE </xsl:text>
- <xsl:text>.IP </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 </xsl:text>
+ </xsl:if>
</xsl:template>
-<xsl:template match="varlistentry/listitem|glossdef">
+<xsl:template match="varlistentry/listitem|glossentry/glossdef">
<xsl:apply-templates/>
</xsl:template>
<xsl:apply-templates/>
</xsl:template>
-<xsl:template match="itemizedlist[ancestor::listitem or ancestor::step]|
- orderedlist[ancestor::listitem or ancestor::step]|
- procedure[ancestor::listitem or ancestor::step]">
+<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:text>.TP 3 </xsl:text>
<xsl:apply-templates/>
<xsl:text>.RE </xsl:text>
- <xsl:text>.IP </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 </xsl:text>
+ </xsl:if>
</xsl:template>
+<!-- ================================================================== -->
+
<!-- * for simplelist type="inline", render it as a comma-separated list -->
<xsl:template match="simplelist[@type='inline']">
<xsl:text> </xsl:text>
<xsl:call-template name="mark.subheading"/>
</xsl:template>
-
+
<!-- ================================================================== -->
<!-- * The mixed-block template jumps through a few hoops to deal with -->
<xsl:template name="mixed-block">
<xsl:for-each select="node()">
<xsl:choose>
+ <!-- * Check to see if this node is a verbatim environment. -->
+ <!-- * If so, put a line of space before it. -->
+ <!-- * -->
+ <!-- * Yes, address and synopsis are vertabim environments. -->
+ <!-- * -->
+ <!-- * The code here previously also treated informaltable as a -->
+ <!-- * verbatim, presumably to support some kludge; I removed it -->
<xsl:when test="self::address|self::literallayout|self::programlisting|
self::screen|self::synopsis">
- <!-- * Check to see if this node is a verbatim environment. -->
- <!-- * If so, put a line break before it. -->
- <!-- * -->
- <!-- * Yes, address and synopsis are vertabim environments. -->
- <!-- * -->
- <!-- * The code here previously also treated informaltable as a -->
- <!-- * verbatim, presumably to support some kludge; I removed it -->
- <xsl:text> </xsl:text>
+ <xsl:text>.sp </xsl:text>
<xsl:apply-templates select="."/>
- <!-- * we don't need an extra line break after verbatim environments -->
- <!-- * <xsl:text> </xsl:text> -->
</xsl:when>
- <xsl:when test="self::itemizedlist|self::orderedlist|
- self::variablelist|self::simplelist[@type !='inline']">
- <!-- * Check to see if this node is a list; if so, -->
- <!-- * put a line break before it. -->
- <xsl:text> </xsl:text>
+ <!-- * Check to see if this node is a list; if it is, we don't -->
+ <!-- * want to normalize-space(), so we just apply-templates -->
+ <xsl:when test="(self::itemizedlist|self::orderedlist|
+ self::variablelist|self::glosslist|
+ self::simplelist[@type !='inline'])">
<xsl:apply-templates select="."/>
- <!-- * we don't need an extra line break after lists -->
- <!-- * <xsl:text> </xsl:text> -->
</xsl:when>
<xsl:when test="self::text()">
<!-- * Check to see if this is a text node. -->
test="starts-with(translate(.,'	 ',' '), ' ')
and preceding-sibling::node()[name(.)!='']
and normalize-space($content) != ''
+ and not(
+ preceding-sibling::variablelist[1] or
+ preceding-sibling::glosslistlist[1] or
+ preceding-sibling::itemizedlist[1] or
+ preceding-sibling::orderededlist[1] or
+ preceding-sibling::procedure[1]
+ )
">
<xsl:text> </xsl:text>
</xsl:if>
<substitution oldstring="-" newstring="\-"/>
<!-- * now, we need to restore single-hypens in all roff requests -->
<!-- * (because the substitution above added backslashes before them) -->
+ <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"/>
+ <!-- * squeeze multiple newlines before a roff request -->
+ <substitution oldstring=" ." newstring=" ."/>
+ <!-- * squeeze multiple newlines after start of no-fill (verbatim) env. -->
+ <substitution oldstring=".nf " newstring=".nf "/>
<!-- * an apostrophe at the beginning of a line gets interpreted as a -->
<!-- * roff request (groff(7) says it is "the non-breaking control -->
<!-- * character"); so we must add backslash before any apostrophe -->