Debian Codegraph @

doc/docbook-xsl/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$
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:apply-templates mode="italic" select="."/>
23 </xsl:template>
24
25 <xsl:template match="option|userinput|envar|errorcode|constant|markup">
26 <xsl:if test="$man.hyphenate.computer.inlines = 0">
27 <xsl:call-template name="suppress.hyphenation"/>
28 </xsl:if>
29 <xsl:apply-templates mode="bold" select="."/>
30 </xsl:template>
31
32 <xsl:template match="classname">
33 <xsl:if test="$man.hyphenate.computer.inlines = 0">
34 <xsl:call-template name="suppress.hyphenation"/>
35 </xsl:if>
36 <xsl:apply-templates/>
37 </xsl:template>
38
39 <xsl:template match="command">
40 <xsl:if test="$man.hyphenate.computer.inlines = 0">
41 <xsl:call-template name="suppress.hyphenation"/>
42 </xsl:if>
43 <xsl:apply-templates mode="bold" select="."/>
44 </xsl:template>
45
46 <xsl:template match="type[not(ancestor::cmdsynopsis) and
47 not(ancestor::funcsynopsis)]">
48 <xsl:if test="$man.hyphenate.computer.inlines = 0">
49 <xsl:call-template name="suppress.hyphenation"/>
50 </xsl:if>
51 <xsl:apply-templates mode="bold" select="."/>
52 </xsl:template>
53
54 <xsl:template match="function[not(ancestor::cmdsynopsis) and
55 not(ancestor::funcsynopsis)]">
56 <xsl:if test="$man.hyphenate.computer.inlines = 0">
57 <xsl:call-template name="suppress.hyphenation"/>
58 </xsl:if>
59 <xsl:apply-templates mode="bold" select="."/>
60 </xsl:template>
61
62 <xsl:template match="parameter[not(ancestor::cmdsynopsis) and
63 not(ancestor::funcsynopsis)]">
64 <xsl:if test="$man.hyphenate.computer.inlines = 0">
65 <xsl:call-template name="suppress.hyphenation"/>
66 </xsl:if>
67 <xsl:apply-templates mode="italic" select="."/>
68 </xsl:template>
69
70 <xsl:template match="filename">
71 <!-- * add hyphenation suppression in Filename output only if -->
72 <!-- * break.after.slash is also non-zero -->
73 <xsl:if test="$man.hyphenate.filenames = 0 and
74 $man.break.after.slash = 0">
75 <xsl:call-template name="suppress.hyphenation"/>
76 </xsl:if>
77 <xsl:apply-templates mode="italic" select="."/>
78 </xsl:template>
79
80 <xsl:template match="emphasis">
81 <xsl:choose>
82 <xsl:when test="@role = 'bold' or
83 @role = 'strong' or
84 @remap = 'B'">
85 <xsl:apply-templates mode="bold" select="."/>
86 </xsl:when>
87 <xsl:otherwise>
88 <xsl:apply-templates mode="italic" select="."/>
89 </xsl:otherwise>
90 </xsl:choose>
91 </xsl:template>
92
93 <xsl:template match="optional">
94 <xsl:value-of select="$arg.choice.opt.open.str"/>
95 <xsl:apply-templates/>
96 <xsl:value-of select="$arg.choice.opt.close.str"/>
97 </xsl:template>
98
99 <xsl:template name="do-citerefentry">
100 <xsl:param name="refentrytitle" select="''"/>
101 <xsl:param name="manvolnum" select="''"/>
102 <xsl:variable name="title">
103 <bold><xsl:value-of select="$refentrytitle"/></bold>
104 </xsl:variable>
105 <xsl:apply-templates mode="bold" select="exsl:node-set($title)"/>
106 <xsl:text>(</xsl:text>
107 <xsl:value-of select="$manvolnum"/>
108 <xsl:text>)</xsl:text>
109 </xsl:template>
110
111 <xsl:template match="citerefentry">
112 <xsl:call-template name="do-citerefentry">
113 <xsl:with-param name="refentrytitle" select="refentrytitle"/>
114 <xsl:with-param name="manvolnum" select="manvolnum"/>
115 </xsl:call-template>
116 </xsl:template>
117
118 <xsl:template match="trademark|productname">
119 <xsl:apply-templates/>
120 <xsl:choose>
121 <!-- * Just use true Unicode chars for copyright, trademark, etc., -->
122 <!-- * symbols (by default, we later automatically translate them -->
123 <!-- * with the apply-string-subst-map template, or with the -->
124 <!-- * default character map, if man.charmap.enabled is true). -->
125 <xsl:when test="@class = 'copyright'">
126 <xsl:text>&#x00a9;</xsl:text>
127 </xsl:when>
128 <xsl:when test="@class = 'registered'">
129 <xsl:text>&#x00ae;</xsl:text>
130 </xsl:when>
131 <xsl:when test="@class = 'service'">
132 <xsl:text>&#x2120;</xsl:text>
133 </xsl:when>
134 <xsl:when test="@class = 'trade'">
135 <xsl:text>&#x2122;</xsl:text>
136 </xsl:when>
137 <!-- * for Trademark element, render a trademark symbol by default -->
138 <!-- * even if no "class" value is specified -->
139 <xsl:when test="self::trademark" >
140 <xsl:text>&#x2122;</xsl:text>
141 </xsl:when>
142 <xsl:otherwise>
143 <!-- * otherwise we have a Productname with no value for the -->
144 <!-- * "class" attribute, so don't render any symbol by default -->
145 </xsl:otherwise>
146 </xsl:choose>
147 </xsl:template>
148
149 <!-- * span seems to sneak through into output sometimes, possibly due -->
150 <!-- * to failed Olink processing; so we need to catch it -->
151 <xsl:template match="span">
152 <xsl:apply-templates/>
153 </xsl:template>
154
155 <xsl:template match="inlinemediaobject">
156 <xsl:apply-templates/>
157 </xsl:template>
158
159 </xsl:stylesheet>