1 | <?xml version='1.0'?>
|
---|
2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
3 | xmlns:exsl="http://exslt.org/common"
|
---|
4 | version='1.0'>
|
---|
5 |
|
---|
6 | <!-- ********************************************************************
|
---|
7 | $Id: inline.xsl 7897 2008-03-10 15:46:03Z xmldoc $
|
---|
8 | ********************************************************************
|
---|
9 |
|
---|
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.
|
---|
13 |
|
---|
14 | ******************************************************************** -->
|
---|
15 |
|
---|
16 | <!-- ==================================================================== -->
|
---|
17 |
|
---|
18 | <xsl:template match="replaceable|varname|structfield">
|
---|
19 | <xsl:if test="$man.hyphenate.computer.inlines = 0">
|
---|
20 | <xsl:call-template name="suppress.hyphenation"/>
|
---|
21 | </xsl:if>
|
---|
22 | <xsl:call-template name="italic">
|
---|
23 | <xsl:with-param name="node" select="."/>
|
---|
24 | <xsl:with-param name="context" select="."/>
|
---|
25 | </xsl:call-template>
|
---|
26 | </xsl:template>
|
---|
27 |
|
---|
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"/>
|
---|
31 | </xsl:if>
|
---|
32 | <xsl:call-template name="bold">
|
---|
33 | <xsl:with-param name="node" select="."/>
|
---|
34 | <xsl:with-param name="context" select="."/>
|
---|
35 | </xsl:call-template>
|
---|
36 | </xsl:template>
|
---|
37 |
|
---|
38 | <xsl:template match="classname">
|
---|
39 | <xsl:if test="$man.hyphenate.computer.inlines = 0">
|
---|
40 | <xsl:call-template name="suppress.hyphenation"/>
|
---|
41 | </xsl:if>
|
---|
42 | <xsl:apply-templates/>
|
---|
43 | </xsl:template>
|
---|
44 |
|
---|
45 | <xsl:template match="command">
|
---|
46 | <xsl:if test="$man.hyphenate.computer.inlines = 0">
|
---|
47 | <xsl:call-template name="suppress.hyphenation"/>
|
---|
48 | </xsl:if>
|
---|
49 | <xsl:call-template name="bold">
|
---|
50 | <xsl:with-param name="node" select="."/>
|
---|
51 | <xsl:with-param name="context" select="."/>
|
---|
52 | </xsl:call-template>
|
---|
53 | </xsl:template>
|
---|
54 |
|
---|
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"/>
|
---|
59 | </xsl:if>
|
---|
60 | <xsl:call-template name="bold">
|
---|
61 | <xsl:with-param name="node" select="."/>
|
---|
62 | <xsl:with-param name="context" select="."/>
|
---|
63 | </xsl:call-template>
|
---|
64 | </xsl:template>
|
---|
65 |
|
---|
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"/>
|
---|
70 | </xsl:if>
|
---|
71 | <xsl:call-template name="bold">
|
---|
72 | <xsl:with-param name="node" select="."/>
|
---|
73 | <xsl:with-param name="context" select="."/>
|
---|
74 | </xsl:call-template>
|
---|
75 | </xsl:template>
|
---|
76 |
|
---|
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"/>
|
---|
81 | </xsl:if>
|
---|
82 | <xsl:call-template name="italic">
|
---|
83 | <xsl:with-param name="node" select="."/>
|
---|
84 | <xsl:with-param name="context" select="."/>
|
---|
85 | </xsl:call-template>
|
---|
86 | </xsl:template>
|
---|
87 |
|
---|
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"/>
|
---|
94 | </xsl:if>
|
---|
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"/>
|
---|
101 | </xsl:template>
|
---|
102 |
|
---|
103 | <xsl:template match="emphasis">
|
---|
104 | <xsl:choose>
|
---|
105 | <xsl:when test="
|
---|
106 | @role = 'bold' or
|
---|
107 | @role = 'strong' or
|
---|
108 | @remap = 'B'">
|
---|
109 | <xsl:call-template name="bold">
|
---|
110 | <xsl:with-param name="node" select="."/>
|
---|
111 | <xsl:with-param name="context" select="."/>
|
---|
112 | </xsl:call-template>
|
---|
113 | </xsl:when>
|
---|
114 | <xsl:otherwise>
|
---|
115 | <xsl:call-template name="italic">
|
---|
116 | <xsl:with-param name="node" select="."/>
|
---|
117 | <xsl:with-param name="context" select="."/>
|
---|
118 | </xsl:call-template>
|
---|
119 | </xsl:otherwise>
|
---|
120 | </xsl:choose>
|
---|
121 | </xsl:template>
|
---|
122 |
|
---|
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"/>
|
---|
127 | </xsl:template>
|
---|
128 |
|
---|
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"/>
|
---|
134 | </xsl:variable>
|
---|
135 | <xsl:call-template name="bold">
|
---|
136 | <xsl:with-param name="node" select="exsl:node-set($title)"/>
|
---|
137 | <xsl:with-param name="context" select="."/>
|
---|
138 | </xsl:call-template>
|
---|
139 | <xsl:text>(</xsl:text>
|
---|
140 | <xsl:value-of select="$manvolnum"/>
|
---|
141 | <xsl:text>)</xsl:text>
|
---|
142 | </xsl:template>
|
---|
143 |
|
---|
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"/>
|
---|
148 | </xsl:call-template>
|
---|
149 | </xsl:template>
|
---|
150 |
|
---|
151 | <xsl:template match="trademark|productname">
|
---|
152 | <xsl:apply-templates/>
|
---|
153 | <xsl:choose>
|
---|
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>
|
---|
160 | </xsl:when>
|
---|
161 | <xsl:when test="@class = 'registered'">
|
---|
162 | <xsl:text>®</xsl:text>
|
---|
163 | </xsl:when>
|
---|
164 | <xsl:when test="@class = 'service'">
|
---|
165 | <xsl:text>℠</xsl:text>
|
---|
166 | </xsl:when>
|
---|
167 | <xsl:when test="@class = 'trade'">
|
---|
168 | <xsl:text>™</xsl:text>
|
---|
169 | </xsl:when>
|
---|
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>
|
---|
174 | </xsl:when>
|
---|
175 | <xsl:otherwise>
|
---|
176 | <!-- * otherwise we have a Productname with no value for the -->
|
---|
177 | <!-- * "class" attribute, so don't render any symbol by default -->
|
---|
178 | </xsl:otherwise>
|
---|
179 | </xsl:choose>
|
---|
180 | </xsl:template>
|
---|
181 |
|
---|
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/>
|
---|
186 | </xsl:template>
|
---|
187 |
|
---|
188 | <xsl:template match="inlinemediaobject">
|
---|
189 | <xsl:apply-templates/>
|
---|
190 | </xsl:template>
|
---|
191 |
|
---|
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>
|
---|
198 | </xsl:template>
|
---|
199 |
|
---|
200 | <xsl:template match="primary">
|
---|
201 | <xsl:value-of select="normalize-space(.)"/>
|
---|
202 | </xsl:template>
|
---|
203 |
|
---|
204 | <xsl:template match="secondary|tertiary">
|
---|
205 | <xsl:text>: </xsl:text>
|
---|
206 | <xsl:value-of select="normalize-space(.)"/>
|
---|
207 | </xsl:template>
|
---|
208 |
|
---|
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>
|
---|
216 | </xsl:if>
|
---|
217 | </xsl:template>
|
---|
218 |
|
---|
219 | </xsl:stylesheet>
|
---|