1 | <?xml version='1.0'?> |
---|
2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
---|
3 | version='1.0'> |
---|
4 | |
---|
5 | <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.48/html/docbook.xsl"/> |
---|
6 | <xsl:include href="yelp-custom.xsl"/> |
---|
7 | |
---|
8 | <xsl:param name="gdb_docname" /> |
---|
9 | |
---|
10 | <xsl:param name="gdb_pathname" /> |
---|
11 | |
---|
12 | <xsl:param name="gdb_rootid" select="''" /> |
---|
13 | |
---|
14 | <xsl:param name="gdb_multichunk" select="0" /> |
---|
15 | |
---|
16 | <xsl:param name="gdb_stylesheet_path" select="'No Stylesheet'" /> |
---|
17 | |
---|
18 | <xsl:output encoding="ISO-8859-1" /> |
---|
19 | |
---|
20 | <!-- Specifies the default path for admonition graphics --> |
---|
21 | <xsl:param name="admon.graphics.path"><xsl:text>file://</xsl:text><xsl:value-of select="$gdb_stylesheet_path"/><xsl:text>/images/</xsl:text></xsl:param> |
---|
22 | |
---|
23 | <xsl:param name="table.borders.with.css" select="1"/> |
---|
24 | |
---|
25 | <!-- direct parametrisation --> |
---|
26 | <xsl:param name="admon.style"><xsl:text>margin-left: 0</xsl:text></xsl:param> |
---|
27 | |
---|
28 | <!-- |
---|
29 | <xsl:template match="graphic"> |
---|
30 | <p> |
---|
31 | <img> |
---|
32 | <xsl:attribute name="src"> |
---|
33 | <xsl:text>file://</xsl:text> |
---|
34 | <xsl:value-of select="$gdb_pathname"/> |
---|
35 | <xsl:text>/figures/example_panel.png</xsl:text> |
---|
36 | </xsl:attribute> |
---|
37 | </img> |
---|
38 | </p> |
---|
39 | </xsl:template> |
---|
40 | --> |
---|
41 | |
---|
42 | <xsl:template name="process.image"> |
---|
43 | <!-- When this template is called, the current node should be --> |
---|
44 | <!-- a graphic, inlinegraphic, imagedata, or videodata. All --> |
---|
45 | <!-- those elements have the same set of attributes, so we can --> |
---|
46 | <!-- handle them all in one place. --> |
---|
47 | <xsl:param name="tag" select="'img'"/> |
---|
48 | <xsl:param name="alt"/> |
---|
49 | |
---|
50 | <xsl:variable name="filename"> |
---|
51 | <xsl:choose> |
---|
52 | <xsl:when test="local-name(.) = 'graphic' |
---|
53 | or local-name(.) = 'inlinegraphic'"> |
---|
54 | <xsl:choose> |
---|
55 | <xsl:when test="@fileref"> |
---|
56 | <xsl:value-of select="@fileref"/> |
---|
57 | </xsl:when> |
---|
58 | <xsl:when test="@entityref"> |
---|
59 | <xsl:value-of select="unparsed-entity-uri(@entityref)"/> |
---|
60 | </xsl:when> |
---|
61 | <xsl:otherwise> |
---|
62 | <xsl:message> |
---|
63 | <xsl:text>A fileref or entityref is required on </xsl:text> |
---|
64 | <xsl:value-of select="local-name(.)"/> |
---|
65 | </xsl:message> |
---|
66 | </xsl:otherwise> |
---|
67 | </xsl:choose> |
---|
68 | </xsl:when> |
---|
69 | <xsl:otherwise> |
---|
70 | <!-- imagedata, videodata, audiodata --> |
---|
71 | <xsl:call-template name="mediaobject.filename"> |
---|
72 | <xsl:with-param name="object" select=".."/> |
---|
73 | </xsl:call-template> |
---|
74 | </xsl:otherwise> |
---|
75 | </xsl:choose> |
---|
76 | </xsl:variable> |
---|
77 | |
---|
78 | <xsl:variable name="width"> |
---|
79 | <xsl:choose> |
---|
80 | <xsl:when test="@scale"><xsl:value-of select="@scale"/>%</xsl:when> |
---|
81 | <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when> |
---|
82 | <xsl:otherwise></xsl:otherwise> |
---|
83 | </xsl:choose> |
---|
84 | </xsl:variable> |
---|
85 | |
---|
86 | <xsl:variable name="height"> |
---|
87 | <xsl:choose> |
---|
88 | <xsl:when test="@scale"></xsl:when> |
---|
89 | <xsl:when test="@depth"><xsl:value-of select="@depth"/></xsl:when> |
---|
90 | <xsl:otherwise></xsl:otherwise> |
---|
91 | </xsl:choose> |
---|
92 | </xsl:variable> |
---|
93 | |
---|
94 | <xsl:variable name="align"> |
---|
95 | <xsl:value-of select="@align"/> |
---|
96 | </xsl:variable> |
---|
97 | |
---|
98 | <xsl:element name="{$tag}"> |
---|
99 | <xsl:attribute name="src"> |
---|
100 | |
---|
101 | <xsl:text>file://</xsl:text> |
---|
102 | <xsl:value-of select="$gdb_pathname"/> |
---|
103 | <xsl:text>/</xsl:text> |
---|
104 | <xsl:value-of select="$filename"/> |
---|
105 | </xsl:attribute> |
---|
106 | |
---|
107 | <xsl:if test="$align != ''"> |
---|
108 | <xsl:attribute name="align"> |
---|
109 | <xsl:value-of select="$align"/> |
---|
110 | </xsl:attribute> |
---|
111 | </xsl:if> |
---|
112 | <xsl:if test="$height != ''"> |
---|
113 | <xsl:attribute name="height"> |
---|
114 | <xsl:value-of select="$height"/> |
---|
115 | </xsl:attribute> |
---|
116 | </xsl:if> |
---|
117 | <xsl:if test="$width != ''"> |
---|
118 | <xsl:attribute name="width"> |
---|
119 | <xsl:value-of select="$width"/> |
---|
120 | </xsl:attribute> |
---|
121 | </xsl:if> |
---|
122 | <xsl:if test="$alt != ''"> |
---|
123 | <xsl:attribute name="alt"> |
---|
124 | <xsl:value-of select="$alt"/> |
---|
125 | </xsl:attribute> |
---|
126 | </xsl:if> |
---|
127 | </xsl:element> |
---|
128 | </xsl:template> |
---|
129 | |
---|
130 | <!-- we are cheating here - but there isn't another way--> |
---|
131 | |
---|
132 | <xsl:template name="href.target"> |
---|
133 | <xsl:param name="object" select="."/> |
---|
134 | <xsl:text>ghelp:</xsl:text> |
---|
135 | <xsl:value-of select="$gdb_docname"/> |
---|
136 | <xsl:text>?</xsl:text> |
---|
137 | <xsl:value-of select="$object/@id"/> |
---|
138 | </xsl:template> |
---|
139 | |
---|
140 | <!-- make a small custom css stylesheet reside in <head>...</head> --> |
---|
141 | |
---|
142 | <xsl:template name="user.head.content"> |
---|
143 | <style> |
---|
144 | <xsl:text> |
---|
145 | B {font-weight: bold} |
---|
146 | LI {margin-bottom: 0.66em;} |
---|
147 | UL LI {margin-left: 1em} |
---|
148 | OL LI {margin-left: 1.5em} |
---|
149 | LI P {margin-bottom: 0} |
---|
150 | LI P {margin-top: 0} |
---|
151 | P.header-title {text-align: center; margin-top: 0; margin-bottom: 0} |
---|
152 | P.copyright {margin-bottom: 0; margin-top: 0} |
---|
153 | H2 + P.copyright {margin-top: 1em} |
---|
154 | DIV.legalnotice P {font-size: 0.8em} |
---|
155 | DIV.revhistory TR {vertical-align: top} |
---|
156 | TT {font-family: monospace} |
---|
157 | P.about {margin-bottom: 0} |
---|
158 | DD P {margin-top: 0} |
---|
159 | DD P {margin-bottom: 0} |
---|
160 | OL {margin-top: 0; margin-bottom: 0} |
---|
161 | LI OL {margin-left: 2em; margin-top: 0.66em} |
---|
162 | UL {margin-top: 0; margin-bottom: 0} |
---|
163 | LI UL {margin-left: 2em; margin-top: 0.66em} |
---|
164 | OL LI UL {list-style-type: disc} |
---|
165 | UL LI UL {list-style-type: circle} |
---|
166 | OL LI OL {list-style-type: lower-alpha} |
---|
167 | DD {margin-left: 2em} |
---|
168 | DL {margin-top: 0} |
---|
169 | DL {margin-bottom: 0} |
---|
170 | DIV.variablelist DT {margin-top: 1em } |
---|
171 | DIV.variablelist DD P {margin-top: 0.5em} |
---|
172 | DIV.variablelist DD UL {margin-top: 0.5em} |
---|
173 | DIV.variablelist DD LI P {margin-top: 0} |
---|
174 | HR.bottom {margin-top: 2ex; margin-bottom: 0} |
---|
175 | TD {vertical-align: top} |
---|
176 | TH {vertical-align: top} |
---|
177 | DIV.table P {margin-top: 0} |
---|
178 | TABLE P {margin-bottom: 0; margin-top: 0} |
---|
179 | TABLE UL {margin-top: 0.66em;} |
---|
180 | DIV.toc {margin-bottom: 3ex} |
---|
181 | DIV TD {padding-right: 1em; padding-left: 1em; padding-top: 0.5ex; padding-bottom: 0.5ex} |
---|
182 | DIV TH {padding-right: 1em; padding-left: 1em; padding-top: 0.5ex; padding-bottom: 0.5ex} |
---|
183 | DIV.note TD {padding-left: 0; padding-top: 0} |
---|
184 | DIV.note TH {padding-left: 0; padding-top: 0} |
---|
185 | DIV.informaltable TABLE {border-bottom: solid 3px black} |
---|
186 | DIV.informaltable TR:FIRST-CHILD {border-top: solid 3px black} |
---|
187 | DIV.table TR:FIRST-CHILD {border-top: solid 3px black} |
---|
188 | DIV.table TABLE {border-bottom: solid 3px black} |
---|
189 | DIV.revhistory TABLE {border-spacing: 0} |
---|
190 | LI DIV.informaltable {margin-top: 1em; margin-bottom: 1em} |
---|
191 | LI DIV.figure P {margin-top: 1em; margin-bottom: 1em} |
---|
192 | H1 {font-size: 1.4em} |
---|
193 | H2 {font-size: 1.3em; margin-bottom: 0} |
---|
194 | H3 {font-size: 1.2em; margin-bottom: 0} |
---|
195 | H4 {font-size: 1.1em} |
---|
196 | </xsl:text> |
---|
197 | </style> |
---|
198 | </xsl:template> |
---|
199 | |
---|
200 | <!-- change some formating choices --> |
---|
201 | |
---|
202 | <xsl:template match="guibutton"> |
---|
203 | <xsl:call-template name="inline.boldseq"/> |
---|
204 | </xsl:template> |
---|
205 | |
---|
206 | <xsl:template match="command"> |
---|
207 | <xsl:call-template name="inline.monoseq"/> |
---|
208 | </xsl:template> |
---|
209 | |
---|
210 | |
---|
211 | <xsl:template match="inlinemediaobject"> |
---|
212 | <span class="{name(.)}"> |
---|
213 | <xsl:if test="@id"> |
---|
214 | <a name="{@id}"/> |
---|
215 | </xsl:if> |
---|
216 | <xsl:call-template name="select.mediaobject"/> |
---|
217 | </span> |
---|
218 | <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text> |
---|
219 | </xsl:template> |
---|
220 | |
---|
221 | |
---|
222 | |
---|
223 | <!-- the chunking machinery --> |
---|
224 | |
---|
225 | <xsl:template name="next.link.cell"> |
---|
226 | <xsl:param name="object" select="."/> |
---|
227 | <td align="right" width="33%"><a accesskey="n"> |
---|
228 | <xsl:attribute name="href"> |
---|
229 | <xsl:call-template name="href.target"> |
---|
230 | <xsl:with-param name="object" select="$object"/> |
---|
231 | </xsl:call-template> |
---|
232 | </xsl:attribute> |
---|
233 | <xsl:call-template name="gentext"> |
---|
234 | <xsl:with-param name="key" select="'Next'"/> |
---|
235 | </xsl:call-template> |
---|
236 | <xsl:text> >>></xsl:text> |
---|
237 | </a></td> |
---|
238 | </xsl:template> |
---|
239 | |
---|
240 | <xsl:template name="prev.link.cell"> |
---|
241 | <xsl:param name="object" select="."/> |
---|
242 | <td align="left" width="33%"><a accesskey="p"> |
---|
243 | <xsl:attribute name="href"> |
---|
244 | <xsl:call-template name="href.target"> |
---|
245 | <xsl:with-param name="object" select="$object"/> |
---|
246 | </xsl:call-template> |
---|
247 | </xsl:attribute> |
---|
248 | <xsl:text><<< </xsl:text> |
---|
249 | <xsl:call-template name="gentext"> |
---|
250 | <xsl:with-param name="key" select="'Previous'"/> |
---|
251 | </xsl:call-template> |
---|
252 | |
---|
253 | </a></td> |
---|
254 | </xsl:template> |
---|
255 | |
---|
256 | <xsl:template name="article.toc.ref"> |
---|
257 | <xsl:text>ghelp:</xsl:text> |
---|
258 | <xsl:value-of select="$gdb_docname"/> |
---|
259 | </xsl:template> |
---|
260 | |
---|
261 | <xsl:template name="indirect.prev.cell"> |
---|
262 | <xsl:param name="object" select="."/> |
---|
263 | <xsl:choose> |
---|
264 | <xsl:when test="count($object/sect2) > 0"> |
---|
265 | <xsl:call-template name="prev.link.cell"> |
---|
266 | <xsl:with-param name="object" select="$object/sect2[last()]"/> |
---|
267 | </xsl:call-template> |
---|
268 | </xsl:when> |
---|
269 | <xsl:otherwise> |
---|
270 | <xsl:call-template name="prev.link.cell"> |
---|
271 | <xsl:with-param name="object" select="$object"/> |
---|
272 | </xsl:call-template> |
---|
273 | </xsl:otherwise> |
---|
274 | </xsl:choose> |
---|
275 | </xsl:template> |
---|
276 | |
---|
277 | <xsl:template name="indirect.next.cell"> |
---|
278 | <xsl:param name="object" select="."/> |
---|
279 | <xsl:choose> |
---|
280 | <xsl:when test="count($object/sect2) > 0"> |
---|
281 | <xsl:call-template name="next.link.cell"> |
---|
282 | <xsl:with-param name="object" select="$object/sect2[1]"/> |
---|
283 | </xsl:call-template> |
---|
284 | </xsl:when> |
---|
285 | <xsl:otherwise> |
---|
286 | <xsl:call-template name="next.link.cell"> |
---|
287 | <xsl:with-param name="object" select="$object"/> |
---|
288 | </xsl:call-template> |
---|
289 | </xsl:otherwise> |
---|
290 | </xsl:choose> |
---|
291 | </xsl:template> |
---|
292 | |
---|
293 | <!-- |
---|
294 | article.chunk.prev and article.chunk.next need to be augumented |
---|
295 | to take parents siblings children into account |
---|
296 | --> |
---|
297 | |
---|
298 | <xsl:template name="article.chunk.prev"> |
---|
299 | <xsl:param name="node" select="."/> |
---|
300 | <xsl:choose> |
---|
301 | |
---|
302 | <xsl:when test="count($node/preceding-sibling::*) > 1"> |
---|
303 | <xsl:call-template name="prev.link.cell"> |
---|
304 | <xsl:with-param name="object" select="$node/preceding-sibling::*[1]"/> |
---|
305 | </xsl:call-template> |
---|
306 | </xsl:when> |
---|
307 | |
---|
308 | <xsl:when test="local-name($node)='sect2' and count($node/../preceding-sibling::sect1[position()=last()]/sect2) > 0"> |
---|
309 | <xsl:call-template name="indirect.prev.cell"> |
---|
310 | <xsl:with-param name="object" select="$node/../preceding-sibling::sect1[position()=last()]"/> |
---|
311 | </xsl:call-template> |
---|
312 | </xsl:when> |
---|
313 | |
---|
314 | <!-- we need to treat the first sect1 specially --> |
---|
315 | <xsl:when test="$node=/article/sect1[1] or $node=/part/chapter/sect1[1]"> |
---|
316 | <td><a accesskey="p"> |
---|
317 | <xsl:attribute name="href"> |
---|
318 | <xsl:call-template name="article.toc.ref"/> |
---|
319 | </xsl:attribute> |
---|
320 | <xsl:text><<< </xsl:text> |
---|
321 | <xsl:call-template name="gentext"> |
---|
322 | <xsl:with-param name="key" select="'Previous'"/> |
---|
323 | </xsl:call-template> |
---|
324 | </a></td> |
---|
325 | </xsl:when> |
---|
326 | |
---|
327 | <!-- And the first sect2 of the first sect1 needs the same --> |
---|
328 | <xsl:when test="$node=/article/sect1[1]/sect2[1] or $node=/part/chapter/sect1[1]/sect2[1]"> |
---|
329 | <td><a accesskey="p"> |
---|
330 | <xsl:attribute name="href"> |
---|
331 | <xsl:call-template name="article.toc.ref"/> |
---|
332 | </xsl:attribute> |
---|
333 | <xsl:text><<< </xsl:text> |
---|
334 | <xsl:call-template name="gentext"> |
---|
335 | <xsl:with-param name="key" select="'Previous'"/> |
---|
336 | </xsl:call-template> |
---|
337 | </a></td> |
---|
338 | </xsl:when> |
---|
339 | |
---|
340 | </xsl:choose> |
---|
341 | </xsl:template> |
---|
342 | |
---|
343 | <xsl:template name="article.chunk.up"> |
---|
344 | <xsl:param name="node" select="."/> |
---|
345 | <xsl:param name="doit" select="1"/> |
---|
346 | <xsl:choose> |
---|
347 | <xsl:when test="$doit=1"> |
---|
348 | <td align="center" width="33%"> |
---|
349 | <a accesskey="u"> |
---|
350 | <xsl:attribute name="href"> |
---|
351 | <xsl:call-template name="article.toc.ref"/> |
---|
352 | </xsl:attribute> |
---|
353 | <xsl:call-template name="gentext"> |
---|
354 | <xsl:with-param name="key" select="'Contents'"/> |
---|
355 | </xsl:call-template> |
---|
356 | </a> |
---|
357 | </td> |
---|
358 | </xsl:when> |
---|
359 | </xsl:choose> |
---|
360 | </xsl:template> |
---|
361 | |
---|
362 | <xsl:template name="article.chunk.next"> |
---|
363 | <xsl:param name="node" select="."/> |
---|
364 | <xsl:choose> |
---|
365 | <xsl:when test="count($node/following-sibling::*) > 0"> |
---|
366 | <xsl:call-template name="next.link.cell"> |
---|
367 | <xsl:with-param name="object" select="$node/following-sibling::*[1]"/> |
---|
368 | </xsl:call-template> |
---|
369 | </xsl:when> |
---|
370 | <xsl:when test="local-name($node)='sect2' and count($node/../following-sibling::sect1[1]/sect2) > 0"> |
---|
371 | <xsl:call-template name="indirect.next.cell"> |
---|
372 | <xsl:with-param name="object" select="$node/../following-sibling::sect1[1]"/> |
---|
373 | </xsl:call-template> |
---|
374 | </xsl:when> |
---|
375 | <xsl:otherwise> |
---|
376 | <td align="right" width="33%"> |
---|
377 | </td> |
---|
378 | </xsl:otherwise> |
---|
379 | </xsl:choose> |
---|
380 | </xsl:template> |
---|
381 | |
---|
382 | <xsl:template name="article.chunk.navigate"> |
---|
383 | <xsl:param name="node" select="."/> |
---|
384 | <xsl:param name="link-toc" select="1"/> |
---|
385 | <tr> |
---|
386 | <xsl:call-template name="article.chunk.prev"> |
---|
387 | <xsl:with-param name="node" select="$node"/> |
---|
388 | </xsl:call-template> |
---|
389 | <xsl:call-template name="article.chunk.up"> |
---|
390 | <xsl:with-param name="node" select="$node"/> |
---|
391 | <xsl:with-param name="doit" select="$link-toc"/> |
---|
392 | </xsl:call-template> |
---|
393 | <xsl:call-template name="article.chunk.next"> |
---|
394 | <xsl:with-param name="node" select="$node"/> |
---|
395 | </xsl:call-template> |
---|
396 | </tr> |
---|
397 | </xsl:template> |
---|
398 | |
---|
399 | <xsl:template name="titlepage.ref"> |
---|
400 | <xsl:text>ghelp:</xsl:text> |
---|
401 | <xsl:value-of select="$gdb_docname"/> |
---|
402 | <xsl:text>?title-page</xsl:text> |
---|
403 | </xsl:template> |
---|
404 | |
---|
405 | <xsl:template name="article.render.chunk"> |
---|
406 | <xsl:param name="node" select="."/> |
---|
407 | <xsl:param name="title" select="/article/articleinfo/title"/> |
---|
408 | <p class="header-title"><xsl:value-of select="$title"/></p> |
---|
409 | <table width="100%" align="justify"> |
---|
410 | <xsl:call-template name="article.chunk.navigate"> |
---|
411 | <xsl:with-param name="node" select="$node"/> |
---|
412 | <xsl:with-param name="link-toc" select="0"/> |
---|
413 | </xsl:call-template> |
---|
414 | </table> |
---|
415 | <xsl:element name="hr" /> |
---|
416 | <xsl:apply-templates select="$node"/> |
---|
417 | <xsl:element name="hr"> |
---|
418 | <xsl:attribute name="class"><xsl:text>bottom</xsl:text></xsl:attribute> |
---|
419 | </xsl:element> |
---|
420 | <table width="100%" align="justify"> |
---|
421 | <xsl:call-template name="article.chunk.navigate"> |
---|
422 | <xsl:with-param name="node" select="$node"/> |
---|
423 | <xsl:with-param name="link-toc" select="1"/> |
---|
424 | </xsl:call-template> |
---|
425 | </table> |
---|
426 | </xsl:template> |
---|
427 | |
---|
428 | <xsl:template name="make.toc.navbar"> |
---|
429 | <table width="100%"> |
---|
430 | <tr> |
---|
431 | <td width="33%"><a accesskey="p"> |
---|
432 | <xsl:attribute name="href"> |
---|
433 | <xsl:call-template name="titlepage.ref"/> |
---|
434 | </xsl:attribute> |
---|
435 | <xsl:text><<< </xsl:text> |
---|
436 | <xsl:call-template name="gentext"> |
---|
437 | <xsl:with-param name="key" select="'Previous'"/> |
---|
438 | </xsl:call-template> |
---|
439 | </a></td> |
---|
440 | <td></td> |
---|
441 | <xsl:choose> |
---|
442 | <xsl:when test="local-name(.) = 'part'"> |
---|
443 | <xsl:call-template name="next.link.cell"> |
---|
444 | <xsl:with-param name="object" select="chapter[1]/sect1[1]"/> |
---|
445 | </xsl:call-template> |
---|
446 | </xsl:when> |
---|
447 | <xsl:otherwise> |
---|
448 | <xsl:call-template name="next.link.cell"> |
---|
449 | <xsl:with-param name="object" select="sect1[1]"/> |
---|
450 | </xsl:call-template> |
---|
451 | </xsl:otherwise> |
---|
452 | </xsl:choose> |
---|
453 | </tr> |
---|
454 | </table> |
---|
455 | </xsl:template> |
---|
456 | |
---|
457 | <xsl:template name="make.titlep.navbar"> |
---|
458 | <table width="100%"> |
---|
459 | <tr> |
---|
460 | <td align="right"><a accesskey="n"> |
---|
461 | <xsl:attribute name="href"> |
---|
462 | <xsl:call-template name="article.toc.ref"/> |
---|
463 | </xsl:attribute> |
---|
464 | <xsl:call-template name="gentext"> |
---|
465 | <xsl:with-param name="key" select="'Next'"/> |
---|
466 | </xsl:call-template> |
---|
467 | <xsl:text> >>></xsl:text> |
---|
468 | </a></td> |
---|
469 | </tr> |
---|
470 | </table> |
---|
471 | </xsl:template> |
---|
472 | |
---|
473 | |
---|
474 | <xsl:template name="article.render.titlepage"> |
---|
475 | <xsl:param name="container" select="."/> |
---|
476 | <xsl:call-template name="make.titlep.navbar"/> |
---|
477 | <xsl:apply-templates select="$container/*" mode="titlepage.mode"/> |
---|
478 | <xsl:call-template name="make.titlep.navbar"/> |
---|
479 | </xsl:template> |
---|
480 | |
---|
481 | <xsl:template name="yelp.render.toc"> |
---|
482 | <xsl:param name="title" select="''" /> |
---|
483 | <xsl:call-template name="make.toc.navbar"/> |
---|
484 | <xsl:element name="hr"/> |
---|
485 | <H1 class="title"><xsl:value-of select="$title"/></H1> |
---|
486 | <p class="about"><a> |
---|
487 | <xsl:attribute name="href"> |
---|
488 | <xsl:call-template name="titlepage.ref"/> |
---|
489 | </xsl:attribute> |
---|
490 | <xsl:call-template name="gentext.template"> |
---|
491 | <xsl:with-param name="context" select="'title'"/> |
---|
492 | <xsl:with-param name="name" select="'bookinfo'"/> |
---|
493 | </xsl:call-template> |
---|
494 | </a></p> |
---|
495 | <xsl:choose> |
---|
496 | <xsl:when test="local-name(.)='part'"> |
---|
497 | <xsl:for-each select="chapter"> |
---|
498 | <xsl:call-template name="component.toc"/> |
---|
499 | </xsl:for-each> |
---|
500 | </xsl:when> |
---|
501 | <xsl:when test="local-name(.)='book'"> |
---|
502 | <xsl:call-template name="division.toc"/> |
---|
503 | </xsl:when> |
---|
504 | <xsl:otherwise> |
---|
505 | <xsl:call-template name="component.toc"/> |
---|
506 | </xsl:otherwise> |
---|
507 | </xsl:choose> |
---|
508 | <xsl:element name="hr"/> |
---|
509 | <xsl:call-template name="make.toc.navbar"/> |
---|
510 | </xsl:template> |
---|
511 | |
---|
512 | <xsl:template name="yelp.book.multichunk"> |
---|
513 | <xsl:param name="root" select="."/> |
---|
514 | |
---|
515 | <xsl:for-each select="$root/part"> |
---|
516 | <xsl:comment> Start of chunk: [<xsl:value-of select="@id"/>] </xsl:comment> |
---|
517 | <xsl:call-template name="division.toc"/> |
---|
518 | <xsl:comment> End of chunk </xsl:comment> |
---|
519 | </xsl:for-each> |
---|
520 | |
---|
521 | <xsl:for-each select="$root/part/chapter"> |
---|
522 | <xsl:comment> Start of chunk: [<xsl:value-of select="@id"/>] </xsl:comment> |
---|
523 | <xsl:call-template name="component.toc"/> |
---|
524 | <xsl:comment> End of chunk </xsl:comment> |
---|
525 | </xsl:for-each> |
---|
526 | |
---|
527 | <xsl:for-each select="$root/part/appendix"> |
---|
528 | <xsl:comment> Start of chunk: [<xsl:value-of select="@id"/>] </xsl:comment> |
---|
529 | <xsl:call-template name="component.toc"/> |
---|
530 | <xsl:comment> End of chunk </xsl:comment> |
---|
531 | </xsl:for-each> |
---|
532 | |
---|
533 | <xsl:for-each select="$root/chapter"> |
---|
534 | <xsl:comment> Start of chunk: [<xsl:value-of select="@id"/>] </xsl:comment> |
---|
535 | <xsl:call-template name="component.toc"/> |
---|
536 | <xsl:comment> End of chunk </xsl:comment> |
---|
537 | </xsl:for-each> |
---|
538 | |
---|
539 | <xsl:for-each select="$root/appendix"> |
---|
540 | <xsl:comment> Start of chunk: [<xsl:value-of select="@id"/>] </xsl:comment> |
---|
541 | <xsl:call-template name="component.toc"/> |
---|
542 | <xsl:comment> End of chunk </xsl:comment> |
---|
543 | </xsl:for-each> |
---|
544 | </xsl:template> |
---|
545 | |
---|
546 | <xsl:template name="yelp.multichunk"> |
---|
547 | <xsl:param name="type"/> |
---|
548 | <xsl:param name="container"/> |
---|
549 | <xsl:param name="root" select="."/> |
---|
550 | |
---|
551 | <xsl:comment> End of header </xsl:comment> |
---|
552 | <xsl:comment> Start of chunk: [title-page] </xsl:comment> |
---|
553 | |
---|
554 | <xsl:choose> |
---|
555 | <xsl:when test="$type = 'book'"> |
---|
556 | <xsl:call-template name="book.titlepage"/> |
---|
557 | </xsl:when> |
---|
558 | <xsl:otherwise> |
---|
559 | <xsl:call-template name="article.render.titlepage"> |
---|
560 | <xsl:with-param name="container" select="$container"/> |
---|
561 | </xsl:call-template> |
---|
562 | </xsl:otherwise> |
---|
563 | </xsl:choose> |
---|
564 | |
---|
565 | <xsl:comment> End of chunk </xsl:comment> |
---|
566 | <xsl:comment> Start of chunk: [toc] </xsl:comment> |
---|
567 | |
---|
568 | <xsl:call-template name="yelp.render.toc"> |
---|
569 | <xsl:with-param name="title" select="$container/title"/> |
---|
570 | </xsl:call-template> |
---|
571 | |
---|
572 | <xsl:comment> End of chunk </xsl:comment> |
---|
573 | |
---|
574 | <xsl:if test="$type = 'book'"> |
---|
575 | <xsl:call-template name="yelp.book.multichunk"/> |
---|
576 | </xsl:if> |
---|
577 | |
---|
578 | <xsl:for-each select="//sect1"> |
---|
579 | <xsl:comment> Start of chunk: [<xsl:value-of select="@id"/>] </xsl:comment> |
---|
580 | <xsl:call-template name="article.render.chunk"> |
---|
581 | <xsl:with-param name="title" select="$container/title"/> |
---|
582 | </xsl:call-template> |
---|
583 | <xsl:comment> End of chunk </xsl:comment> |
---|
584 | </xsl:for-each> |
---|
585 | |
---|
586 | <xsl:for-each select="//sect2"> |
---|
587 | <xsl:comment> Start of chunk: [<xsl:value-of select="@id"/>] </xsl:comment> |
---|
588 | <xsl:call-template name="article.render.chunk"> |
---|
589 | <xsl:with-param name="title" select="$container/title"/> |
---|
590 | </xsl:call-template> |
---|
591 | <xsl:comment> End of chunk </xsl:comment> |
---|
592 | </xsl:for-each> |
---|
593 | |
---|
594 | <xsl:for-each select="//sect3"> |
---|
595 | <xsl:comment> Start of chunk: [<xsl:value-of select="@id"/>] </xsl:comment> |
---|
596 | <xsl:call-template name="article.render.chunk"> |
---|
597 | <xsl:with-param name="title" select="$container/title"/> |
---|
598 | </xsl:call-template> |
---|
599 | <xsl:comment> End of chunk </xsl:comment> |
---|
600 | </xsl:for-each> |
---|
601 | |
---|
602 | <xsl:comment> Start of footer </xsl:comment> |
---|
603 | </xsl:template> |
---|
604 | |
---|
605 | <xsl:template match="/article"> |
---|
606 | <xsl:call-template name="yelp.generic.root"> |
---|
607 | <xsl:with-param name="container" select="/article/articleinfo"/> |
---|
608 | <xsl:with-param name="type" select="'article'"/> |
---|
609 | </xsl:call-template> |
---|
610 | </xsl:template> |
---|
611 | |
---|
612 | <xsl:template match="/part"> |
---|
613 | <xsl:call-template name="yelp.generic.root"> |
---|
614 | <xsl:with-param name="container" select="/part/partinfo"/> |
---|
615 | <xsl:with-param name="type" select="'part'"/> |
---|
616 | <xsl:with-param name="root" select="chapter"/> |
---|
617 | </xsl:call-template> |
---|
618 | </xsl:template> |
---|
619 | |
---|
620 | <xsl:template match="/book"> |
---|
621 | <xsl:call-template name="yelp.generic.root"> |
---|
622 | <xsl:with-param name="container" select="."/> |
---|
623 | <xsl:with-param name="type" select="'book'"/> |
---|
624 | </xsl:call-template> |
---|
625 | </xsl:template> |
---|
626 | |
---|
627 | <xsl:template name="yelp.generic.root"> |
---|
628 | <xsl:param name="type"/> |
---|
629 | <xsl:param name="container"/> |
---|
630 | <xsl:param name="root" select="."/> |
---|
631 | <xsl:choose> |
---|
632 | <xsl:when test="$gdb_multichunk=1"> |
---|
633 | <xsl:call-template name="yelp.multichunk"> |
---|
634 | <xsl:with-param name="type" select="$type"/> |
---|
635 | <xsl:with-param name="container" select="$container"/> |
---|
636 | <xsl:with-param name="root" select="$root"/> |
---|
637 | </xsl:call-template> |
---|
638 | </xsl:when> |
---|
639 | <xsl:when test="$gdb_rootid = ''"> |
---|
640 | <xsl:call-template name="yelp.render.toc"> |
---|
641 | <xsl:with-param name="title"> |
---|
642 | <xsl:value-of select="$container/title"/> |
---|
643 | </xsl:with-param> |
---|
644 | </xsl:call-template> |
---|
645 | </xsl:when> |
---|
646 | <xsl:otherwise> |
---|
647 | <xsl:call-template name="yelp.render.chunk"> |
---|
648 | <xsl:with-param name="container" select="$container"/> |
---|
649 | </xsl:call-template> |
---|
650 | </xsl:otherwise> |
---|
651 | </xsl:choose> |
---|
652 | </xsl:template> |
---|
653 | |
---|
654 | <xsl:template name="yelp.render.chunk"> |
---|
655 | <xsl:param name="container" select="."/> |
---|
656 | <xsl:choose> |
---|
657 | <xsl:when test="$gdb_rootid='title-page'"> |
---|
658 | <xsl:call-template name="article.render.titlepage"> |
---|
659 | <xsl:with-param name="container" select="$container"/> |
---|
660 | </xsl:call-template> |
---|
661 | </xsl:when> |
---|
662 | <xsl:otherwise> |
---|
663 | <xsl:call-template name="article.render.chunk"> |
---|
664 | <xsl:with-param name="node" select="descendant::*[attribute::id=$gdb_rootid]" /> |
---|
665 | </xsl:call-template> |
---|
666 | </xsl:otherwise> |
---|
667 | </xsl:choose> |
---|
668 | </xsl:template> |
---|
669 | |
---|
670 | </xsl:stylesheet> |
---|