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=
"http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/>
8 <xsl:param name=
"chunk.section.depth" select=
"0"/>
9 <xsl:param name=
"chunk.first.sections" select=
"1"/>
10 <xsl:param name=
"use.id.as.filename" select=
"1"/>
13 Our ulink stylesheet omits @url part if content was specified
15 <xsl:template match=
"ulink">
16 <xsl:variable name=
"content">
17 <xsl:apply-templates/>
19 <xsl:if test=
"$content = ''">
20 <xsl:text>:
</xsl:text>
22 <xsl:if test=
"$content != ''">
23 <xsl:value-of select=
"$content" />
25 <xsl:if test=
"$content = ''">
26 <xsl:apply-templates mode=
"italic" select=
"@url" />
30 <xsl:template match=
"refentry">
32 <xsl:variable name=
"section" select=
"refmeta/manvolnum"/>
33 <xsl:variable name=
"name" select=
"refnamediv/refname[1]"/>
34 <xsl:variable name=
"base.dir" select=
"$base.dir"/>
35 <!-- standard man page width is 64 chars; 6 chars needed for the two
36 (x) volume numbers, and 2 spaces, leaves 56 -->
37 <xsl:variable name=
"twidth" select=
"(74 - string-length(refmeta/refentrytitle)) div 2"/>
39 <xsl:variable name=
"reftitle"
40 select=
"substring(refmeta/refentrytitle, 1, $twidth)"/>
42 <xsl:variable name=
"title">
44 <xsl:when test=
"refentryinfo/title">
45 <xsl:value-of select=
"refentryinfo/title"/>
47 <xsl:when test=
"../referenceinfo/title">
48 <xsl:value-of select=
"../referenceinfo/title"/>
53 <xsl:variable name=
"date">
55 <xsl:when test=
"refentryinfo/date">
56 <xsl:value-of select=
"refentryinfo/date"/>
58 <xsl:when test=
"../referenceinfo/date">
59 <xsl:value-of select=
"../referenceinfo/date"/>
64 <xsl:variable name=
"productname">
66 <xsl:when test=
"refentryinfo/productname">
67 <xsl:value-of select=
"refentryinfo/productname"/>
69 <xsl:when test=
"../referenceinfo/productname">
70 <xsl:value-of select=
"../referenceinfo/productname"/>
75 <xsl:call-template name=
"write.text.chunk">
76 <xsl:with-param name=
"filename"
77 select=
"concat($base.dir, normalize-space ($name), '.', $section)"/>
78 <xsl:with-param name=
"content">
79 <xsl:text>.\
"Generated by db2man.xsl. Don't modify this, modify the source.
88 .de Sp \
" Vertical space (when we can't use .PP)
94 .ie \\n(.$
>=
3 .ne \\$
3
99 <xsl:value-of select="translate($reftitle,'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')
"/>
100 <xsl:text>" </xsl:text>
101 <xsl:value-of select=
"refmeta/manvolnum[1]"/>
102 <xsl:text> "</xsl:text>
103 <xsl:value-of select="normalize-space($date)
"/>
104 <xsl:text>" "</xsl:text>
105 <xsl:value-of select="normalize-space($productname)
"/>
106 <xsl:text>" "</xsl:text>
107 <xsl:value-of select="$title
"/>
110 <xsl:apply-templates/>
111 <xsl:text> </xsl:text>
113 <!-- Author section -->
115 <xsl:when test=
"refentryinfo//author">
116 <xsl:apply-templates select=
"refentryinfo" mode=
"authorsect"/>
123 <xsl:template match=
"informalexample|screen|programlisting">
124 <xsl:text> .nf
</xsl:text>
125 <xsl:apply-templates/>
126 <xsl:text> .fi
</xsl:text>
129 <xsl:template match=
"//emphasis">
130 <xsl:text>\fB
</xsl:text>
131 <xsl:apply-templates/>
132 <xsl:text>\fR
</xsl:text>
135 <xsl:template match=
"//quote">
136 <xsl:text>\fB
</xsl:text>
137 <xsl:apply-templates/>
138 <xsl:text>\fR
</xsl:text>
141 <xsl:template match=
"para|simpara|remark" mode=
"list">
142 <xsl:variable name=
"foo">
143 <xsl:apply-templates/>
145 <xsl:choose match=
"node()">
146 <!-- Don't normalize-space() for verbatim paragraphs -->
147 <xsl:when test=
"informalexample|screen|programlisting">
148 <xsl:value-of select=
"$foo"/>
151 <xsl:value-of select=
"normalize-space($foo)"/>
152 <xsl:text> </xsl:text>
155 <xsl:text> </xsl:text>
156 <xsl:if test=
"following-sibling::para or following-sibling::simpara or
157 following-sibling::remark">
158 <!-- Make sure multiple paragraphs within a list item don't -->
159 <!-- merge together. -->
160 <xsl:text> </xsl:text>
164 <xsl:template match=
"refsect3">
165 <xsl:text> .SS
"</xsl:text>
166 <xsl:value-of select="title[
1]
"/>
167 <xsl:text>" </xsl:text>
168 <xsl:apply-templates/>