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