[r23462]: build-support / trunk / users-guide.xsl Maximize Restore History

Download this file

users-guide.xsl    476 lines (416 with data), 15.9 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
<?xml version='1.0'?>
<!-- :folding=explicit: -->
<!-- You should use this XSL stylesheet to create plugin documentation.
If you want all output in a single HTML file, specify the path to
your DocBook-XSL "html/docbook.xsl" file in the <xsl:import>
statement below. If you want each chapter to have its own file,
specify the path to your "html/chunk.xsl".
This stylesheet assumes the user's guide XML source is in a
subdirectory of the plugin's main dir (e.g., "docs/users-guide.xml").
-->
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns="http://www.w3.org/TR/xhtml1/transitional"
xmlns:date="http://exslt.org/dates-and-times"
xmlns:common="http://exslt.org/common"
extension-element-prefixes="date common"
exclude-result-prefixes="#default">
<xsl:import href="file:///@docs.style.sheet@" />
<!-- chunk by chapters instead of sections by setting chunk.section.depth to 0
instead of the default 1 -->
<xsl:param name="chunk.section.depth" select="1"/>
<!-- Swing HTML control doesn't support &ldquo; and &rdquo; -->
<xsl:template match="quote">&quot;<xsl:apply-templates/>&quot;</xsl:template>
<xsl:template match="guibutton">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
<xsl:template match="guiicon">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
<xsl:template match="guilabel">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
<xsl:template match="guimenu">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
<xsl:template match="guimenuitem">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
<xsl:template match="guisubmenu">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
<xsl:template match="image">
<p>
<center>
<img src="{src}" />
</center>
</p>
</xsl:template>
<xsl:template match="br">
<br />
</xsl:template>
<xsl:param name="toc.list.type">ul</xsl:param>
<xsl:param name="use.id.as.filename">1</xsl:param>
<xsl:param name="shade.verbatim">1</xsl:param>
<xsl:param name="funcsynopsis.style">ansi</xsl:param>
<xsl:template match="void">
<xsl:apply-templates/>
</xsl:template>
<xsl:param name="chunk.first.sections">1</xsl:param>
<xsl:template match="*" mode="object.title.markup.textonly">
<xsl:variable name="title">
<xsl:apply-templates select="." mode="title.markup"/>
</xsl:variable>
<!-- used to get the html title of the page -->
<xsl:value-of select="$title"/>
</xsl:template>
<!-- {{{ TOC generation -->
<xsl:template match="/">
<xsl:call-template name="toc"/>
</xsl:template>
<xsl:template name="toc">
<xsl:apply-templates/>
<xsl:call-template name="write.chunk">
<xsl:with-param name="filename" select="'toc.xml'"/>
<xsl:with-param name="method" select="'xml'"/>
<xsl:with-param name="indent" select="'yes'"/>
<xsl:with-param name="content">
<xsl:call-template name="toc.content"/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="toc.content">
<TOC>
<xsl:apply-templates select="." mode="my.toc"/>
</TOC>
</xsl:template>
<xsl:template match="set" mode="my.toc">
<ENTRY>
<xsl:attribute name="HREF">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="."/>
</xsl:call-template>
</xsl:attribute>
<TITLE>
<xsl:apply-templates mode="title.markup" select="."/>
</TITLE>
<xsl:apply-templates select="book" mode="my.toc"/>
</ENTRY>
</xsl:template>
<xsl:template match="book" mode="my.toc">
<ENTRY>
<xsl:attribute name="HREF">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="."/>
</xsl:call-template>
</xsl:attribute>
<TITLE>
<xsl:apply-templates mode="title.markup" select="."/>
</TITLE>
<xsl:apply-templates select="part|reference|preface|chapter|appendix|article|colophon" mode="my.toc"/>
</ENTRY>
</xsl:template>
<xsl:template match="part|reference|preface|chapter|appendix|article" mode="my.toc">
<ENTRY>
<xsl:attribute name="HREF">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="."/>
</xsl:call-template>
</xsl:attribute>
<TITLE>
<xsl:apply-templates mode="title.markup" select="."/>
</TITLE>
<xsl:apply-templates select="preface|chapter|appendix|refentry|section|sect1" mode="my.toc"/>
</ENTRY>
</xsl:template>
<xsl:template match="section" mode="my.toc">
<ENTRY>
<xsl:attribute name="HREF">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="."/>
</xsl:call-template>
</xsl:attribute>
<TITLE>
<xsl:apply-templates mode="title.markup" select="."/>
</TITLE>
<xsl:apply-templates select="section" mode="my.toc"/>
</ENTRY>
</xsl:template>
<xsl:template match="sect1" mode="my.toc">
<ENTRY>
<xsl:attribute name="HREF">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="."/>
</xsl:call-template>
</xsl:attribute>
<TITLE>
<xsl:apply-templates mode="title.markup" select="."/>
</TITLE>
<xsl:apply-templates select="sect2" mode="my.toc"/>
</ENTRY>
</xsl:template>
<xsl:template match="sect2" mode="my.toc">
<ENTRY>
<xsl:attribute name="HREF">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="."/>
</xsl:call-template>
</xsl:attribute>
<TITLE>
<xsl:apply-templates mode="title.markup" select="."/>
</TITLE>
<xsl:apply-templates select="sect3" mode="my.toc"/>
</ENTRY>
</xsl:template>
<xsl:template match="sect3" mode="my.toc">
<ENTRY>
<xsl:attribute name="HREF">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="."/>
</xsl:call-template>
</xsl:attribute>
<TITLE>
<xsl:apply-templates mode="title.markup" select="."/>
</TITLE>
<xsl:apply-templates select="sect4" mode="my.toc"/>
</ENTRY>
</xsl:template>
<xsl:template match="sect4" mode="my.toc">
<ENTRY>
<xsl:attribute name="HREF">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="."/>
</xsl:call-template>
</xsl:attribute>
<TITLE>
<xsl:apply-templates mode="title.markup" select="."/>
</TITLE>
<xsl:apply-templates select="sect5" mode="my.toc"/>
</ENTRY>
</xsl:template>
<xsl:template match="sect5|colophon" mode="my.toc">
<ENTRY>
<xsl:attribute name="HREF">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="."/>
</xsl:call-template>
</xsl:attribute>
<TITLE>
<xsl:apply-templates mode="title.markup" select="."/>
</TITLE>
</ENTRY>
</xsl:template>
<!-- }}} -->
<!-- {{{ Dale's gorgeous HTMl template -->
<!-- title banner, from docbook/html/titlepage.templates.xsl -->
<xsl:template name="article.titlepage.recto">
<xsl:call-template name="article-or-book.titlepage.recto"/>
</xsl:template>
<xsl:template name="book.titlepage.recto">
<xsl:call-template name="article-or-book.titlepage.recto"/>
</xsl:template>
<xsl:template name="article-or-book.titlepage.recto">
<table summary="Header" cellspacing="0" border="0" width="100%" cols="2">
<tr width="100%" bgcolor="#CCCCFF">
<!-- left cell : title, copyright -->
<td valign="TOP">
<xsl:choose>
<xsl:when test="bookinfo/title">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="bookinfo/title"/>
</xsl:when>
<xsl:when test="articleinfo/title">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/title"/>
</xsl:when>
<xsl:when test="artheader/title">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
<!-- maybe the copyright notice should go on another line... -->
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/copyright"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="bookinfo/copyright"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/copyright"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/copyright"/>
</td>
<!-- right cell : version, generation date and authors -->
<td valign="TOP" align="RIGHT">
<font size="-1">
<p>
<strong>
<!-- release -->
<xsl:choose>
<xsl:when test="articleinfo/releaseinfo | bookinfo/releaseinfo
| artheader/releaseinfo | info/releaseinfo">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/releaseinfo"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="bookinfo/releaseinfo"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/releaseinfo"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/releaseinfo"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>Version @plugin.version@</xsl:text>
</xsl:otherwise>
</xsl:choose>
<!-- compute release date automatically -->
<xsl:text> (</xsl:text>
<xsl:value-of select="concat(date:month-name(),' ',date:day-in-month(), ' ', date:year())"/>
<xsl:text>)</xsl:text>
</strong>
</p>
<!-- hackish list of authors -->
<xsl:for-each select="//author">
<!-- output repeated authors only once
see CommonControls where there is 1 author per section
-->
<xsl:if test="not(preceding::author[
firstname = current()/firstname and
surname = current()/surname])">
<p>
<xsl:apply-templates select="."/>
</p>
</xsl:if>
</xsl:for-each>
</font>
</td>
</tr>
</table>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/legalnotice | bookinfo/legalnotice"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/legalnotice"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/legalnotice"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/revhistory"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/revhistory"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/revhistory"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/abstract"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/abstract"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/abstract"/>
</xsl:template>
<xsl:template match="title" mode="article.titlepage.recto.auto.mode">
<strong>
<font size="+2">
<xsl:value-of select="."/>
</font>
</strong>
</xsl:template>
<xsl:template match="releaseinfo" mode="article.titlepage.recto.auto.mode">
<xsl:apply-templates/>
</xsl:template>
<!-- whole line white on blue banner for the legal notice
overrides docbook-xsl/html/titlepage.xsl
disabled because I prefer a standard legal notice title
-->
<!--<xsl:template match="legalnotice/title" mode="titlepage.mode">
<xsl:call-template name="section.heading">
<xsl:with-param name="section" select="parent::*"/>
<xsl:with-param name="allow-anchors" select="0"/>
<xsl:with-param name="title" select="string(.)"/>
</xsl:call-template>
</xsl:template>-->
<!-- whole line white on blue banner for each (sub)section
overrides docbook-xsl/html/sections.xsl
-->
<xsl:template name="section.heading">
<xsl:param name="section" select="."/>
<xsl:param name="level" select="1"/>
<xsl:param name="allow-anchors" select="1"/>
<xsl:param name="title"/>
<xsl:param name="class" select="'title'"/>
<xsl:variable name="id">
<xsl:choose>
<!-- Make sure the subtitle doesn't get the same id as the title -->
<xsl:when test="self::subtitle">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="."/>
</xsl:call-template>
</xsl:when>
<!-- if title is in an *info wrapper, get the grandparent -->
<xsl:when test="contains(local-name(..), 'info')">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="../.."/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="object.id">
<xsl:with-param name="object" select=".."/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<table summary="{.}" border="0" cellspacing="0" cellpadding="0" width="100%">
<tr align="CENTER" width="100%">
<td bgcolor="#7FB2FF" width="100%">
<strong>
<font color="#FFFFFF" size="+1">
<span>
<xsl:if test="$allow-anchors != 0 and $generate.id.attributes = 0">
<xsl:call-template name="anchor">
<xsl:with-param name="node" select="$section"/>
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="$generate.id.attributes != 0 and not(local-name(.) = 'appendix')">
<xsl:attribute name="id">
<xsl:value-of select="$id"/>
</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$title"/>
</span>
</font>
</strong>
</td>
</tr>
</table>
</xsl:template>
<!-- for chapter titles,
overrides docbook-xsl/html/component.xsl
-->
<xsl:template name="component.title">
<xsl:param name="node" select="."/>
<xsl:call-template name="section.heading">
<xsl:with-param name="title">
<xsl:apply-templates select="$node" mode="object.title.markup">
<xsl:with-param name="allow-anchors" select="1"/>
</xsl:apply-templates>
</xsl:with-param>
<xsl:with-param name="section" select="$node"/>
</xsl:call-template>
</xsl:template>
<!-- }}} -->
<!-- {{{ hijack processing of the article or book, to inject a feedback appendix
if the document doesn't have one already.
Testing for the absence of appendix also serves to stop the recursion,
otherwise the template would match the generated variable contents.
-->
<xsl:template match="/*[not(appendix[@id = 'feedback'] | chapter[@id = 'feedback'])]"
>
<xsl:variable name="whole">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:copy-of select="*"/>
<!-- rebinding default ns here so that appendix is really {no-namespace}:appendix,
not {http://www.w3.org/TR/xhtml1/transitional}:appendix
-->
<appendix id="feedback" xmlns="">
<title>Feedback</title>
<para>All jEdit users are encouraged to join the
<email>jedit-users@lists.sourceforge.net</email> mailing list to give
feedback or ask questions to other users and developers. </para>
<para>The preferred way to send bug reports against most jEdit plugins
is to use the <ulink url="https://sourceforge.net/p/jedit/plugin-bugs/?limit=100">
jEdit Plugin Bugs Tracker</ulink>. </para>
<para>Feature requests can be found on the <ulink
url="https://sourceforge.net/p/jedit/plugin-feature-requests/?limit=100">
jEdit Plugin feature requests tracker</ulink>. </para>
<para>Development questions should be posted to the jEdit development
mailing-list <email>jedit-devel@lists.sourceforge.net</email>. </para>
</appendix>
</xsl:copy>
</xsl:variable>
<xsl:apply-templates select="common:node-set($whole)"/>
</xsl:template>
<!-- }}} -->
</xsl:stylesheet>