</xsl:if>
</xsl:template>
+ <!-- ============================================================== -->
+
+ <xsl:template name="define.macros">
+ <xsl:text>.\" define a macro for condtionally upper-casing SH x-refs </xsl:text>
+ <xsl:text>.de SH-xref
+.ie n \{\
+.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
+\\$*
+.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
+.\}
+.el \{\
+\\$*
+.\}
+.. </xsl:text>
+ <xsl:text>.\" define a level-one heading that works better for non-TTY output </xsl:text>
+ <xsl:text>.de1 SH
+.sp 1
+.sp \\n[PD]u
+.nr an-level 1
+.set-an-margin
+.nr an-prevailing-indent \\n[IN]
+.fi
+.in \\n[an-margin]u
+.ti 0
+.HTML-TAG ".NH \\n[an-level]"
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.ps +3
+.ft B
+.ne (2v + 1u)
+.\" if we have only one arg, just use that
+.ie (\\n[.$] == 1) \{\
+.ie n \{\
+\&\\$1
+.\}
+.el \{\
+.nr an-break-flag 0
+.\" if this is troff/non-TTY output, show the second arg only
+\&\\$1
+.in \\n[an-margin]u
+.ti 0
+.\" draw a border/line under subheading
+.sp -.7
+\l'\n(.lu'
+.\}
+.\}
+.\" we have more that one arg, so we decide which to use
+.el \{\
+.ie n \{\
+.if \\n[.$] \&\\$1
+.\" if this is nroff/TTY output, show the first arg only
+.\}
+.el \{\
+.nr an-break-flag 0
+.\" if this is troff/non-TTY output, show the second arg only
+.if \\n[.$] \&\\$2
+.in \\n[an-margin]u
+.ti 0
+.\" draw a border/line under subheading
+.sp -.7
+\l'\n(.lu'
+.\}
+.\}
+.. </xsl:text>
+ <xsl:text>\" define BB/BE macros for putting a background/screen </xsl:text>
+ <xsl:text>\" (filled box) around a block of text in non-TTY output </xsl:text>
+ <xsl:text>.de BB
+.br
+.in +2n
+.ll -2n
+.gcolor red
+.di BX
+..
+.de EB
+.br
+.di
+.in
+.ll
+.gcolor
+.nr BW \\n(.lu-\\n(.i
+.nr BH \\n(dn+.5v
+.ne \\n(BHu+.5v
+\M[lightgray]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
+.in 0
+.sp -.5v
+.nf
+.BX
+.in
+.sp .5v
+.fi
+.. </xsl:text>
+</xsl:template>
+
</xsl:stylesheet>
<!-- ================================================================== -->
+ <xsl:template name="verbatim-block-start">
+ <xsl:call-template name="store-current-font-family"/>
+ <xsl:text>.fam C </xsl:text>
+ </xsl:template>
+
+ <xsl:template name="verbatim-block-end">
+ <xsl:text>.fam \*(ZX </xsl:text>
+ </xsl:template>
+
+ <xsl:template name="code-inline-start">
+ <xsl:text>\FC</xsl:text>
+ </xsl:template>
+
+ <xsl:template name="code-inline-end">
+ <xsl:text>\F[\*(ZX]</xsl:text>
+ </xsl:template>
+
+ <xsl:template name="store-current-font-family">
+ <xsl:text>.ds ZX \n[.fam] </xsl:text>
+ </xsl:template>
+
+ <!-- ================================================================== -->
+
<!-- * NOTE TO DEVELOPERS: For ease of maintenance, the current -->
<!-- * manpages stylesheets use the mode="prevent.line.breaking" -->
<!-- * templates for anything and everything that needs to have -->
<xsl:with-param name="replacement" select="'_'"/>
</xsl:call-template>
</xsl:template>
-
+
<!-- ================================================================== -->
+ <xsl:template name="make.subheading">
+ <xsl:param name="title"/>
+ <xsl:call-template name="mark.subheading"/>
+ <xsl:text>.SH</xsl:text>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$title"/>
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="mark.subheading"/>
+ </xsl:template>
+
+ <xsl:template name="make.title.pair">
+ <xsl:param name="title"/>
+ <!-- * Use uppercase to render first version of title. -->
+ <xsl:text>"</xsl:text>
+ <xsl:call-template name="string.upper">
+ <xsl:with-param name="string">
+ <xsl:value-of select="normalize-space($title)"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:text>"</xsl:text>
+ <!-- * end of uppercase title -->
+ <xsl:text> </xsl:text>
+ <!-- * Use lowercase to render second version of title. -->
+ <xsl:text>"</xsl:text>
+ <xsl:value-of select="normalize-space($title)"/>
+ <xsl:text>"</xsl:text>
+ <!-- * end of lowercase title -->
+ </xsl:template>
+
<!-- * Put a horizontal rule or other divider around section titles -->
<!-- * in roff source (just to make things easier to read). -->
<xsl:template name="mark.subheading">
</xsl:if>
</xsl:template>
+ <!-- ================================================================== -->
+
+ <xsl:template name="roff-if-else-start">
+ <xsl:param name="condition">n</xsl:param>
+ <xsl:text>.ie </xsl:text>
+ <xsl:value-of select="$condition"/>
+ <xsl:text> \{\ </xsl:text>
+ </xsl:template>
+
+ <xsl:template name="roff-if-start">
+ <xsl:param name="condition">n</xsl:param>
+ <xsl:text>.if </xsl:text>
+ <xsl:value-of select="$condition"/>
+ <xsl:text> \{\ </xsl:text>
+ </xsl:template>
+
+ <xsl:template name="roff-else">
+ <xsl:text>.\} </xsl:text>
+ <xsl:text>.el \{\ </xsl:text>
+ </xsl:template>
+
+ <xsl:template name="roff-if-end">
+ <xsl:text>.\} </xsl:text>
+ </xsl:template>
+
</xsl:stylesheet>