<xsl:param name="olink.sysid" select="'sysid='" doc:type='string'/>
<xsl:param name="olink.resolver" select="'/cgi-bin/olink?'" doc:type='string'/>
+<xsl:param name="shade.verbatim" select="0" doc:type="boolean"/>
+
+<!--
+ ;; REFENTRY shade-verbatim
+ ;; PURP Should verbatim environments be shaded?
+ ;; DESC
+ ;; If true, a table with '($shade-verbatim-attr$)' attributes will be
+ ;; wrapped around each verbatim environment. This gives the effect
+ ;; of a shaded verbatim environment.
+ ;; /DESC
+ ;; AUTHOR N/A
+ ;; /REFENTRY
+-->
+
+<xsl:attribute-set name="shade.verbatim.style">
+ <xsl:attribute name="border">0</xsl:attribute>
+ <xsl:attribute name="bgcolor">#E0E0E0</xsl:attribute>
+</xsl:attribute-set>
+
</xsl:stylesheet>
<a href="{$id}"/>
</xsl:if>
+ <xsl:variable name="content">
+ <xsl:choose>
+ <xsl:when test="$suppress-numbers = '0'
+ and @linenumbering = 'numbered'
+ and $use.extensions != '0'
+ and $linenumbering.extension != '0'">
+ <xsl:variable name="rtf">
+ <xsl:apply-templates/>
+ </xsl:variable>
+ <pre class="{name(.)}">
+ <xsl:call-template name="number.rtf.lines">
+ <xsl:with-param name="rtf" select="$rtf"/>
+ </xsl:call-template>
+ </pre>
+ </xsl:when>
+ <xsl:otherwise>
+ <pre class="{name(.)}">
+ <xsl:apply-templates/>
+ </pre>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
<xsl:choose>
- <xsl:when test="$suppress-numbers = '0'
- and @linenumbering = 'numbered'
- and $use.extensions != '0'
- and $linenumbering.extension != '0'">
- <xsl:variable name="rtf">
- <xsl:apply-templates/>
- </xsl:variable>
- <pre class="{name(.)}">
- <xsl:call-template name="number.rtf.lines">
- <xsl:with-param name="rtf" select="$rtf"/>
- </xsl:call-template>
- </pre>
+ <xsl:when test="$shade.verbatim != 0">
+ <table xsl:use-attribute-sets="shade.verbatim.style">
+ <tr>
+ <td>
+ <xsl:copy-of select="$content"/>
+ </td>
+ </tr>
+ </table>
</xsl:when>
<xsl:otherwise>
- <pre class="{name(.)}">
- <xsl:apply-templates/>
- </pre>
+ <xsl:copy-of select="$content"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:apply-templates/>
</xsl:variable>
+ <xsl:variable name="content">
+ <xsl:choose>
+ <xsl:when test="$suppress-numbers = '0'
+ and @linenumbering = 'numbered'
+ and $use.extensions != '0'
+ and $linenumbering.extension != '0'">
+ <xsl:choose>
+ <xsl:when test="@class='monospaced'">
+ <pre class="{name(.)}">
+ <xsl:call-template name="number.rtf.lines">
+ <xsl:with-param name="rtf" select="$rtf"/>
+ </xsl:call-template>
+ </pre>
+ </xsl:when>
+ <xsl:otherwise>
+ <div class="{name(.)}">
+ <xsl:call-template name="number.rtf.lines">
+ <xsl:with-param name="rtf" select="$rtf"/>
+ </xsl:call-template>
+ </div>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="@class='monospaced'">
+ <pre class="{name(.)}">
+ <xsl:copy-of select="$rtf"/>
+ </pre>
+ </xsl:when>
+ <xsl:otherwise>
+ <div class="{name(.)}">
+ <xsl:copy-of select="$rtf"/>
+ </div>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
<xsl:choose>
- <xsl:when test="$suppress-numbers = '0'
- and @linenumbering = 'numbered'
- and $use.extensions != '0'
- and $linenumbering.extension != '0'">
- <xsl:choose>
- <xsl:when test="@class='monospaced'">
- <pre class="{name(.)}">
- <xsl:call-template name="number.rtf.lines">
- <xsl:with-param name="rtf" select="$rtf"/>
- </xsl:call-template>
- </pre>
- </xsl:when>
- <xsl:otherwise>
- <div class="{name(.)}">
- <xsl:call-template name="number.rtf.lines">
- <xsl:with-param name="rtf" select="$rtf"/>
- </xsl:call-template>
- </div>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:when test="$shade.verbatim != 0 and @class='monospaced'">
+ <table xsl:use-attribute-sets="shade.verbatim.style">
+ <tr>
+ <td>
+ <xsl:copy-of select="$content"/>
+ </td>
+ </tr>
+ </table>
</xsl:when>
-
<xsl:otherwise>
- <xsl:choose>
- <xsl:when test="@class='monospaced'">
- <pre class="{name(.)}">
- <xsl:copy-of select="$rtf"/>
- </pre>
- </xsl:when>
- <xsl:otherwise>
- <div class="{name(.)}">
- <xsl:copy-of select="$rtf"/>
- </div>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:copy-of select="$content"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>