2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
xmlns:exsl="http://exslt.org/common"
6
<!-- ********************************************************************
7
$Id: inline.xsl 7897 2008-03-10 15:46:03Z xmldoc $
8
********************************************************************
10
This file is part of the XSL DocBook Stylesheet distribution.
11
See ../README or http://docbook.sf.net/release/xsl/current/ for
12
copyright and other information.
14
******************************************************************** -->
16
<!-- ==================================================================== -->
18
<xsl:template match="replaceable|varname|structfield">
19
<xsl:if test="$man.hyphenate.computer.inlines = 0">
20
<xsl:call-template name="suppress.hyphenation"/>
22
<xsl:call-template name="italic">
23
<xsl:with-param name="node" select="."/>
24
<xsl:with-param name="context" select="."/>
28
<xsl:template match="option|userinput|envar|errorcode|constant|markup">
29
<xsl:if test="$man.hyphenate.computer.inlines = 0">
30
<xsl:call-template name="suppress.hyphenation"/>
32
<xsl:call-template name="bold">
33
<xsl:with-param name="node" select="."/>
34
<xsl:with-param name="context" select="."/>
38
<xsl:template match="classname">
39
<xsl:if test="$man.hyphenate.computer.inlines = 0">
40
<xsl:call-template name="suppress.hyphenation"/>
42
<xsl:apply-templates/>
45
<xsl:template match="command">
46
<xsl:if test="$man.hyphenate.computer.inlines = 0">
47
<xsl:call-template name="suppress.hyphenation"/>
49
<xsl:call-template name="bold">
50
<xsl:with-param name="node" select="."/>
51
<xsl:with-param name="context" select="."/>
55
<xsl:template match="type[not(ancestor::cmdsynopsis) and
56
not(ancestor::funcsynopsis)]">
57
<xsl:if test="$man.hyphenate.computer.inlines = 0">
58
<xsl:call-template name="suppress.hyphenation"/>
60
<xsl:call-template name="bold">
61
<xsl:with-param name="node" select="."/>
62
<xsl:with-param name="context" select="."/>
66
<xsl:template match="function[not(ancestor::cmdsynopsis) and
67
not(ancestor::funcsynopsis)]">
68
<xsl:if test="$man.hyphenate.computer.inlines = 0">
69
<xsl:call-template name="suppress.hyphenation"/>
71
<xsl:call-template name="bold">
72
<xsl:with-param name="node" select="."/>
73
<xsl:with-param name="context" select="."/>
77
<xsl:template match="parameter[not(ancestor::cmdsynopsis) and
78
not(ancestor::funcsynopsis)]">
79
<xsl:if test="$man.hyphenate.computer.inlines = 0">
80
<xsl:call-template name="suppress.hyphenation"/>
82
<xsl:call-template name="italic">
83
<xsl:with-param name="node" select="."/>
84
<xsl:with-param name="context" select="."/>
88
<xsl:template match="filename">
89
<!-- * add hyphenation suppression in Filename output only if -->
90
<!-- * break.after.slash is also non-zero -->
91
<xsl:if test="$man.hyphenate.filenames = 0 and
92
$man.break.after.slash = 0">
93
<xsl:call-template name="suppress.hyphenation"/>
95
<!-- * part of the old man(7) man page, now man-pages(7), says, -->
96
<!-- * "Filenames (whether pathnames, or references to files in the -->
97
<!-- * /usr/include directory) are always in italics". But that's dumb, -->
98
<!-- * and looks like crap in PS/printed/PDF output, and there's no -->
99
<!-- * sound rationale for it, so we don't do it. -->
100
<xsl:call-template name="inline.monoseq"/>
103
<xsl:template match="emphasis">
109
<xsl:call-template name="bold">
110
<xsl:with-param name="node" select="."/>
111
<xsl:with-param name="context" select="."/>
115
<xsl:call-template name="italic">
116
<xsl:with-param name="node" select="."/>
117
<xsl:with-param name="context" select="."/>
123
<xsl:template match="optional">
124
<xsl:value-of select="$arg.choice.opt.open.str"/>
125
<xsl:apply-templates/>
126
<xsl:value-of select="$arg.choice.opt.close.str"/>
129
<xsl:template name="do-citerefentry">
130
<xsl:param name="refentrytitle" select="''"/>
131
<xsl:param name="manvolnum" select="''"/>
132
<xsl:variable name="title">
133
<xsl:value-of select="$refentrytitle"/>
135
<xsl:call-template name="bold">
136
<xsl:with-param name="node" select="exsl:node-set($title)"/>
137
<xsl:with-param name="context" select="."/>
139
<xsl:text>(</xsl:text>
140
<xsl:value-of select="$manvolnum"/>
141
<xsl:text>)</xsl:text>
144
<xsl:template match="citerefentry">
145
<xsl:call-template name="do-citerefentry">
146
<xsl:with-param name="refentrytitle" select="refentrytitle"/>
147
<xsl:with-param name="manvolnum" select="manvolnum"/>
151
<xsl:template match="trademark|productname">
152
<xsl:apply-templates/>
154
<!-- * Just use true Unicode chars for copyright, trademark, etc., -->
155
<!-- * symbols (by default, we later automatically translate them -->
156
<!-- * with the apply-string-subst-map template, or with the -->
157
<!-- * default character map, if man.charmap.enabled is true). -->
158
<xsl:when test="@class = 'copyright'">
159
<xsl:text>©</xsl:text>
161
<xsl:when test="@class = 'registered'">
162
<xsl:text>®</xsl:text>
164
<xsl:when test="@class = 'service'">
165
<xsl:text>℠</xsl:text>
167
<xsl:when test="@class = 'trade'">
168
<xsl:text>™</xsl:text>
170
<!-- * for Trademark element, render a trademark symbol by default -->
171
<!-- * even if no "class" value is specified -->
172
<xsl:when test="self::trademark" >
173
<xsl:text>™</xsl:text>
176
<!-- * otherwise we have a Productname with no value for the -->
177
<!-- * "class" attribute, so don't render any symbol by default -->
182
<!-- * span seems to sneak through into output sometimes, possibly due -->
183
<!-- * to failed Olink processing; so we need to catch it -->
184
<xsl:template match="span">
185
<xsl:apply-templates/>
188
<xsl:template match="inlinemediaobject">
189
<xsl:apply-templates/>
192
<!-- * indexterm instances produce groff comments like this: -->
193
<!-- * .\" primary: secondary: tertiary -->
194
<xsl:template match="indexterm">
195
<xsl:text>.\" </xsl:text>
196
<xsl:apply-templates/>
197
<xsl:text> </xsl:text>
200
<xsl:template match="primary">
201
<xsl:value-of select="normalize-space(.)"/>
204
<xsl:template match="secondary|tertiary">
205
<xsl:text>: </xsl:text>
206
<xsl:value-of select="normalize-space(.)"/>
209
<!-- * non-empty remark instances produce groff comments -->
210
<xsl:template match="remark">
211
<xsl:variable name="content" select="normalize-space(.)"/>
212
<xsl:if test="not($content = '')">
213
<xsl:text>.\" </xsl:text>
214
<xsl:value-of select="$content"/>
215
<xsl:text> </xsl:text>