1 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform" version=
"1.0">
2 <!-- vim:set syntax=xml ts=2 et: -->
3 <xsl:import href=
"../docbook/xsl/manpages/docbook.xsl"/>
5 <!-- Disable the automatically generated AUTHORS section by overloading the
6 respective template and making it a no-op. -->
7 <xsl:template match=
"articleinfo|bookinfo|refentryinfo" mode=
"authorsect"/>
10 Copied from ../docbook/xsl/manpages/docbook.xsl and changed it so that the
11 output file's name is harccoded to 'manpage.troff', and the quiet parameter
12 is set to 1 to avoid the 'Writing foo.X' message which write.text.chunk
15 <xsl:template match=
"refentry">
17 <xsl:variable name=
"section">
19 <xsl:when test=
"refmeta/manvolnum">
20 <xsl:value-of select=
"refmeta/manvolnum[1]"/>
22 <xsl:when test=
".//funcsynopsis">3</xsl:when>
23 <xsl:otherwise>1</xsl:otherwise>
27 <xsl:variable name=
"name" select=
"refnamediv/refname[1]"/>
29 <!-- standard man page width is 64 chars; 6 chars needed for the two
30 (x) volume numbers, and 2 spaces, leaves 56 -->
31 <xsl:variable name=
"twidth" select=
"(56 - string-length(refmeta/refentrytitle)) div 2"/>
33 <xsl:variable name=
"reftitle"
34 select=
"substring(refmeta/refentrytitle, 1, $twidth)"/>
36 <xsl:variable name=
"title">
38 <xsl:when test=
"refentryinfo/title">
39 <xsl:value-of select=
"refentryinfo/title"/>
41 <xsl:when test=
"../referenceinfo/title">
42 <xsl:value-of select=
"../referenceinfo/title"/>
47 <xsl:variable name=
"date">
49 <xsl:when test=
"refentryinfo/date">
50 <xsl:value-of select=
"refentryinfo/date"/>
52 <xsl:when test=
"../referenceinfo/date">
53 <xsl:value-of select=
"../referenceinfo/date"/>
58 <xsl:variable name=
"productname">
60 <xsl:when test=
"refentryinfo/productname">
61 <xsl:value-of select=
"refentryinfo/productname"/>
63 <xsl:when test=
"../referenceinfo/productname">
64 <xsl:value-of select=
"../referenceinfo/productname"/>
69 <xsl:variable name=
"filename">
70 <xsl:text>manpage.troff
</xsl:text>
73 <xsl:call-template name=
"write.text.chunk">
74 <xsl:with-param name=
"quiet" select=
"1"/>
75 <xsl:with-param name=
"filename" select=
"$filename"/>
76 <xsl:with-param name=
"content">
77 <xsl:text>.\
"Generated by db2man.xsl. Don't modify this, modify the source.
86 .de Sp \
" Vertical space (when we can't use .PP)
92 .ie \\n(.$
>=
3 .ne \\$
3
97 <xsl:value-of select="translate($reftitle,'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')
"/>
98 <xsl:text>" </xsl:text>
99 <xsl:value-of select=
"$section"/>
100 <xsl:text> "</xsl:text>
101 <xsl:value-of select="normalize-space($date)
"/>
102 <xsl:text>" "</xsl:text>
103 <xsl:value-of select="normalize-space($productname)
"/>
104 <xsl:text>" "</xsl:text>
105 <xsl:value-of select="$title
"/>
108 <xsl:apply-templates/>
109 <xsl:text> </xsl:text>
111 <!-- Author section -->
113 <xsl:when test=
"refentryinfo//author">
114 <xsl:apply-templates select=
"refentryinfo" mode=
"authorsect"/>
116 <xsl:when test=
"/book/bookinfo//author">
117 <xsl:apply-templates select=
"/book/bookinfo" mode=
"authorsect"/>
119 <xsl:when test=
"/article/articleinfo//author">
120 <xsl:apply-templates select=
"/article/articleinfo" mode=
"authorsect"/>
126 <!-- Now generate stub include pages for every page documented in
127 this refentry (except the page itself) -->
128 <xsl:for-each select=
"refnamediv/refname">
129 <xsl:if test=
". != $name">
130 <xsl:call-template name=
"write.text.chunk">
131 <xsl:with-param name=
"filename"
132 select=
"concat(normalize-space(.), '.', $section)"/>
133 <xsl:with-param name=
"content" select=
"concat('.so man',
134 $section, '/', $name, '.', $section, ' ')"/>