2 <!-- vim:set sts=2 shiftwidth=2 syntax=xml: -->
3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6 <xsl:import href="settings.xsl"/>
8 <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/>
10 <xsl:param name="chunk.section.depth" select="0"/>
11 <xsl:param name="chunk.first.sections" select="1"/>
12 <xsl:param name="use.id.as.filename" select="1"/>
15 Our ulink stylesheet omits @url part if content was specified
17 <xsl:template match="ulink">
18 <xsl:variable name="content">
19 <xsl:apply-templates/>
21 <xsl:if test="$content = ''">
22 <xsl:text>: </xsl:text>
24 <xsl:if test="$content != ''">
25 <xsl:value-of select="$content" />
27 <xsl:if test="$content = ''">
28 <xsl:apply-templates mode="italic" select="@url" />
32 <xsl:template match="refentry">
34 <xsl:variable name="section" select="refmeta/manvolnum"/>
35 <xsl:variable name="name" select="refnamediv/refname[1]"/>
36 <xsl:variable name="base.dir" select="$base.dir"/>
37 <!-- standard man page width is 64 chars; 6 chars needed for the two
38 (x) volume numbers, and 2 spaces, leaves 56 -->
39 <xsl:variable name="twidth" select="(74 - string-length(refmeta/refentrytitle)) div 2"/>
41 <xsl:variable name="reftitle"
42 select="substring(refmeta/refentrytitle, 1, $twidth)"/>
44 <xsl:variable name="title">
46 <xsl:when test="refentryinfo/title">
47 <xsl:value-of select="refentryinfo/title"/>
49 <xsl:when test="../referenceinfo/title">
50 <xsl:value-of select="../referenceinfo/title"/>
55 <xsl:variable name="date">
57 <xsl:when test="refentryinfo/date">
58 <xsl:value-of select="refentryinfo/date"/>
60 <xsl:when test="../referenceinfo/date">
61 <xsl:value-of select="../referenceinfo/date"/>
66 <xsl:variable name="productname">
68 <xsl:when test="refentryinfo/productname">
69 <xsl:value-of select="refentryinfo/productname"/>
71 <xsl:when test="../referenceinfo/productname">
72 <xsl:value-of select="../referenceinfo/productname"/>
77 <xsl:call-template name="write.text.chunk">
78 <xsl:with-param name="filename"
79 select="concat($base.dir, normalize-space ($name), '.', $section)"/>
80 <xsl:with-param name="content">
81 <xsl:text>.\"Generated by db2man.xsl. Don't modify this, modify the source.
90 .de Sp \" Vertical space (when we can't use .PP)
96 .ie \\n(.$>=3 .ne \\$3
101 <xsl:value-of select="translate($reftitle,'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
102 <xsl:text>" </xsl:text>
103 <xsl:value-of select="refmeta/manvolnum[1]"/>
104 <xsl:text> "</xsl:text>
105 <xsl:value-of select="normalize-space($date)"/>
106 <xsl:text>" "</xsl:text>
107 <xsl:value-of select="normalize-space($productname)"/>
108 <xsl:text>" "</xsl:text>
109 <xsl:value-of select="$title"/>
112 <xsl:apply-templates/>
113 <xsl:text> </xsl:text>
115 <!-- Author section -->
117 <xsl:when test="refentryinfo//author">
118 <xsl:apply-templates select="refentryinfo" mode="authorsect"/>
125 <xsl:template match="informalexample|screen|programlisting">
126 <xsl:text>.nf </xsl:text>
127 <xsl:apply-templates/>
128 <xsl:text>.fi </xsl:text>
131 <xsl:template match="//emphasis">
132 <xsl:text>\fB</xsl:text>
133 <xsl:apply-templates/>
134 <xsl:text>\fR</xsl:text>
137 <xsl:template match="para|simpara|remark" mode="list">
138 <xsl:variable name="foo">
139 <xsl:apply-templates/>
141 <xsl:choose match="node()">
142 <!-- Don't normalize-space() for verbatim paragraphs -->
143 <xsl:when test="informalexample|screen|programlisting">
144 <xsl:value-of select="$foo"/>
147 <xsl:value-of select="normalize-space($foo)"/>
148 <xsl:text> </xsl:text>
151 <xsl:text> </xsl:text>
152 <xsl:if test="following-sibling::para or following-sibling::simpara or
153 following-sibling::remark">
154 <!-- Make sure multiple paragraphs within a list item don't -->
155 <!-- merge together. -->
156 <xsl:text> </xsl:text>
160 <xsl:template match="refsect3">
161 <xsl:text> .SS "</xsl:text>
162 <xsl:value-of select="title[1]"/>
163 <xsl:text>" </xsl:text>
164 <xsl:apply-templates/>