source: stylesheets/lfs-xsl/docbook-xsl-1.78.1/html/refentry.xsl@ 15c7d39

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 15c7d39 was 15c7d39, checked in by Matthew Burgess <matthew@…>, 11 years ago

Update stylesheets to docbook-xsl-1.78.1.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10355 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 9.3 KB
Line 
1<?xml version='1.0'?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 version='1.0'>
4
5<!-- ********************************************************************
6 $Id: refentry.xsl 9297 2012-04-22 03:56:16Z bobstayton $
7 ********************************************************************
8
9 This file is part of the XSL DocBook Stylesheet distribution.
10 See ../README or http://docbook.sf.net/release/xsl/current/ for
11 copyright and other information.
12
13 ******************************************************************** -->
14
15<!-- ==================================================================== -->
16
17<xsl:template match="reference">
18 <xsl:call-template name="id.warning"/>
19
20 <div>
21 <xsl:call-template name="common.html.attributes">
22 <xsl:with-param name="inherit" select="1"/>
23 </xsl:call-template>
24 <xsl:call-template name="id.attribute">
25 <xsl:with-param name="conditional" select="0"/>
26 </xsl:call-template>
27
28 <xsl:call-template name="reference.titlepage"/>
29
30 <xsl:variable name="toc.params">
31 <xsl:call-template name="find.path.params">
32 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
33 </xsl:call-template>
34 </xsl:variable>
35
36 <xsl:if test="not(partintro) and contains($toc.params, 'toc')">
37 <xsl:call-template name="division.toc"/>
38 </xsl:if>
39 <xsl:apply-templates/>
40 </div>
41</xsl:template>
42
43<xsl:template match="reference" mode="division.number">
44 <xsl:number from="book" count="reference" format="I."/>
45</xsl:template>
46
47<xsl:template match="reference/docinfo"></xsl:template>
48<xsl:template match="reference/referenceinfo"></xsl:template>
49<xsl:template match="reference/title"></xsl:template>
50<xsl:template match="reference/subtitle"></xsl:template>
51<xsl:template match="reference/titleabbrev"></xsl:template>
52
53<!-- ==================================================================== -->
54
55<xsl:template name="refentry.title">
56 <xsl:param name="node" select="."/>
57 <xsl:variable name="refmeta" select="$node//refmeta"/>
58 <xsl:variable name="refentrytitle" select="$refmeta//refentrytitle"/>
59 <xsl:variable name="refnamediv" select="$node//refnamediv"/>
60 <xsl:variable name="refname" select="$refnamediv//refname"/>
61 <xsl:variable name="refdesc" select="$refnamediv//refdescriptor"/>
62 <xsl:variable name="title">
63 <xsl:choose>
64 <xsl:when test="$refentrytitle">
65 <xsl:apply-templates select="$refentrytitle[1]" mode="title"/>
66 </xsl:when>
67 <xsl:when test="$refdesc">
68 <xsl:apply-templates select="$refdesc[1]" mode="title"/>
69 </xsl:when>
70 <xsl:when test="$refname">
71 <xsl:apply-templates select="$refname[1]" mode="title"/>
72 </xsl:when>
73 <xsl:otherwise></xsl:otherwise>
74 </xsl:choose>
75 </xsl:variable>
76
77 <h1 class="title">
78 <xsl:copy-of select="$title"/>
79 </h1>
80</xsl:template>
81
82<xsl:template match="refentry">
83 <xsl:call-template name="id.warning"/>
84
85 <div>
86 <xsl:call-template name="common.html.attributes">
87 <xsl:with-param name="inherit" select="1"/>
88 </xsl:call-template>
89 <xsl:call-template name="id.attribute">
90 <xsl:with-param name="conditional" select="0"/>
91 </xsl:call-template>
92 <xsl:if test="$refentry.separator != 0 and preceding-sibling::refentry">
93 <div class="refentry.separator">
94 <hr/>
95 </div>
96 </xsl:if>
97 <xsl:call-template name="anchor">
98 <xsl:with-param name="conditional" select="0"/>
99 </xsl:call-template>
100 <xsl:call-template name="refentry.titlepage"/>
101 <xsl:apply-templates/>
102 <xsl:call-template name="process.footnotes"/>
103 </div>
104</xsl:template>
105
106<xsl:template match="refentry/docinfo|refentry/refentryinfo"></xsl:template>
107<xsl:template match="refentry/info"></xsl:template>
108
109<xsl:template match="refentrytitle|refname|refdescriptor" mode="title">
110 <xsl:apply-templates/>
111</xsl:template>
112
113<xsl:template match="refmeta">
114</xsl:template>
115
116<xsl:template match="manvolnum">
117 <xsl:if test="$refentry.xref.manvolnum != 0">
118 <xsl:text>(</xsl:text>
119 <xsl:apply-templates/>
120 <xsl:text>)</xsl:text>
121 </xsl:if>
122</xsl:template>
123
124<xsl:template match="refmiscinfo">
125</xsl:template>
126
127<xsl:template match="refentrytitle">
128 <xsl:call-template name="inline.charseq"/>
129</xsl:template>
130
131<xsl:template match="refnamediv">
132 <div>
133 <xsl:call-template name="common.html.attributes">
134 <xsl:with-param name="inherit" select="1"/>
135 </xsl:call-template>
136 <xsl:call-template name="id.attribute"/>
137 <xsl:call-template name="anchor"/>
138
139 <xsl:choose>
140 <xsl:when test="preceding-sibling::refnamediv">
141 <!-- no title on secondary refnamedivs! -->
142 </xsl:when>
143 <xsl:when test="$refentry.generate.name != 0">
144 <h2>
145 <xsl:call-template name="gentext">
146 <xsl:with-param name="key" select="'RefName'"/>
147 </xsl:call-template>
148 </h2>
149 </xsl:when>
150 <xsl:when test="$refentry.generate.title != 0">
151 <h2>
152 <xsl:choose>
153 <xsl:when test="../refmeta/refentrytitle">
154 <xsl:apply-templates select="../refmeta/refentrytitle"/>
155 </xsl:when>
156 <xsl:otherwise>
157 <xsl:apply-templates select="refname[1]"/>
158 </xsl:otherwise>
159 </xsl:choose>
160 </h2>
161 </xsl:when>
162 </xsl:choose>
163
164 <p>
165 <xsl:apply-templates/>
166 </p>
167 </div>
168</xsl:template>
169
170<xsl:template match="refname">
171 <xsl:if test="not(preceding-sibling::refdescriptor)">
172 <xsl:apply-templates/>
173 <xsl:if test="following-sibling::refname">
174 <xsl:text>, </xsl:text>
175 </xsl:if>
176 </xsl:if>
177</xsl:template>
178
179<xsl:template match="refpurpose">
180 <xsl:if test="node()">
181 <xsl:text> </xsl:text>
182 <xsl:call-template name="dingbat">
183 <xsl:with-param name="dingbat">em-dash</xsl:with-param>
184 </xsl:call-template>
185 <xsl:text> </xsl:text>
186 <xsl:apply-templates/>
187 </xsl:if>
188</xsl:template>
189
190<xsl:template match="refdescriptor">
191 <xsl:apply-templates/>
192</xsl:template>
193
194<xsl:template match="refclass">
195 <xsl:if test="$refclass.suppress = 0">
196 <b>
197 <xsl:if test="@role">
198 <xsl:value-of select="@role"/>
199 <xsl:text>: </xsl:text>
200 </xsl:if>
201 <xsl:apply-templates/>
202 </b>
203 </xsl:if>
204</xsl:template>
205
206<xsl:template match="refsynopsisdiv">
207 <div>
208 <xsl:call-template name="common.html.attributes">
209 <xsl:with-param name="inherit" select="1"/>
210 </xsl:call-template>
211 <xsl:call-template name="id.attribute"/>
212 <xsl:call-template name="anchor"/>
213 <h2>
214 <xsl:choose>
215 <xsl:when test="refsynopsisdiv/title|title">
216 <xsl:apply-templates select="(refsynopsisdiv/title|title)[1]"
217 mode="titlepage.mode"/>
218 </xsl:when>
219 <xsl:otherwise>
220 <xsl:call-template name="gentext">
221 <xsl:with-param name="key" select="'RefSynopsisDiv'"/>
222 </xsl:call-template>
223 </xsl:otherwise>
224 </xsl:choose>
225 </h2>
226 <xsl:apply-templates/>
227 </div>
228</xsl:template>
229
230<xsl:template match="refsynopsisdivinfo"></xsl:template>
231
232<xsl:template match="refsynopsisdiv/title">
233</xsl:template>
234
235<xsl:template match="refsynopsisdiv/title" mode="titlepage.mode">
236 <xsl:apply-templates/>
237</xsl:template>
238
239<xsl:template match="refsection|refsect1|refsect2|refsect3">
240 <div>
241 <xsl:call-template name="common.html.attributes">
242 <xsl:with-param name="inherit" select="1"/>
243 </xsl:call-template>
244 <xsl:call-template name="id.attribute">
245 <xsl:with-param name="conditional" select="0"/>
246 </xsl:call-template>
247 <xsl:call-template name="anchor">
248 <xsl:with-param name="conditional" select="0"/>
249 </xsl:call-template>
250 <!-- pick up info title -->
251 <xsl:apply-templates select="(title|info/title)[1]"/>
252 <xsl:apply-templates select="node()[not(self::title) and not(self::info)]"/>
253 </div>
254</xsl:template>
255
256<xsl:template match="refsection/title|refsection/info/title">
257 <!-- the ID is output in the block.object call for refsect1 -->
258 <xsl:variable name="level" select="count(ancestor-or-self::refsection)"/>
259 <xsl:variable name="refsynopsisdiv">
260 <xsl:text>0</xsl:text>
261 <xsl:if test="ancestor::refsynopsisdiv">1</xsl:if>
262 </xsl:variable>
263 <xsl:variable name="hlevel">
264 <xsl:choose>
265 <xsl:when test="$level+$refsynopsisdiv &gt; 5">6</xsl:when>
266 <xsl:otherwise>
267 <xsl:value-of select="$level+1+$refsynopsisdiv"/>
268 </xsl:otherwise>
269 </xsl:choose>
270 </xsl:variable>
271 <xsl:element name="h{$hlevel}">
272 <xsl:apply-templates/>
273 </xsl:element>
274</xsl:template>
275
276<xsl:template match="refsect1/title|refsect1/info/title">
277 <!-- the ID is output in the block.object call for refsect1 -->
278 <h2>
279 <xsl:apply-templates/>
280 </h2>
281</xsl:template>
282
283<xsl:template match="refsect2/title|refsect2/info/title">
284 <!-- the ID is output in the block.object call for refsect2 -->
285 <h3>
286 <xsl:apply-templates/>
287 </h3>
288</xsl:template>
289
290<xsl:template match="refsect3/title|refsect3/info/title">
291 <!-- the ID is output in the block.object call for refsect3 -->
292 <h4>
293 <xsl:apply-templates/>
294 </h4>
295</xsl:template>
296
297<xsl:template match="refsectioninfo|refsection/info"></xsl:template>
298<xsl:template match="refsect1info|refsect1/info"></xsl:template>
299<xsl:template match="refsect2info|refsect2/info"></xsl:template>
300<xsl:template match="refsect3info|refsect3/info"></xsl:template>
301
302
303<!-- ==================================================================== -->
304
305</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.