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"/>
11 <xsl:param name="base.dir" select="'../../manpages/'"/>
14 Our ulink stylesheet omits @url part if content was specified
16 <xsl:template match="ulink">
17 <xsl:variable name="content">
18 <xsl:apply-templates/>
20 <xsl:if test="$content = ''">
21 <xsl:text>: </xsl:text>
23 <xsl:if test="$content != ''">
24 <xsl:value-of select="$content" />
26 <xsl:if test="$content = ''">
27 <xsl:apply-templates mode="italic" select="@url" />
31 <xsl:template match="refentry">
33 <xsl:variable name="section" select="refmeta/manvolnum"/>
34 <xsl:variable name="name" select="refnamediv/refname[1]"/>
35 <xsl:variable name="base.dir" select="$base.dir"/>
36 <!-- standard man page width is 64 chars; 6 chars needed for the two
37 (x) volume numbers, and 2 spaces, leaves 56 -->
38 <xsl:variable name="twidth" select="(74 - string-length(refmeta/refentrytitle)) div 2"/>
40 <xsl:variable name="reftitle"
41 select="substring(refmeta/refentrytitle, 1, $twidth)"/>
43 <xsl:variable name="title">
45 <xsl:when test="refentryinfo/title">
46 <xsl:value-of select="refentryinfo/title"/>
48 <xsl:when test="../referenceinfo/title">
49 <xsl:value-of select="../referenceinfo/title"/>
54 <xsl:variable name="date">
56 <xsl:when test="refentryinfo/date">
57 <xsl:value-of select="refentryinfo/date"/>
59 <xsl:when test="../referenceinfo/date">
60 <xsl:value-of select="../referenceinfo/date"/>
65 <xsl:variable name="productname">
67 <xsl:when test="refentryinfo/productname">
68 <xsl:value-of select="refentryinfo/productname"/>
70 <xsl:when test="../referenceinfo/productname">
71 <xsl:value-of select="../referenceinfo/productname"/>
76 <xsl:call-template name="write.text.chunk">
77 <xsl:with-param name="filename"
78 select="concat($base.dir, normalize-space ($name), '.', $section)"/>
79 <xsl:with-param name="content">
80 <xsl:text>.\"Generated by db2man.xsl. Don't modify this, modify the source.
89 .de Sp \" Vertical space (when we can't use .PP)
95 .ie \\n(.$>=3 .ne \\$3
100 <xsl:value-of select="translate($reftitle,'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
101 <xsl:text>" </xsl:text>
102 <xsl:value-of select="refmeta/manvolnum[1]"/>
103 <xsl:text> "</xsl:text>
104 <xsl:value-of select="normalize-space($date)"/>
105 <xsl:text>" "</xsl:text>
106 <xsl:value-of select="normalize-space($productname)"/>
107 <xsl:text>" "</xsl:text>
108 <xsl:value-of select="$title"/>
111 <xsl:apply-templates/>
112 <xsl:text> </xsl:text>
114 <!-- Author section -->
116 <xsl:when test="refentryinfo//author">
117 <xsl:apply-templates select="refentryinfo" mode="authorsect"/>
124 <xsl:template match="informalexample|screen|programlisting">
125 <xsl:text>.nf </xsl:text>
126 <xsl:apply-templates/>
127 <xsl:text>.fi </xsl:text>
130 <xsl:template match="//emphasis">
131 <xsl:text>\fB</xsl:text>
132 <xsl:apply-templates/>
133 <xsl:text>\fR</xsl:text>
136 <xsl:template match="para|simpara|remark" mode="list">
137 <xsl:variable name="foo">
138 <xsl:apply-templates/>
140 <xsl:choose match="node()">
141 <!-- Don't normalize-space() for verbatim paragraphs -->
142 <xsl:when test="informalexample|screen|programlisting">
143 <xsl:value-of select="$foo"/>
146 <xsl:value-of select="normalize-space($foo)"/>
147 <xsl:text> </xsl:text>
150 <xsl:text> </xsl:text>
151 <xsl:if test="following-sibling::para or following-sibling::simpara or
152 following-sibling::remark">
153 <!-- Make sure multiple paragraphs within a list item don't -->
154 <!-- merge together. -->
155 <xsl:text> </xsl:text>