<xsl:with-param name="extra3" select="$metadata/othermetadata"/>
</xsl:call-template>
<!-- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <!-- * Now deal with setting default hyphenation and justification -->
+ <!-- * Set default hyphenation, justification, and line-breaking -->
<!-- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <!-- * -->
- <!-- * If the value of man.hypenate is zero (the default), then -->
- <!-- * disable hyphenation (".nh" means "no hyphenation", I guess) -->
- <xsl:if test="$man.hyphenate = 0">
- <xsl:text>.nh </xsl:text>
- </xsl:if>
- <!-- * If the value of man.justify is zero (the default), then -->
- <!-- * disable justification (".ad l" means "adjust to left only" -->
- <xsl:if test="$man.justify = 0">
- <xsl:text>.ad l </xsl:text>
- </xsl:if>
+ <xsl:call-template name="set.default.formatting"/>
<!-- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- * Main body of man page -->
<!-- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
******************************************************************** -->
-<!-- * This file contains named templates for generating content other than -->
-<!-- * what appears in the main text flow of each man page. This "other" -->
-<!-- * stuff currently amounts to: -->
+<!-- * This file contains named templates that are related to things -->
+<!-- * other than just generating the actual text of the main text flow -->
+<!-- * of each man page. This "other" stuff currently amounts to: -->
<!-- * -->
-<!-- * - a commented-out section in top part of roff source of each page -->
-<!-- * - the .TH title line for controlling the page header/footer -->
-<!-- * - any related "stub" pages (which end up getting read by soelim(1) -->
+<!-- * - adding a comment to top part of roff source of each page -->
+<!-- * - making a .TH title line (for controlling page header/footer) -->
+<!-- * - setting hyphenation, alignment, & line-breaking defaults -->
+<!-- * - writing any related "stub" pages -->
<!-- ==================================================================== -->
<xsl:param name="extra2"/>
<xsl:param name="extra3"/>
- <!-- * FIXME: th.title.max.length needs to be made into a documented -->
- <!-- * user-configurable parameter -->
- <xsl:variable name="th.title.max.length" select="'20'"/>
-
<xsl:text>.TH "</xsl:text>
- <xsl:value-of select="translate(
- substring($title, 1, $th.title.max.length),
- 'abcdefghijklmnopqrstuvwxyz',
- 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
- )"/>
+ <xsl:call-template name="string.upper">
+ <xsl:with-param name="string">
+ <!-- * truncate title if it exceeds max. length (user-configurable) -->
+ <xsl:value-of select="substring($title, 1, $man.th.title.max.length)"/>
+ </xsl:with-param>
+ </xsl:call-template>
<xsl:text>" </xsl:text>
<xsl:value-of select="$section"/>
<xsl:text> "</xsl:text>
<!-- ============================================================== -->
+ <xsl:template name="set.default.formatting">
+ <!-- * Set default hyphenation, justification, and line-breaking -->
+ <!-- * -->
+ <!-- * If the value of man.hypenate is zero (the default), then -->
+ <!-- * disable hyphenation (".nh" = "no hyphenation") -->
+ <xsl:if test="$man.hyphenate = 0">
+ <xsl:text>.\" disable hypenation </xsl:text>
+ <xsl:text>.nh </xsl:text>
+ </xsl:if>
+ <!-- * If the value of man.justify is zero (the default), then -->
+ <!-- * disable justification (".ad l" means "adjust to left only") -->
+ <xsl:if test="$man.justify = 0">
+ <xsl:text>.\" disable justification</xsl:text>
+ <xsl:text> (adjust text to left margin only) </xsl:text>
+ <xsl:text>.ad l </xsl:text>
+ </xsl:if>
+ <!-- * Unless the value of man.break.after.slash is zero (the -->
+ <!-- * default), tell groff that it is OK to break a line -->
+ <!-- * after a slash when needed. -->
+ <xsl:if test="$man.break.after.slash != 0">
+ <xsl:text>.\" enable line breaks after slashes </xsl:text>
+ <xsl:text>.cflags 4 / </xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- ============================================================== -->
+
<!-- * A "stub" is sort of alias for another file, intended to be read -->
<!-- * and expanded by soelim(1); it's simply a file whose complete -->
<!-- * contents are just a single line of the following form: -->
<reference id="general">
<title>General</title>
-&man.justify;
+&man.break.after.slash;
&man.hyphenate;
+&man.justify;
&man.output.quietly;
&man.output.encoding;
&man.string.subst.map;
+&man.th.title.max.length;
</reference>
<reference id="charmap">
<title>Character map</title>
******************************************************************** -->
-<src:fragref linkend="man.justify.frag"/>
+<src:fragref linkend="man.break.after.slash.frag"/>
<src:fragref linkend="man.hyphenate.frag"/>
+<src:fragref linkend="man.justify.frag"/>
<src:fragref linkend="man.output.quietly.frag"/>
<src:fragref linkend="man.output.encoding.frag"/>
<src:fragref linkend="man.string.subst.map.frag"/>
<src:fragref linkend="man.charmap.uri.frag"/>
<src:fragref linkend="man.charmap.use.subset.frag"/>
<src:fragref linkend="man.charmap.subset.profile.frag"/>
+<src:fragref linkend="man.th.title.max.length.frag"/>
</xsl:stylesheet>
</src:fragment>