2 <!-- vim:set sts=2 shiftwidth=2 syntax=xml: -->
3 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
4 xmlns:xlink='http://www.w3.org/
1999/xlink'
7 <xsl:import href=
"http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/>
9 <xsl:param name=
"chunk.section.depth" select=
"0"/>
10 <xsl:param name=
"chunk.first.sections" select=
"1"/>
11 <xsl:param name=
"use.id.as.filename" select=
"1"/>
12 <xsl:param name=
"man.endnotes.are.numbered" select=
"0"/>
14 <!-- make room for long version numbers -->
15 <xsl:param name=
"man.th.extra2.max.length">40</xsl:param>
18 Our ulink stylesheet omits @url part if content was specified
20 <xsl:template match=
"ulink">
21 <xsl:variable name=
"content">
22 <xsl:apply-templates/>
24 <xsl:if test=
"$content = ''">
25 <xsl:text>:
</xsl:text>
27 <xsl:if test=
"$content != ''">
28 <xsl:value-of select=
"$content" />
30 <xsl:if test=
"$content = ''">
31 <xsl:apply-templates mode=
"italic" select=
"@url" />
35 <xsl:template match=
"itemizedlist|orderedlist|procedure">
37 <xsl:text>.PP
</xsl:text>
38 <xsl:call-template name=
"bold">
39 <xsl:with-param name=
"node" select=
"title"/>
40 <xsl:with-param name=
"context" select=
"."/>
42 <xsl:text> </xsl:text>
44 <!-- * DocBook allows just about any block content to appear in -->
45 <!-- * lists before the actual list items, so we need to get that -->
46 <!-- * content (if any) before getting the list items -->
48 select=
"*[not(self::listitem) and not(self::title)]"/>
49 <xsl:text> .RS
</xsl:text>
50 <xsl:apply-templates select=
"listitem"/>
51 <xsl:if test=
"(parent::para or parent::listitem) or following-sibling::node()">
52 <xsl:text>.sp
</xsl:text>
53 <xsl:text>.RE
</xsl:text>
57 <xsl:template match=
"refsect3">
58 <xsl:text> .SS
"</xsl:text>
59 <xsl:value-of select="title[
1]
"/>
60 <xsl:text>" </xsl:text>
61 <xsl:apply-templates/>
64 <!-- ================================================================== -->
65 <!-- These macros are from Docbook manpages XSLT development tree -->
66 <!-- help to maintain manpage generation clean when difference between -->
67 <!-- roff processors is important to note. -->
69 <xsl:template name=
"roff-if-else-start">
70 <xsl:param name=
"condition">n
</xsl:param>
71 <xsl:text>.ie
</xsl:text>
72 <xsl:value-of select=
"$condition"/>
73 <xsl:text> \{\
</xsl:text>
76 <xsl:template name=
"roff-if-start">
77 <xsl:param name=
"condition">n
</xsl:param>
78 <xsl:text>.if
</xsl:text>
79 <xsl:value-of select=
"$condition"/>
80 <xsl:text> \{\
</xsl:text>
83 <xsl:template name=
"roff-else">
84 <xsl:text>.\}
</xsl:text>
85 <xsl:text>.el \{\
</xsl:text>
88 <xsl:template name=
"roff-if-end">
89 <xsl:text>.\}
</xsl:text>