Debian Codegraph @

docs/xsl-generic/manpages/inline.xsl

raw
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 6843 2007-06-20 12:21:13Z 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">
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 <xsl:call-template name="italic">
96 <xsl:with-param name="node" select="."/>
97 <xsl:with-param name="context" select="."/>
98 </xsl:call-template>
99 </xsl:template>
100
101 <xsl:template match="emphasis">
102 <xsl:choose>
103 <xsl:when test="
104 @role = 'bold' or
105 @role = 'strong' or
106 @remap = 'B'">
107 <xsl:call-template name="bold">
108 <xsl:with-param name="node" select="."/>
109 <xsl:with-param name="context" select="."/>
110 </xsl:call-template>
111 </xsl:when>
112 <xsl:otherwise>
113 <xsl:call-template name="italic">
114 <xsl:with-param name="node" select="."/>
115 <xsl:with-param name="context" select="."/>
116 </xsl:call-template>
117 </xsl:otherwise>
118 </xsl:choose>
119 </xsl:template>
120
121 <xsl:template match="optional">
122 <xsl:value-of select="$arg.choice.opt.open.str"/>
123 <xsl:apply-templates/>
124 <xsl:value-of select="$arg.choice.opt.close.str"/>
125 </xsl:template>
126
127 <xsl:template name="do-citerefentry">
128 <xsl:param name="refentrytitle" select="''"/>
129 <xsl:param name="manvolnum" select="''"/>
130 <xsl:variable name="title">
131 <xsl:value-of select="$refentrytitle"/>
132 </xsl:variable>
133 <xsl:call-template name="bold">
134 <xsl:with-param name="node" select="exsl:node-set($title)"/>
135 <xsl:with-param name="context" select="."/>
136 </xsl:call-template>
137 <xsl:text>(</xsl:text>
138 <xsl:value-of select="$manvolnum"/>
139 <xsl:text>)</xsl:text>
140 </xsl:template>
141
142 <xsl:template match="citerefentry">
143 <xsl:call-template name="do-citerefentry">
144 <xsl:with-param name="refentrytitle" select="refentrytitle"/>
145 <xsl:with-param name="manvolnum" select="manvolnum"/>
146 </xsl:call-template>
147 </xsl:template>
148
149 <xsl:template match="trademark|productname">
150 <xsl:apply-templates/>
151 <xsl:choose>
152 <!-- * Just use true Unicode chars for copyright, trademark, etc., -->
153 <!-- * symbols (by default, we later automatically translate them -->
154 <!-- * with the apply-string-subst-map template, or with the -->
155 <!-- * default character map, if man.charmap.enabled is true). -->
156 <xsl:when test="@class = 'copyright'">
157 <xsl:text>&#x00a9;</xsl:text>
158 </xsl:when>
159 <xsl:when test="@class = 'registered'">
160 <xsl:text>&#x00ae;</xsl:text>
161 </xsl:when>
162 <xsl:when test="@class = 'service'">
163 <xsl:text>&#x2120;</xsl:text>
164 </xsl:when>
165 <xsl:when test="@class = 'trade'">
166 <xsl:text>&#x2122;</xsl:text>
167 </xsl:when>
168 <!-- * for Trademark element, render a trademark symbol by default -->
169 <!-- * even if no "class" value is specified -->
170 <xsl:when test="self::trademark" >
171 <xsl:text>&#x2122;</xsl:text>
172 </xsl:when>
173 <xsl:otherwise>
174 <!-- * otherwise we have a Productname with no value for the -->
175 <!-- * "class" attribute, so don't render any symbol by default -->
176 </xsl:otherwise>
177 </xsl:choose>
178 </xsl:template>
179
180 <!-- * span seems to sneak through into output sometimes, possibly due -->
181 <!-- * to failed Olink processing; so we need to catch it -->
182 <xsl:template match="span">
183 <xsl:apply-templates/>
184 </xsl:template>
185
186 <xsl:template match="inlinemediaobject">
187 <xsl:apply-templates/>
188 </xsl:template>
189
190 </xsl:stylesheet>