FooBarWidget-mizuho 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- data/asciidoc/BUGS +3 -3
- data/asciidoc/CHANGELOG +112 -63
- data/asciidoc/CHANGELOG.txt +50 -0
- data/asciidoc/INSTALL +6 -6
- data/asciidoc/Makefile.in +21 -5
- data/asciidoc/README +3 -3
- data/asciidoc/asciidoc.conf +9 -12
- data/asciidoc/asciidoc.py +204 -151
- data/asciidoc/common.aap +2 -2
- data/asciidoc/doc/a2x.1 +4 -3
- data/asciidoc/doc/a2x.1.txt +1 -1
- data/asciidoc/doc/article.css-embedded.html +13 -12
- data/asciidoc/doc/article.html +46 -644
- data/asciidoc/doc/article.pdf +0 -0
- data/asciidoc/doc/asciidoc.1 +2 -2
- data/asciidoc/doc/asciidoc.1.css-embedded.html +14 -13
- data/asciidoc/doc/asciidoc.1.css.html +3 -3
- data/asciidoc/doc/asciidoc.1.html +3 -3
- data/asciidoc/doc/asciidoc.css-embedded.html +238 -225
- data/asciidoc/doc/asciidoc.css.html +227 -215
- data/asciidoc/doc/asciidoc.dict +10 -1
- data/asciidoc/doc/asciidoc.html +181 -164
- data/asciidoc/doc/asciidoc.txt +167 -148
- data/asciidoc/doc/asciimathml.txt +5 -4
- data/asciidoc/doc/book.css-embedded.html +13 -12
- data/asciidoc/doc/faq.txt +60 -3
- data/asciidoc/doc/music-filter.html +94 -41
- data/asciidoc/doc/music-filter.pdf +0 -0
- data/asciidoc/doc/source-highlight-filter.html +125 -465
- data/asciidoc/doc/source-highlight-filter.pdf +0 -0
- data/asciidoc/docbook.conf +8 -2
- data/asciidoc/examples/website/CHANGELOG.html +129 -4
- data/asciidoc/examples/website/INSTALL.html +6 -6
- data/asciidoc/examples/website/README-website.html +3 -3
- data/asciidoc/examples/website/README.html +3 -3
- data/asciidoc/examples/website/a2x.1.html +4 -4
- data/asciidoc/examples/website/asciidoc-docbook-xsl.html +3 -3
- data/asciidoc/examples/website/asciidoc-graphviz-sample.txt +1 -0
- data/asciidoc/examples/website/downloads.html +7 -7
- data/asciidoc/examples/website/faq.html +95 -40
- data/asciidoc/examples/website/index.html +34 -13
- data/asciidoc/examples/website/index.txt +25 -9
- data/asciidoc/examples/website/latex-backend.html +4 -4
- data/asciidoc/examples/website/manpage.html +3 -3
- data/asciidoc/examples/website/music-filter.html +3 -3
- data/asciidoc/examples/website/sample1.png +0 -0
- data/asciidoc/examples/website/sample3.png +0 -0
- data/asciidoc/examples/website/sample4.png +0 -0
- data/asciidoc/examples/website/source-highlight-filter.html +5 -5
- data/asciidoc/examples/website/support.html +3 -3
- data/asciidoc/examples/website/userguide.html +227 -215
- data/asciidoc/examples/website/version9.html +3 -3
- data/asciidoc/filters/{code-filter-readme.txt → code/code-filter-readme.txt} +0 -0
- data/asciidoc/filters/{code-filter-test.txt → code/code-filter-test.txt} +0 -0
- data/asciidoc/filters/{code-filter.conf → code/code-filter.conf} +1 -1
- data/asciidoc/filters/{code-filter.py → code/code-filter.py} +0 -0
- data/asciidoc/filters/graphviz/asciidoc-graphviz-sample.txt +130 -0
- data/asciidoc/filters/graphviz/graphviz-filter.conf +39 -0
- data/asciidoc/filters/graphviz/graphviz2png.py +154 -0
- data/asciidoc/filters/{music-filter-test.txt → music/music-filter-test.txt} +0 -0
- data/asciidoc/filters/{music-filter.conf → music/music-filter.conf} +0 -0
- data/asciidoc/filters/{music2png.py → music/music2png.py} +0 -0
- data/asciidoc/filters/{source-highlight-filter-test.txt → source/source-highlight-filter-test.txt} +0 -0
- data/asciidoc/filters/{source-highlight-filter.conf → source/source-highlight-filter.conf} +2 -1
- data/asciidoc/html4.conf +5 -2
- data/asciidoc/stylesheets/xhtml11-quirks.css +0 -8
- data/asciidoc/stylesheets/xhtml11.css +11 -2
- data/asciidoc/vim/syntax/asciidoc.vim +1 -1
- data/asciidoc/xhtml11.conf +5 -2
- data/lib/mizuho/parser.rb +5 -1
- data/mizuho.gemspec +5 -16
- data/test/parser_spec.rb +49 -0
- metadata +22 -10
@@ -2,10 +2,11 @@ ASCIIMathML Formulae
|
|
2
2
|
====================
|
3
3
|
|
4
4
|
http://www1.chapman.edu/~jipsen/mathml/asciimath.html[ASCIIMathML] is
|
5
|
-
a clever JavaScript written by Peter Jipsen that
|
6
|
-
mathematical formulae written in plain text
|
7
|
-
|
8
|
-
|
5
|
+
a clever JavaScript written by Peter Jipsen that dynamically
|
6
|
+
transforms mathematical formulae written in a wiki-like plain text
|
7
|
+
markup to http://www.w3.org/Math/[MathML] markup which is displayed as
|
8
|
+
standard mathematical notation by the Web Browser. See 'Appendix E'
|
9
|
+
in the AsciiDoc User Guide for more details.
|
9
10
|
|
10
11
|
The AsciiDoc `xhtml11` backend supports ASCIIMathML -- it links the
|
11
12
|
ASCIIMathML script and escapes ASCIIMathML delimiters and special
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
4
4
|
<head>
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
6
|
-
<meta name="generator" content="AsciiDoc 8.3.
|
6
|
+
<meta name="generator" content="AsciiDoc 8.3.3" />
|
7
7
|
<title>Book Title Goes Here</title>
|
8
8
|
<style type="text/css">
|
9
9
|
/* Debug borders */
|
@@ -228,12 +228,21 @@ dd > *:first-child {
|
|
228
228
|
ul, ol {
|
229
229
|
list-style-position: outside;
|
230
230
|
}
|
231
|
-
|
231
|
+
ol.arabic {
|
232
232
|
list-style-type: decimal;
|
233
233
|
}
|
234
|
-
|
234
|
+
ol.loweralpha {
|
235
235
|
list-style-type: lower-alpha;
|
236
236
|
}
|
237
|
+
ol.upperalpha {
|
238
|
+
list-style-type: upper-alpha;
|
239
|
+
}
|
240
|
+
ol.lowerroman {
|
241
|
+
list-style-type: lower-roman;
|
242
|
+
}
|
243
|
+
ol.upperroman {
|
244
|
+
list-style-type: upper-roman;
|
245
|
+
}
|
237
246
|
|
238
247
|
div.compact ul, div.compact ol,
|
239
248
|
div.compact p, div.compact p,
|
@@ -366,14 +375,6 @@ div.exampleblock-content {
|
|
366
375
|
|
367
376
|
/* IE6 sets dynamically generated links as visited. */
|
368
377
|
div#toc a:visited { color: blue; }
|
369
|
-
|
370
|
-
/* Because IE6 child selector is broken. */
|
371
|
-
div.olist2 ol {
|
372
|
-
list-style-type: lower-alpha;
|
373
|
-
}
|
374
|
-
div.olist2 div.olist ol {
|
375
|
-
list-style-type: decimal;
|
376
|
-
}
|
377
378
|
</style>
|
378
379
|
<script type="text/javascript">
|
379
380
|
/*<![CDATA[*/
|
@@ -599,7 +600,7 @@ A second glossary term
|
|
599
600
|
<div id="footer">
|
600
601
|
<div id="footer-text">
|
601
602
|
Version 1.0<br />
|
602
|
-
Last updated
|
603
|
+
Last updated 2009-01-02 12:43:47 NZDT
|
603
604
|
</div>
|
604
605
|
</div>
|
605
606
|
</body>
|
data/asciidoc/doc/faq.txt
CHANGED
@@ -4,6 +4,65 @@ AsciiDoc Frequently Asked Questions
|
|
4
4
|
An embryonic AsciiDoc FAQ.
|
5
5
|
|
6
6
|
|
7
|
+
== Is it possible to include charts in AsciiDoc documents?
|
8
|
+
|
9
|
+
There are a number of programs available that generate presentation
|
10
|
+
charts from textual specification, for example
|
11
|
+
http://home.gna.org/pychart/[Pychart] is a library for writing chart
|
12
|
+
scripts in Python. Here's an example from the 'Pychart' documentation:
|
13
|
+
|
14
|
+
.barchart.py
|
15
|
+
---------------------------------------------------------------------
|
16
|
+
#
|
17
|
+
# Example bar chart (from Pychart documentation http://home.gna.org/pychart/).
|
18
|
+
#
|
19
|
+
from pychart import *
|
20
|
+
theme.get_options()
|
21
|
+
|
22
|
+
data = [(10, 20, 30, 5), (20, 65, 33, 5), (30, 55, 30, 5), (40, 45, 51, 7),
|
23
|
+
(50, 25, 27, 3), (60, 75, 30, 5), (70, 80, 42, 5), (80, 62, 32, 5),
|
24
|
+
(90, 42, 39, 5), (100, 32, 39, 4)]
|
25
|
+
|
26
|
+
# The attribute y_coord=... tells that the Y axis values
|
27
|
+
# should be taken from samples.
|
28
|
+
# In this example, Y values will be [40,50,60,70,80].
|
29
|
+
ar = area.T(y_coord = category_coord.T(data[3:8], 0),
|
30
|
+
x_grid_style=line_style.gray50_dash1,
|
31
|
+
x_grid_interval=20, x_range = (0,100),
|
32
|
+
x_axis=axis.X(label="X label"),
|
33
|
+
y_axis=axis.Y(label="Y label"),
|
34
|
+
bg_style = fill_style.gray90,
|
35
|
+
border_line_style = line_style.default,
|
36
|
+
legend = legend.T(loc=(80,10)))
|
37
|
+
|
38
|
+
# Below call sets the default attributes for all bar plots.
|
39
|
+
chart_object.set_defaults(bar_plot.T, direction="horizontal", data=data)
|
40
|
+
|
41
|
+
# Attribute cluster=(0,3) tells that you are going to draw three bar
|
42
|
+
# plots side by side. The plot labeled "foo" will the leftmost (i.e.,
|
43
|
+
# 0th out of 3). Attribute hcol tells the column from which to
|
44
|
+
# retrive sample values from. It defaults to one.
|
45
|
+
ar.add_plot(bar_plot.T(label="foo", cluster=(0,3)))
|
46
|
+
ar.add_plot(bar_plot.T(label="bar", hcol=2, cluster=(1,3)))
|
47
|
+
ar.add_plot(bar_plot.T(label="baz", hcol=3, cluster=(2,3)))
|
48
|
+
ar.draw()
|
49
|
+
---------------------------------------------------------------------
|
50
|
+
|
51
|
+
To execute the script and include the generated chart image in your
|
52
|
+
document add the following lines to the AsciiDoc source:
|
53
|
+
|
54
|
+
---------------------------------------------------------------------
|
55
|
+
// Generate chart image file.
|
56
|
+
\sys2::[python barchart.py --format=png --output=barchart.png --scale=2]
|
57
|
+
|
58
|
+
// Display chart image file.
|
59
|
+
image::barchart.png[]
|
60
|
+
---------------------------------------------------------------------
|
61
|
+
|
62
|
+
NOTE: You need to run asciidoc(1) with the `--unsafe` command-line
|
63
|
+
option to execute the `sys2` system macro.
|
64
|
+
|
65
|
+
|
7
66
|
== How can I render indented paragraphs?
|
8
67
|
|
9
68
|
To unconditionally indent all paragraphs add the following line to the
|
@@ -77,7 +136,7 @@ a backslash character. These elements include:
|
|
77
136
|
- Attribute references.
|
78
137
|
- Text formatting.
|
79
138
|
- Quoting,
|
80
|
-
-
|
139
|
+
- Macros.
|
81
140
|
- Replacements.
|
82
141
|
- Special words.
|
83
142
|
- Table cell separators.
|
@@ -115,8 +174,6 @@ the first match unescapes allowing the second to substitute. A
|
|
115
174
|
work-around for difficult cases is to side-step the problem using the
|
116
175
|
`\pass:[]` passthrough inline macro.
|
117
176
|
|
118
|
-
NOTE: System macros cannot be escaped.
|
119
|
-
|
120
177
|
|
121
178
|
== How can I set default list and tables styles?
|
122
179
|
|
@@ -3,7 +3,8 @@
|
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
4
4
|
<head>
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
6
|
-
<meta name="generator" content="AsciiDoc 8.
|
6
|
+
<meta name="generator" content="AsciiDoc 8.3.1" />
|
7
|
+
<title>Music Filter</title>
|
7
8
|
<style type="text/css">
|
8
9
|
/* Debug borders */
|
9
10
|
p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
|
@@ -165,13 +166,25 @@ div.listingblock > div.content {
|
|
165
166
|
padding: 0.5em;
|
166
167
|
}
|
167
168
|
|
168
|
-
div.quoteblock
|
169
|
+
div.quoteblock {
|
169
170
|
padding-left: 2.0em;
|
170
171
|
}
|
171
|
-
|
172
|
-
|
172
|
+
div.quoteblock > div.attribution {
|
173
|
+
padding-top: 0.5em;
|
173
174
|
text-align: right;
|
174
175
|
}
|
176
|
+
|
177
|
+
div.verseblock {
|
178
|
+
padding-left: 2.0em;
|
179
|
+
}
|
180
|
+
div.verseblock > div.content {
|
181
|
+
white-space: pre;
|
182
|
+
}
|
183
|
+
div.verseblock > div.attribution {
|
184
|
+
padding-top: 0.75em;
|
185
|
+
text-align: left;
|
186
|
+
}
|
187
|
+
/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
|
175
188
|
div.verseblock + div.attribution {
|
176
189
|
text-align: left;
|
177
190
|
}
|
@@ -194,10 +207,6 @@ div.exampleblock > div.content {
|
|
194
207
|
padding: 0.5em;
|
195
208
|
}
|
196
209
|
|
197
|
-
div.verseblock div.content {
|
198
|
-
white-space: pre;
|
199
|
-
}
|
200
|
-
|
201
210
|
div.imageblock div.content { padding-left: 0; }
|
202
211
|
div.imageblock img { border: 1px solid silver; }
|
203
212
|
span.image img { border-style: none; }
|
@@ -210,6 +219,7 @@ dt {
|
|
210
219
|
margin-top: 0.5em;
|
211
220
|
margin-bottom: 0;
|
212
221
|
font-style: normal;
|
222
|
+
color: navy;
|
213
223
|
}
|
214
224
|
dd > *:first-child {
|
215
225
|
margin-top: 0.1em;
|
@@ -218,12 +228,28 @@ dd > *:first-child {
|
|
218
228
|
ul, ol {
|
219
229
|
list-style-position: outside;
|
220
230
|
}
|
221
|
-
|
231
|
+
ol.arabic {
|
222
232
|
list-style-type: decimal;
|
223
233
|
}
|
224
|
-
|
234
|
+
ol.loweralpha {
|
225
235
|
list-style-type: lower-alpha;
|
226
236
|
}
|
237
|
+
ol.upperalpha {
|
238
|
+
list-style-type: upper-alpha;
|
239
|
+
}
|
240
|
+
ol.lowerroman {
|
241
|
+
list-style-type: lower-roman;
|
242
|
+
}
|
243
|
+
ol.upperroman {
|
244
|
+
list-style-type: upper-roman;
|
245
|
+
}
|
246
|
+
|
247
|
+
div.compact ul, div.compact ol,
|
248
|
+
div.compact p, div.compact p,
|
249
|
+
div.compact div, div.compact div {
|
250
|
+
margin-top: 0.1em;
|
251
|
+
margin-bottom: 0.1em;
|
252
|
+
}
|
227
253
|
|
228
254
|
div.tableblock > table {
|
229
255
|
border: 3px solid #527bbd;
|
@@ -235,22 +261,49 @@ thead {
|
|
235
261
|
tfoot {
|
236
262
|
font-weight: bold;
|
237
263
|
}
|
264
|
+
td > div.verse {
|
265
|
+
white-space: pre;
|
266
|
+
}
|
267
|
+
p.table {
|
268
|
+
margin-top: 0;
|
269
|
+
}
|
270
|
+
/* Because the table frame attribute is overriden by CSS in most browsers. */
|
271
|
+
div.tableblock > table[frame="void"] {
|
272
|
+
border-style: none;
|
273
|
+
}
|
274
|
+
div.tableblock > table[frame="hsides"] {
|
275
|
+
border-left-style: none;
|
276
|
+
border-right-style: none;
|
277
|
+
}
|
278
|
+
div.tableblock > table[frame="vsides"] {
|
279
|
+
border-top-style: none;
|
280
|
+
border-bottom-style: none;
|
281
|
+
}
|
282
|
+
|
238
283
|
|
239
|
-
div.
|
284
|
+
div.hdlist {
|
240
285
|
margin-top: 0.8em;
|
241
286
|
margin-bottom: 0.8em;
|
242
287
|
}
|
243
|
-
div.
|
288
|
+
div.hdlist tr {
|
244
289
|
padding-bottom: 15px;
|
245
290
|
}
|
246
|
-
td.
|
291
|
+
dt.hdlist1.strong, td.hdlist1.strong {
|
292
|
+
font-weight: bold;
|
293
|
+
}
|
294
|
+
td.hdlist1 {
|
247
295
|
vertical-align: top;
|
248
296
|
font-style: normal;
|
249
297
|
padding-right: 0.8em;
|
298
|
+
color: navy;
|
250
299
|
}
|
251
|
-
td.
|
300
|
+
td.hdlist2 {
|
252
301
|
vertical-align: top;
|
253
302
|
}
|
303
|
+
div.hdlist.compact tr {
|
304
|
+
margin: 0;
|
305
|
+
padding-bottom: 0;
|
306
|
+
}
|
254
307
|
|
255
308
|
@media print {
|
256
309
|
div#footer-badges { display: none; }
|
@@ -302,8 +355,17 @@ div.listingblock div.content {
|
|
302
355
|
padding: 0.5em;
|
303
356
|
}
|
304
357
|
|
305
|
-
div.quoteblock-
|
306
|
-
padding-
|
358
|
+
div.quoteblock-attribution {
|
359
|
+
padding-top: 0.5em;
|
360
|
+
text-align: right;
|
361
|
+
}
|
362
|
+
|
363
|
+
div.verseblock-content {
|
364
|
+
white-space: pre;
|
365
|
+
}
|
366
|
+
div.verseblock-attribution {
|
367
|
+
padding-top: 0.75em;
|
368
|
+
text-align: left;
|
307
369
|
}
|
308
370
|
|
309
371
|
div.exampleblock-content {
|
@@ -313,16 +375,7 @@ div.exampleblock-content {
|
|
313
375
|
|
314
376
|
/* IE6 sets dynamically generated links as visited. */
|
315
377
|
div#toc a:visited { color: blue; }
|
316
|
-
|
317
|
-
/* Because IE6 child selector is broken. */
|
318
|
-
div.olist2 ol {
|
319
|
-
list-style-type: lower-alpha;
|
320
|
-
}
|
321
|
-
div.olist2 div.olist ol {
|
322
|
-
list-style-type: decimal;
|
323
|
-
}
|
324
378
|
</style>
|
325
|
-
<title>Music Filter</title>
|
326
379
|
</head>
|
327
380
|
<body>
|
328
381
|
<div id="header">
|
@@ -330,28 +383,28 @@ div.olist2 div.olist ol {
|
|
330
383
|
</div>
|
331
384
|
<div id="preamble">
|
332
385
|
<div class="sectionbody">
|
333
|
-
<div class="
|
386
|
+
<div class="paragraph"><p>The <em>AsciiDoc</em> distribution includes a Music Block filter that
|
334
387
|
translates music in <a href="http://lilypond.org/">LilyPond</a> or
|
335
388
|
<a href="http://abcnotation.org.uk/">ABC</a> notation to standard classical
|
336
389
|
notation in the form of a trimmed PNG image which is automatically
|
337
390
|
inserted into the <em>AsciiDoc</em> output document (see the <a href="#X1">examples below</a>).</p></div>
|
338
|
-
<div class="
|
391
|
+
<div class="paragraph"><p>Actually the filter (<tt>./filters/music2png.py</tt>) can be used outside
|
339
392
|
<em>AsciiDoc</em> to convert LilyPond or ABC music files to PNG images.
|
340
393
|
Execute the following command to see how to use it:</p></div>
|
341
394
|
<div class="literalblock">
|
342
395
|
<div class="content">
|
343
396
|
<pre><tt>$ ./filters/music2png.py --help</tt></pre>
|
344
397
|
</div></div>
|
345
|
-
<div class="
|
398
|
+
<div class="paragraph"><p>The Music Filter can be used as a model for filters that convert a
|
346
399
|
block of text into a file that is linked or embedded into the <em>AsciiDoc</em>
|
347
400
|
output document.</p></div>
|
348
401
|
<div class="exampleblock" id="X1">
|
349
402
|
<div class="title">Example 1: Music Block containing ABC notation</div>
|
350
403
|
<div class="exampleblock-content">
|
351
|
-
<div class="
|
404
|
+
<div class="paragraph"><p>This Music Block:</p></div>
|
352
405
|
<div class="listingblock">
|
353
406
|
<div class="content">
|
354
|
-
<pre><tt> [music,music1.png]
|
407
|
+
<pre><tt> ["music","music1.png",scaledwidth="100%"]
|
355
408
|
---------------------------------------------------------------------
|
356
409
|
T:The Butterfly
|
357
410
|
R:slip jig
|
@@ -367,7 +420,7 @@ output document.</p></div>
|
|
367
420
|
|:~B3 (B2A) G2A|~B3 BA(uB d)BA|~B3 (B2A) G2(A|B2d) (g2e) (dBA):|
|
368
421
|
---------------------------------------------------------------------</tt></pre>
|
369
422
|
</div></div>
|
370
|
-
<div class="
|
423
|
+
<div class="paragraph"><p>Renders:</p></div>
|
371
424
|
<div class="musicblock">
|
372
425
|
<div class="content">
|
373
426
|
<img style="border-width: 0;" src="music1.png" alt="music1.png" />
|
@@ -376,7 +429,7 @@ output document.</p></div>
|
|
376
429
|
<div class="exampleblock" id="X2">
|
377
430
|
<div class="title">Example 2: Music Block containing LilyPond notation</div>
|
378
431
|
<div class="exampleblock-content">
|
379
|
-
<div class="
|
432
|
+
<div class="paragraph"><p>This example contains LilyPond musical markup, it uses the <em>link</em>
|
380
433
|
attribute so you can click on the music image to display the source
|
381
434
|
notation. The <tt>music2.ly</tt> source file is automatically created and
|
382
435
|
retained by the <tt>music2png.py</tt> filter when the <tt>-m</tt> option is used.</p></div>
|
@@ -395,7 +448,7 @@ retained by the <tt>music2png.py</tt> filter when the <tt>-m</tt> option is used
|
|
395
448
|
}
|
396
449
|
---------------------------------------------------------------------</tt></pre>
|
397
450
|
</div></div>
|
398
|
-
<div class="
|
451
|
+
<div class="paragraph"><p>Renders:</p></div>
|
399
452
|
<div class="musicblock">
|
400
453
|
<div class="content">
|
401
454
|
<a href="music2.ly">
|
@@ -418,9 +471,9 @@ are using.</td>
|
|
418
471
|
</div>
|
419
472
|
<h2 id="_using_the_filter">Using the Filter</h2>
|
420
473
|
<div class="sectionbody">
|
421
|
-
<div class="
|
474
|
+
<div class="paragraph"><p>Insert a delimited Music Block containing valid ABC notation into your
|
422
475
|
<em>AsciiDoc</em> document:</p></div>
|
423
|
-
<div class="
|
476
|
+
<div class="ulist"><ul>
|
424
477
|
<li>
|
425
478
|
<p>
|
426
479
|
The Music Block delimiter is the word <tt>music</tt> followed by four or
|
@@ -452,7 +505,7 @@ The optional named block attributes <em>link</em>, <em>width</em> and <em>height
|
|
452
505
|
</div>
|
453
506
|
<h2 id="_limitations">Limitations</h2>
|
454
507
|
<div class="sectionbody">
|
455
|
-
<div class="
|
508
|
+
<div class="ulist"><ul>
|
456
509
|
<li>
|
457
510
|
<p>
|
458
511
|
The <tt><tt>asciidoc(1)</tt></tt> output file cannot be <tt>-</tt> (stdout), you must
|
@@ -470,8 +523,8 @@ If the music image file is linked to the output document then the
|
|
470
523
|
</div>
|
471
524
|
<h2 id="_installation">Installation</h2>
|
472
525
|
<div class="sectionbody">
|
473
|
-
<div class="
|
474
|
-
<div class="
|
526
|
+
<div class="paragraph"><p>In addition to <em>AsciiDoc</em> you will need to have installed:</p></div>
|
527
|
+
<div class="ulist"><ul>
|
475
528
|
<li>
|
476
529
|
<p>
|
477
530
|
<a href="http://lilypond.org/web/">LilyPond</a> (most Linux distributions include
|
@@ -485,13 +538,13 @@ If the music image file is linked to the output document then the
|
|
485
538
|
</p>
|
486
539
|
</li>
|
487
540
|
</ul></div>
|
488
|
-
<div class="
|
541
|
+
<div class="paragraph"><p>Test the music filter it by converting the test file to HTML with <em>AsciiDoc</em>:</p></div>
|
489
542
|
<div class="literalblock">
|
490
543
|
<div class="content">
|
491
544
|
<pre><tt>$ asciidoc -v ./filters/music-filter-test.txt
|
492
545
|
$ firefox ./filters/music-filter-test.html &</tt></pre>
|
493
546
|
</div></div>
|
494
|
-
<div class="
|
547
|
+
<div class="paragraph"><p>The filter was developed and tested on Xubuntu Linux using LilyPond
|
495
548
|
2.10.5 and ImageMagick 6.2.4.</p></div>
|
496
549
|
<div class="admonitionblock">
|
497
550
|
<table><tr>
|
@@ -506,7 +559,7 @@ a problem).</td>
|
|
506
559
|
</div>
|
507
560
|
<div id="footer">
|
508
561
|
<div id="footer-text">
|
509
|
-
Last updated 2008-
|
562
|
+
Last updated 2008-12-31 14:47:04 NZDT
|
510
563
|
</div>
|
511
564
|
</div>
|
512
565
|
</body>
|
Binary file
|
@@ -1,378 +1,30 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD
|
2
|
-
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
|
+
<html>
|
4
3
|
<head>
|
5
|
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
|
6
|
-
<meta name="generator" content="AsciiDoc 8.2
|
7
|
-
<style type="text/css">
|
8
|
-
/* Debug borders */
|
9
|
-
p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
|
10
|
-
/*
|
11
|
-
border: 1px solid red;
|
12
|
-
*/
|
13
|
-
}
|
14
|
-
|
15
|
-
body {
|
16
|
-
margin: 1em 5% 1em 5%;
|
17
|
-
}
|
18
|
-
|
19
|
-
a {
|
20
|
-
color: blue;
|
21
|
-
text-decoration: underline;
|
22
|
-
}
|
23
|
-
a:visited {
|
24
|
-
color: fuchsia;
|
25
|
-
}
|
26
|
-
|
27
|
-
em {
|
28
|
-
font-style: italic;
|
29
|
-
color: navy;
|
30
|
-
}
|
31
|
-
|
32
|
-
strong {
|
33
|
-
font-weight: bold;
|
34
|
-
color: #083194;
|
35
|
-
}
|
36
|
-
|
37
|
-
tt {
|
38
|
-
color: navy;
|
39
|
-
}
|
40
|
-
|
41
|
-
h1, h2, h3, h4, h5, h6 {
|
42
|
-
color: #527bbd;
|
43
|
-
font-family: sans-serif;
|
44
|
-
margin-top: 1.2em;
|
45
|
-
margin-bottom: 0.5em;
|
46
|
-
line-height: 1.3;
|
47
|
-
}
|
48
|
-
|
49
|
-
h1, h2, h3 {
|
50
|
-
border-bottom: 2px solid silver;
|
51
|
-
}
|
52
|
-
h2 {
|
53
|
-
padding-top: 0.5em;
|
54
|
-
}
|
55
|
-
h3 {
|
56
|
-
float: left;
|
57
|
-
}
|
58
|
-
h3 + * {
|
59
|
-
clear: left;
|
60
|
-
}
|
61
|
-
|
62
|
-
div.sectionbody {
|
63
|
-
font-family: serif;
|
64
|
-
margin-left: 0;
|
65
|
-
}
|
66
|
-
|
67
|
-
hr {
|
68
|
-
border: 1px solid silver;
|
69
|
-
}
|
70
|
-
|
71
|
-
p {
|
72
|
-
margin-top: 0.5em;
|
73
|
-
margin-bottom: 0.5em;
|
74
|
-
}
|
75
|
-
|
76
|
-
ul, ol, li > p {
|
77
|
-
margin-top: 0;
|
78
|
-
}
|
79
|
-
|
80
|
-
pre {
|
81
|
-
padding: 0;
|
82
|
-
margin: 0;
|
83
|
-
}
|
84
|
-
|
85
|
-
span#author {
|
86
|
-
color: #527bbd;
|
87
|
-
font-family: sans-serif;
|
88
|
-
font-weight: bold;
|
89
|
-
font-size: 1.1em;
|
90
|
-
}
|
91
|
-
span#email {
|
92
|
-
}
|
93
|
-
span#revision {
|
94
|
-
font-family: sans-serif;
|
95
|
-
}
|
96
|
-
|
97
|
-
div#footer {
|
98
|
-
font-family: sans-serif;
|
99
|
-
font-size: small;
|
100
|
-
border-top: 2px solid silver;
|
101
|
-
padding-top: 0.5em;
|
102
|
-
margin-top: 4.0em;
|
103
|
-
}
|
104
|
-
div#footer-text {
|
105
|
-
float: left;
|
106
|
-
padding-bottom: 0.5em;
|
107
|
-
}
|
108
|
-
div#footer-badges {
|
109
|
-
float: right;
|
110
|
-
padding-bottom: 0.5em;
|
111
|
-
}
|
112
|
-
|
113
|
-
div#preamble,
|
114
|
-
div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
|
115
|
-
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
|
116
|
-
div.admonitionblock {
|
117
|
-
margin-right: 10%;
|
118
|
-
margin-top: 1.5em;
|
119
|
-
margin-bottom: 1.5em;
|
120
|
-
}
|
121
|
-
div.admonitionblock {
|
122
|
-
margin-top: 2.5em;
|
123
|
-
margin-bottom: 2.5em;
|
124
|
-
}
|
125
|
-
|
126
|
-
div.content { /* Block element content. */
|
127
|
-
padding: 0;
|
128
|
-
}
|
129
|
-
|
130
|
-
/* Block element titles. */
|
131
|
-
div.title, caption.title {
|
132
|
-
color: #527bbd;
|
133
|
-
font-family: sans-serif;
|
134
|
-
font-weight: bold;
|
135
|
-
text-align: left;
|
136
|
-
margin-top: 1.0em;
|
137
|
-
margin-bottom: 0.5em;
|
138
|
-
}
|
139
|
-
div.title + * {
|
140
|
-
margin-top: 0;
|
141
|
-
}
|
142
|
-
|
143
|
-
td div.title:first-child {
|
144
|
-
margin-top: 0.0em;
|
145
|
-
}
|
146
|
-
div.content div.title:first-child {
|
147
|
-
margin-top: 0.0em;
|
148
|
-
}
|
149
|
-
div.content + div.title {
|
150
|
-
margin-top: 0.0em;
|
151
|
-
}
|
152
|
-
|
153
|
-
div.sidebarblock > div.content {
|
154
|
-
background: #ffffee;
|
155
|
-
border: 1px solid silver;
|
156
|
-
padding: 0.5em;
|
157
|
-
}
|
158
|
-
|
159
|
-
div.listingblock {
|
160
|
-
margin-right: 0%;
|
161
|
-
}
|
162
|
-
div.listingblock > div.content {
|
163
|
-
border: 1px solid silver;
|
164
|
-
background: #f4f4f4;
|
165
|
-
padding: 0.5em;
|
166
|
-
}
|
167
|
-
|
168
|
-
div.quoteblock {
|
169
|
-
padding-left: 2.0em;
|
170
|
-
}
|
171
|
-
div.quoteblock > div.attribution {
|
172
|
-
padding-top: 0.5em;
|
173
|
-
text-align: right;
|
174
|
-
}
|
175
|
-
|
176
|
-
div.verseblock {
|
177
|
-
padding-left: 2.0em;
|
178
|
-
}
|
179
|
-
div.verseblock > div.content {
|
180
|
-
white-space: pre;
|
181
|
-
}
|
182
|
-
div.verseblock > div.attribution {
|
183
|
-
padding-top: 0.75em;
|
184
|
-
text-align: left;
|
185
|
-
}
|
186
|
-
/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
|
187
|
-
div.verseblock + div.attribution {
|
188
|
-
text-align: left;
|
189
|
-
}
|
190
|
-
|
191
|
-
div.admonitionblock .icon {
|
192
|
-
vertical-align: top;
|
193
|
-
font-size: 1.1em;
|
194
|
-
font-weight: bold;
|
195
|
-
text-decoration: underline;
|
196
|
-
color: #527bbd;
|
197
|
-
padding-right: 0.5em;
|
198
|
-
}
|
199
|
-
div.admonitionblock td.content {
|
200
|
-
padding-left: 0.5em;
|
201
|
-
border-left: 2px solid silver;
|
202
|
-
}
|
203
|
-
|
204
|
-
div.exampleblock > div.content {
|
205
|
-
border-left: 2px solid silver;
|
206
|
-
padding: 0.5em;
|
207
|
-
}
|
208
|
-
|
209
|
-
div.imageblock div.content { padding-left: 0; }
|
210
|
-
div.imageblock img { border: 1px solid silver; }
|
211
|
-
span.image img { border-style: none; }
|
212
|
-
|
213
|
-
dl {
|
214
|
-
margin-top: 0.8em;
|
215
|
-
margin-bottom: 0.8em;
|
216
|
-
}
|
217
|
-
dt {
|
218
|
-
margin-top: 0.5em;
|
219
|
-
margin-bottom: 0;
|
220
|
-
font-style: normal;
|
221
|
-
}
|
222
|
-
dd > *:first-child {
|
223
|
-
margin-top: 0.1em;
|
224
|
-
}
|
225
|
-
|
226
|
-
ul, ol {
|
227
|
-
list-style-position: outside;
|
228
|
-
}
|
229
|
-
div.olist > ol {
|
230
|
-
list-style-type: decimal;
|
231
|
-
}
|
232
|
-
div.olist2 > ol {
|
233
|
-
list-style-type: lower-alpha;
|
234
|
-
}
|
235
|
-
|
236
|
-
div.tableblock > table {
|
237
|
-
border: 3px solid #527bbd;
|
238
|
-
}
|
239
|
-
thead {
|
240
|
-
font-family: sans-serif;
|
241
|
-
font-weight: bold;
|
242
|
-
}
|
243
|
-
tfoot {
|
244
|
-
font-weight: bold;
|
245
|
-
}
|
246
|
-
|
247
|
-
div.hlist {
|
248
|
-
margin-top: 0.8em;
|
249
|
-
margin-bottom: 0.8em;
|
250
|
-
}
|
251
|
-
div.hlist td {
|
252
|
-
padding-bottom: 15px;
|
253
|
-
}
|
254
|
-
td.hlist1 {
|
255
|
-
vertical-align: top;
|
256
|
-
font-style: normal;
|
257
|
-
padding-right: 0.8em;
|
258
|
-
}
|
259
|
-
td.hlist2 {
|
260
|
-
vertical-align: top;
|
261
|
-
}
|
262
|
-
|
263
|
-
@media print {
|
264
|
-
div#footer-badges { display: none; }
|
265
|
-
}
|
266
|
-
|
267
|
-
div#toctitle {
|
268
|
-
color: #527bbd;
|
269
|
-
font-family: sans-serif;
|
270
|
-
font-size: 1.1em;
|
271
|
-
font-weight: bold;
|
272
|
-
margin-top: 1.0em;
|
273
|
-
margin-bottom: 0.1em;
|
274
|
-
}
|
275
|
-
|
276
|
-
div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
|
277
|
-
margin-top: 0;
|
278
|
-
margin-bottom: 0;
|
279
|
-
}
|
280
|
-
div.toclevel2 {
|
281
|
-
margin-left: 2em;
|
282
|
-
font-size: 0.9em;
|
283
|
-
}
|
284
|
-
div.toclevel3 {
|
285
|
-
margin-left: 4em;
|
286
|
-
font-size: 0.9em;
|
287
|
-
}
|
288
|
-
div.toclevel4 {
|
289
|
-
margin-left: 6em;
|
290
|
-
font-size: 0.9em;
|
291
|
-
}
|
292
|
-
/* Workarounds for IE6's broken and incomplete CSS2. */
|
293
|
-
|
294
|
-
div.sidebar-content {
|
295
|
-
background: #ffffee;
|
296
|
-
border: 1px solid silver;
|
297
|
-
padding: 0.5em;
|
298
|
-
}
|
299
|
-
div.sidebar-title, div.image-title {
|
300
|
-
color: #527bbd;
|
301
|
-
font-family: sans-serif;
|
302
|
-
font-weight: bold;
|
303
|
-
margin-top: 0.0em;
|
304
|
-
margin-bottom: 0.5em;
|
305
|
-
}
|
306
|
-
|
307
|
-
div.listingblock div.content {
|
308
|
-
border: 1px solid silver;
|
309
|
-
background: #f4f4f4;
|
310
|
-
padding: 0.5em;
|
311
|
-
}
|
312
|
-
|
313
|
-
div.quoteblock-attribution {
|
314
|
-
padding-top: 0.5em;
|
315
|
-
text-align: right;
|
316
|
-
}
|
317
|
-
|
318
|
-
div.verseblock-content {
|
319
|
-
white-space: pre;
|
320
|
-
}
|
321
|
-
div.verseblock-attribution {
|
322
|
-
padding-top: 0.75em;
|
323
|
-
text-align: left;
|
324
|
-
}
|
325
|
-
|
326
|
-
div.exampleblock-content {
|
327
|
-
border-left: 2px solid silver;
|
328
|
-
padding-left: 0.5em;
|
329
|
-
}
|
330
|
-
|
331
|
-
/* IE6 sets dynamically generated links as visited. */
|
332
|
-
div#toc a:visited { color: blue; }
|
333
|
-
|
334
|
-
/* Because IE6 child selector is broken. */
|
335
|
-
div.olist2 ol {
|
336
|
-
list-style-type: lower-alpha;
|
337
|
-
}
|
338
|
-
div.olist2 div.olist ol {
|
339
|
-
list-style-type: decimal;
|
340
|
-
}
|
341
|
-
</style>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
5
|
+
<meta name="generator" content="AsciiDoc 8.3.2">
|
342
6
|
<title>Source Code Highlight Filter</title>
|
343
7
|
</head>
|
344
8
|
<body>
|
345
|
-
<div id="header">
|
346
9
|
<h1>Source Code Highlight Filter</h1>
|
347
|
-
|
348
|
-
|
349
|
-
<
|
350
|
-
<div class="para"><p>The <em>AsciiDoc</em> distribution includes a source code syntax highlight
|
10
|
+
<p>
|
11
|
+
</p>
|
12
|
+
<p>The <em>AsciiDoc</em> distribution includes a source code syntax highlight
|
351
13
|
filter (<tt>source-highlight-filter.conf</tt>). It uses
|
352
14
|
<a href="http://www.gnu.org/software/src-highlite/">GNU source-highlight</a> to
|
353
15
|
highlight HTML outputs; DocBook outputs are highlighted by toolchains
|
354
16
|
that have <tt>programlisting</tt> element highlight support, for example
|
355
|
-
<em>dblatex</em>.</p
|
356
|
-
<
|
357
|
-
<
|
358
|
-
|
359
|
-
<
|
360
|
-
</
|
361
|
-
<
|
362
|
-
<
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
</div>
|
367
|
-
</div>
|
368
|
-
<h2 id="_examples">Examples</h2>
|
369
|
-
<div class="sectionbody">
|
370
|
-
<h3 id="_source_code_paragraphs">Source code paragraphs</h3><div style="clear:left"></div>
|
371
|
-
<div class="para"><p>The <tt>source</tt> paragraph style will highlight a paragraph of source
|
372
|
-
code. These three code paragraphs:</p></div>
|
373
|
-
<div class="listingblock">
|
374
|
-
<div class="content">
|
375
|
-
<pre><tt>[source,python]
|
17
|
+
<em>dblatex</em>.</p>
|
18
|
+
<p><b>Tip:</b> If the source <em>language</em> attribute has been set (using an
|
19
|
+
<em>AttributeEntry</em> or from the command-line) you don’t have to specify
|
20
|
+
it in each source code block.</p>
|
21
|
+
<hr />
|
22
|
+
<h2><a name="_examples"></a>Examples</h2>
|
23
|
+
<h3><a name="_source_code_paragraphs"></a>Source code paragraphs</h3>
|
24
|
+
<p>The <tt>source</tt> paragraph style will highlight a paragraph of source
|
25
|
+
code. These three code paragraphs:</p>
|
26
|
+
<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10"><tr><td>
|
27
|
+
<pre>[source,python]
|
376
28
|
if n < 0: print 'Hello World!'
|
377
29
|
|
378
30
|
:language: python
|
@@ -382,36 +34,29 @@ if n < 0: print 'Hello World!'
|
|
382
34
|
|
383
35
|
[source,ruby,numbered]
|
384
36
|
[true, false].cycle([0, 1, 2, 3, 4]) do |a, b|
|
385
|
-
puts "#{a.inspect} => #{b.inspect}"</
|
386
|
-
</
|
387
|
-
<
|
388
|
-
|
389
|
-
<div class="exampleblock-content"><!-- Generator: GNU source-highlight 2.4
|
37
|
+
puts "#{a.inspect} => #{b.inspect}"</pre>
|
38
|
+
</td></tr></table>
|
39
|
+
<p>Render this highlighted source code:</p>
|
40
|
+
<!-- Generator: GNU source-highlight 2.4
|
390
41
|
by Lorenzo Bettini
|
391
42
|
http://www.lorenzobettini.it
|
392
43
|
http://www.gnu.org/software/src-highlite -->
|
393
|
-
<pre><tt><
|
394
|
-
|
395
|
-
<div class="exampleblock">
|
396
|
-
<div class="exampleblock-content"><!-- Generator: GNU source-highlight 2.4
|
44
|
+
<pre><tt><b><font color="#0000FF">if</font></b> n <font color="#990000"><</font> <font color="#993399">0</font><font color="#990000">:</font> <b><font color="#0000FF">print</font></b> <font color="#FF0000">'Hello World!'</font></tt></pre>
|
45
|
+
<!-- Generator: GNU source-highlight 2.4
|
397
46
|
by Lorenzo Bettini
|
398
47
|
http://www.lorenzobettini.it
|
399
48
|
http://www.gnu.org/software/src-highlite -->
|
400
|
-
<pre><tt><
|
401
|
-
|
402
|
-
<div class="exampleblock">
|
403
|
-
<div class="exampleblock-content"><!-- Generator: GNU source-highlight 2.4
|
49
|
+
<pre><tt><b><font color="#0000FF">if</font></b> n <font color="#990000"><</font> <font color="#993399">0</font><font color="#990000">:</font> <b><font color="#0000FF">print</font></b> <font color="#FF0000">'Hello World!'</font></tt></pre>
|
50
|
+
<!-- Generator: GNU source-highlight 2.4
|
404
51
|
by Lorenzo Bettini
|
405
52
|
http://www.lorenzobettini.it
|
406
53
|
http://www.gnu.org/software/src-highlite -->
|
407
|
-
<pre><tt><
|
408
|
-
<
|
409
|
-
|
410
|
-
<
|
411
|
-
<
|
412
|
-
<
|
413
|
-
<div class="content">
|
414
|
-
<pre><tt> [source,python]
|
54
|
+
<pre><tt><font color="#000000">00001:</font> <font color="#990000">[</font><b><font color="#0000FF">true</font></b><font color="#990000">,</font> <b><font color="#0000FF">false</font></b><font color="#990000">].</font><b><font color="#000000">cycle</font></b><font color="#990000">([</font><font color="#993399">0</font><font color="#990000">,</font> <font color="#993399">1</font><font color="#990000">,</font> <font color="#993399">2</font><font color="#990000">,</font> <font color="#993399">3</font><font color="#990000">,</font> <font color="#993399">4</font><font color="#990000">])</font> <b><font color="#0000FF">do</font></b> <font color="#990000">|</font>a<font color="#990000">,</font> b<font color="#990000">|</font>
|
55
|
+
<font color="#000000">00002:</font> puts <font color="#FF0000">"#{a.inspect} => #{b.inspect}"</font></tt></pre>
|
56
|
+
<h3><a name="_unnumbered_source_code_listing"></a>Unnumbered source code listing</h3>
|
57
|
+
<p>This source-highlight filtered block:</p>
|
58
|
+
<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10"><tr><td>
|
59
|
+
<pre> [source,python]
|
415
60
|
---------------------------------------------------------------------
|
416
61
|
''' A multi-line
|
417
62
|
comment.'''
|
@@ -422,29 +67,26 @@ http://www.gnu.org/software/src-highlite -->
|
|
422
67
|
return quote + word + quote
|
423
68
|
else:
|
424
69
|
return word
|
425
|
-
---------------------------------------------------------------------</
|
426
|
-
</
|
427
|
-
<
|
428
|
-
<
|
429
|
-
<div class="content"><!-- Generator: GNU source-highlight 2.4
|
70
|
+
---------------------------------------------------------------------</pre>
|
71
|
+
</td></tr></table>
|
72
|
+
<p>Renders this highlighted source code:</p>
|
73
|
+
<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10"><tr><td><!-- Generator: GNU source-highlight 2.4
|
430
74
|
by Lorenzo Bettini
|
431
75
|
http://www.lorenzobettini.it
|
432
76
|
http://www.gnu.org/software/src-highlite -->
|
433
|
-
<pre><tt><
|
434
|
-
<
|
435
|
-
<
|
436
|
-
<
|
437
|
-
word <
|
438
|
-
<
|
439
|
-
<
|
440
|
-
<
|
441
|
-
<
|
442
|
-
|
443
|
-
<
|
444
|
-
<
|
445
|
-
<
|
446
|
-
<div class="content">
|
447
|
-
<pre><tt> [source,ruby,numbered]
|
77
|
+
<pre><tt><i><font color="#9A1900">''' A multi-line</font></i>
|
78
|
+
<i><font color="#9A1900"> comment.'''</font></i>
|
79
|
+
<b><font color="#0000FF">def</font></b> <b><font color="#000000">sub_word</font></b><font color="#990000">(</font>mo<font color="#990000">):</font>
|
80
|
+
<i><font color="#9A1900"> ''' Single line comment.'''</font></i>
|
81
|
+
word <font color="#990000">=</font> mo<font color="#990000">.</font><b><font color="#000000">group</font></b><font color="#990000">(</font><font color="#FF0000">'word'</font><font color="#990000">)</font> <i><font color="#9A1900"># Inline comment</font></i>
|
82
|
+
<b><font color="#0000FF">if</font></b> word <b><font color="#0000FF">in</font></b> keywords<font color="#990000">[</font>language<font color="#990000">]:</font>
|
83
|
+
<b><font color="#0000FF">return</font></b> quote <font color="#990000">+</font> word <font color="#990000">+</font> quote
|
84
|
+
<b><font color="#0000FF">else</font></b><font color="#990000">:</font>
|
85
|
+
<b><font color="#0000FF">return</font></b> word</tt></pre></td></tr></table>
|
86
|
+
<h3><a name="_numbered_source_code_listing_with_callouts"></a>Numbered source code listing with callouts</h3>
|
87
|
+
<p>This source-highlight filtered block:</p>
|
88
|
+
<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10"><tr><td>
|
89
|
+
<pre> [source,ruby,numbered]
|
448
90
|
---------------------------------------------------------------------
|
449
91
|
#
|
450
92
|
# Useful Ruby base class extensions.
|
@@ -479,46 +121,44 @@ http://www.gnu.org/software/src-highlite -->
|
|
479
121
|
---------------------------------------------------------------------
|
480
122
|
|
481
123
|
<1> First callout.
|
482
|
-
<2> Second
|
483
|
-
</
|
484
|
-
<
|
485
|
-
<
|
486
|
-
<div class="content"><!-- Generator: GNU source-highlight 2.4
|
124
|
+
<2> Second callout.</pre>
|
125
|
+
</td></tr></table>
|
126
|
+
<p>Renders this highlighted source code:</p>
|
127
|
+
<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10"><tr><td><!-- Generator: GNU source-highlight 2.4
|
487
128
|
by Lorenzo Bettini
|
488
129
|
http://www.lorenzobettini.it
|
489
130
|
http://www.gnu.org/software/src-highlite -->
|
490
|
-
<pre><tt><
|
491
|
-
<
|
492
|
-
<
|
493
|
-
<
|
494
|
-
<
|
495
|
-
<
|
496
|
-
<
|
497
|
-
<
|
498
|
-
<
|
499
|
-
<
|
500
|
-
<
|
501
|
-
<
|
502
|
-
<
|
503
|
-
<
|
504
|
-
<
|
505
|
-
<
|
506
|
-
<
|
507
|
-
<
|
508
|
-
<
|
509
|
-
<
|
510
|
-
<
|
511
|
-
<
|
512
|
-
<
|
513
|
-
<
|
514
|
-
<
|
515
|
-
<
|
516
|
-
<
|
517
|
-
<
|
518
|
-
<
|
519
|
-
<
|
520
|
-
|
521
|
-
<div class="colist"><ol>
|
131
|
+
<pre><tt><font color="#000000">00001:</font> <i><font color="#9A1900">#</font></i>
|
132
|
+
<font color="#000000">00002:</font> <i><font color="#9A1900"># Useful Ruby base class extensions.</font></i>
|
133
|
+
<font color="#000000">00003:</font> <i><font color="#9A1900">#</font></i>
|
134
|
+
<font color="#000000">00004:</font>
|
135
|
+
<font color="#000000">00005:</font> <b><font color="#0000FF">class</font></b> Array
|
136
|
+
<font color="#000000">00006:</font>
|
137
|
+
<font color="#000000">00007:</font> <i><font color="#9A1900"># Execute a block passing it corresponding items in</font></i>
|
138
|
+
<font color="#000000">00008:</font> <i><font color="#9A1900"># +self+ and +other_array+.</font></i>
|
139
|
+
<font color="#000000">00009:</font> <i><font color="#9A1900"># If self has less items than other_array it is repeated.</font></i>
|
140
|
+
<font color="#000000">00010:</font>
|
141
|
+
<font color="#000000">00011:</font> <b><font color="#0000FF">def</font></b> <b><font color="#000000">cycle</font></b><font color="#990000">(</font>other_array<font color="#990000">)</font> <i><font color="#9A1900"># :yields: item, other_item</font></i>
|
142
|
+
<font color="#000000">00012:</font> other_array<font color="#990000">.</font>each_with_index <b><font color="#0000FF">do</font></b> <font color="#990000">|</font>item<font color="#990000">,</font> index<font color="#990000">|</font>
|
143
|
+
<font color="#000000">00013:</font> <b><font color="#0000FF">yield</font></b><font color="#990000">(</font><b><font color="#0000FF">self</font></b><font color="#990000">[</font>index <font color="#990000">%</font> <b><font color="#0000FF">self</font></b><font color="#990000">.</font>length<font color="#990000">],</font> item<font color="#990000">)</font>
|
144
|
+
<font color="#000000">00014:</font> <b><font color="#0000FF">end</font></b>
|
145
|
+
<font color="#000000">00015:</font> <b><font color="#0000FF">end</font></b>
|
146
|
+
<font color="#000000">00016:</font>
|
147
|
+
<font color="#000000">00017:</font> <b><font color="#0000FF">end</font></b>
|
148
|
+
<font color="#000000">00018:</font>
|
149
|
+
<font color="#000000">00019:</font> <b><font color="#0000FF">if</font></b> <font color="#009900">$0</font> <font color="#990000">==</font> <b><font color="#0000FF">__FILE__</font></b> <font color="#FF0000"><b><1></b></font>
|
150
|
+
<font color="#000000">00020:</font> <i><font color="#9A1900"># Array#cycle test</font></i>
|
151
|
+
<font color="#000000">00021:</font> <i><font color="#9A1900"># true => 0</font></i>
|
152
|
+
<font color="#000000">00022:</font> <i><font color="#9A1900"># false => 1</font></i>
|
153
|
+
<font color="#000000">00023:</font> <i><font color="#9A1900"># true => 2</font></i>
|
154
|
+
<font color="#000000">00024:</font> <i><font color="#9A1900"># false => 3</font></i>
|
155
|
+
<font color="#000000">00025:</font> <i><font color="#9A1900"># true => 4</font></i>
|
156
|
+
<font color="#000000">00026:</font> puts <font color="#FF0000">'Array#cycle test'</font> <font color="#FF0000"><b><2></b></font>
|
157
|
+
<font color="#000000">00027:</font> <font color="#990000">[</font><b><font color="#0000FF">true</font></b><font color="#990000">,</font> <b><font color="#0000FF">false</font></b><font color="#990000">].</font><b><font color="#000000">cycle</font></b><font color="#990000">([</font><font color="#993399">0</font><font color="#990000">,</font> <font color="#993399">1</font><font color="#990000">,</font> <font color="#993399">2</font><font color="#990000">,</font> <font color="#993399">3</font><font color="#990000">,</font> <font color="#993399">4</font><font color="#990000">])</font> <b><font color="#0000FF">do</font></b> <font color="#990000">|</font>a<font color="#990000">,</font> b<font color="#990000">|</font>
|
158
|
+
<font color="#000000">00028:</font> puts <font color="#FF0000">"#{a.inspect} => #{b.inspect}"</font>
|
159
|
+
<font color="#000000">00029:</font> <b><font color="#0000FF">end</font></b>
|
160
|
+
<font color="#000000">00030:</font> <b><font color="#0000FF">end</font></b></tt></pre></td></tr></table>
|
161
|
+
<ol>
|
522
162
|
<li>
|
523
163
|
<p>
|
524
164
|
First callout.
|
@@ -526,29 +166,49 @@ First callout.
|
|
526
166
|
</li>
|
527
167
|
<li>
|
528
168
|
<p>
|
529
|
-
Second
|
169
|
+
Second callout.
|
530
170
|
</p>
|
531
171
|
</li>
|
532
|
-
</ol
|
533
|
-
|
534
|
-
<h2
|
535
|
-
<
|
536
|
-
<
|
172
|
+
</ol>
|
173
|
+
<hr />
|
174
|
+
<h2><a name="_installation"></a>Installation</h2>
|
175
|
+
<h3><a name="_html"></a>HTML</h3>
|
176
|
+
<p>If you want to syntax highlight <em>AsciiDoc</em> HTML outputs (<tt>html4</tt> and
|
177
|
+
<tt>xhtml11</tt> backends) you need to
|
537
178
|
install <a href="http://www.gnu.org/software/src-highlite/">GNU
|
538
|
-
source-highlight</a> (most distributions have this package)
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
<
|
545
|
-
|
546
|
-
|
547
|
-
</
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
179
|
+
source-highlight</a> (most distributions have this package).</p>
|
180
|
+
<h3><a name="_docbook"></a>DocBook</h3>
|
181
|
+
<p><em>AsciiDoc</em> encloses the source code in a DocBook <em>programlisting</em>
|
182
|
+
element and leaves source code highlighting to the DocBook toolchain
|
183
|
+
(dblatex has a particularly nice programlisting highlighter). The
|
184
|
+
DocBook programlisting element is assigned two attributes:</p>
|
185
|
+
<ol type="1">
|
186
|
+
<li>
|
187
|
+
<p>
|
188
|
+
The <em>language</em> attribute is set to the <em>AsciiDoc</em> <em>language</em>
|
189
|
+
attribute.
|
190
|
+
</p>
|
191
|
+
</li>
|
192
|
+
<li>
|
193
|
+
<p>
|
194
|
+
The <em>linenumbering</em> attribute is set to the <em>AsciiDoc</em> <em>src_numbered</em>
|
195
|
+
attribute (<em>numbered</em> or <em>unnumbered</em>).
|
196
|
+
</p>
|
197
|
+
</li>
|
198
|
+
</ol>
|
199
|
+
<p>If you use <tt><tt>a2x(1)</tt></tt> to generate PDF you need to include the
|
200
|
+
<tt>--no-xmllint</tt> option to suppress <tt>xmllint(1)</tt> checking — the
|
201
|
+
programlisting <em>language</em> attribute (required by the dblatex source
|
202
|
+
highlighter) is not part of the DocBook 4 specification (but it is in
|
203
|
+
the newer DocBook 5 specification).</p>
|
204
|
+
<h3><a name="_testing"></a>Testing</h3>
|
205
|
+
<p>Test the filter by converting the test file to HTML with <em>AsciiDoc</em>:</p>
|
206
|
+
<pre>$ asciidoc -v ./filters/source-highlight-filter-test.txt
|
207
|
+
$ firefox ./filters/source-highlight-filter-test.html &</pre>
|
208
|
+
<p></p>
|
209
|
+
<p></p>
|
210
|
+
<hr /><p><small>
|
211
|
+
Last updated 2009-01-01 12:22:58 NZDT
|
212
|
+
</small></p>
|
553
213
|
</body>
|
554
214
|
</html>
|