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"/>
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=
"itemizedlist/listitem">
33 <!-- * We output a real bullet here (rather than, "\(bu", -->
34 <!-- * the roff bullet) because, when we do character-map -->
35 <!-- * processing before final output, the character-map will -->
36 <!-- * handle conversion of the • to "\(bu" for us -->
37 <xsl:text> </xsl:text>
38 <xsl:text>.sp
</xsl:text>
39 <xsl:text> </xsl:text>
40 <xsl:text>.RS
</xsl:text>
41 <xsl:if test=
"not($list-indent = '')">
42 <xsl:text> </xsl:text>
43 <xsl:value-of select=
"$list-indent"/>
45 <xsl:text> </xsl:text>
46 <!-- * if "n" then we are using "nroff", which means the output is for -->
47 <!-- * TTY; so we do some fixed-width-font hackery with \h to make a -->
48 <!-- * hanging indent (instead of using .IP, which has some -->
49 <!-- * undesirable side effects under certain circumstances) -->
50 <xsl:call-template name=
"roff-if-else-start"/>
51 <xsl:text>\h'-
</xsl:text>
53 <xsl:when test=
"not($list-indent = '')">
54 <xsl:text>0</xsl:text>
55 <xsl:value-of select=
"$list-indent"/>
58 <xsl:text>\n(INu
</xsl:text>
61 <xsl:text>'
</xsl:text>
62 <xsl:text>•</xsl:text>
63 <xsl:text>\h'+
</xsl:text>
65 <xsl:when test=
"not($list-indent = '')">
66 <xsl:text>0</xsl:text>
67 <xsl:value-of select=
"$list-indent - 1"/>
70 <xsl:text>\n(INu-
1</xsl:text>
73 <xsl:text>'\c
</xsl:text>
74 <!-- * else, we are not using for "nroff", but instead "troff" - which -->
75 <!-- * means not for TTY, but for PS or whatever; so we’re not using a -->
76 <!-- * fixed-width font, so use a real .IP instead -->
77 <xsl:call-template name=
"roff-else"/>
78 <!-- * .IP generates a blank like of space, so let’s go backwards one -->
79 <!-- * line up to compensate for that -->
80 <xsl:text>.sp -
1 </xsl:text>
81 <xsl:text>.IP \(bu
2.3 </xsl:text>
82 <!-- * The value 2.3 is the amount of indentation; we use 2.3 instead -->
83 <!-- * of 2 because when the font family is New Century Schoolbook it -->
84 <!-- * seems to require the extra space. -->
85 <xsl:call-template name=
"roff-if-end"/>
86 <xsl:apply-templates/>
87 <xsl:if test=
" following-sibling::listitem">
88 <xsl:text> .RE
</xsl:text>
92 <xsl:template match=
"itemizedlist|orderedlist|procedure">
94 <xsl:text>.PP
</xsl:text>
95 <xsl:call-template name=
"bold">
96 <xsl:with-param name=
"node" select=
"title"/>
97 <xsl:with-param name=
"context" select=
"."/>
99 <xsl:text> </xsl:text>
101 <!-- * DocBook allows just about any block content to appear in -->
102 <!-- * lists before the actual list items, so we need to get that -->
103 <!-- * content (if any) before getting the list items -->
105 select=
"*[not(self::listitem) and not(self::title)]"/>
106 <xsl:apply-templates select=
"listitem"/>
107 <xsl:if test=
"(parent::para or parent::listitem) or following-sibling::node()">
108 <xsl:text>.sp
</xsl:text>
109 <xsl:text>.RE
</xsl:text>
113 <xsl:template match=
"refsect3">
114 <xsl:text> .SS
"</xsl:text>
115 <xsl:value-of select="title[
1]
"/>
116 <xsl:text>" </xsl:text>
117 <xsl:apply-templates/>
120 <!-- ================================================================== -->
121 <!-- These macros are from Docbook manpages XSLT development tree -->
122 <!-- help to maintain manpage generation clean when difference between -->
123 <!-- roff processors is important to note. -->
125 <xsl:template name=
"roff-if-else-start">
126 <xsl:param name=
"condition">n
</xsl:param>
127 <xsl:text>.ie
</xsl:text>
128 <xsl:value-of select=
"$condition"/>
129 <xsl:text> \{\
</xsl:text>
132 <xsl:template name=
"roff-if-start">
133 <xsl:param name=
"condition">n
</xsl:param>
134 <xsl:text>.if
</xsl:text>
135 <xsl:value-of select=
"$condition"/>
136 <xsl:text> \{\
</xsl:text>
139 <xsl:template name=
"roff-else">
140 <xsl:text>.\}
</xsl:text>
141 <xsl:text>.el \{\
</xsl:text>
144 <xsl:template name=
"roff-if-end">
145 <xsl:text>.\}
</xsl:text>