FooBarWidget-mizuho 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +1 -1
- data/Rakefile +14 -2
- data/asciidoc/BUGS +11 -6
- data/asciidoc/BUGS.txt +7 -3
- data/asciidoc/CHANGELOG +313 -151
- data/asciidoc/CHANGELOG.txt +177 -12
- data/asciidoc/INSTALL +30 -36
- data/asciidoc/INSTALL.txt +20 -20
- data/asciidoc/Makefile.in +145 -0
- data/asciidoc/README +11 -11
- data/asciidoc/README.txt +9 -9
- data/asciidoc/a2x +40 -7
- data/asciidoc/asciidoc.conf +180 -126
- data/asciidoc/asciidoc.py +1667 -977
- data/asciidoc/common.aap +2 -2
- data/asciidoc/configure +2840 -0
- data/asciidoc/configure.ac +11 -0
- data/asciidoc/dblatex/asciidoc-dblatex.sty +2 -0
- data/asciidoc/dblatex/asciidoc-dblatex.xsl +15 -0
- data/asciidoc/dblatex/dblatex-readme.txt +19 -2
- data/asciidoc/doc/a2x.1 +77 -67
- data/asciidoc/doc/a2x.1.txt +11 -2
- data/asciidoc/doc/article.css-embedded.html +85 -63
- data/asciidoc/doc/article.html +644 -62
- data/asciidoc/doc/article.pdf +0 -0
- data/asciidoc/doc/article.txt +15 -17
- data/asciidoc/doc/asciidoc.1 +34 -40
- data/asciidoc/doc/asciidoc.1.css-embedded.html +67 -32
- data/asciidoc/doc/asciidoc.1.css.html +28 -28
- data/asciidoc/doc/asciidoc.1.html +33 -33
- data/asciidoc/doc/asciidoc.css-embedded.html +2234 -2348
- data/asciidoc/doc/asciidoc.css.html +2203 -2352
- data/asciidoc/doc/asciidoc.dict +52 -1
- data/asciidoc/doc/asciidoc.html +980 -1160
- data/asciidoc/doc/asciidoc.txt +941 -738
- data/asciidoc/doc/asciimathml.txt +63 -0
- data/asciidoc/doc/book-multi.html +26 -43
- data/asciidoc/doc/book-multi.txt +19 -23
- data/asciidoc/doc/book.css-embedded.html +92 -71
- data/asciidoc/doc/book.html +24 -41
- data/asciidoc/doc/book.txt +19 -21
- data/asciidoc/doc/docbook-xsl.css +1 -0
- data/asciidoc/doc/faq.txt +288 -60
- data/asciidoc/doc/images +1 -0
- data/asciidoc/doc/latex-backend.html +16 -123
- data/asciidoc/doc/latex-backend.txt +17 -19
- data/asciidoc/doc/latexmath.txt +233 -24
- data/asciidoc/doc/latexmathml.txt +41 -0
- data/asciidoc/doc/main.aap +9 -5
- data/asciidoc/doc/music-filter.pdf +0 -0
- data/asciidoc/doc/music-filter.txt +2 -2
- data/asciidoc/doc/source-highlight-filter.html +476 -105
- data/asciidoc/doc/source-highlight-filter.pdf +0 -0
- data/asciidoc/doc/source-highlight-filter.txt +39 -10
- data/asciidoc/docbook-xsl/asciidoc-docbook-xsl.txt +1 -29
- data/asciidoc/docbook-xsl/fo.xsl +35 -3
- data/asciidoc/docbook-xsl/manpage.xsl +3 -0
- data/asciidoc/docbook-xsl/text.xsl +50 -0
- data/asciidoc/docbook.conf +182 -73
- data/asciidoc/examples/website/ASCIIMathML.js +1 -0
- data/asciidoc/examples/website/CHANGELOG.html +618 -182
- data/asciidoc/examples/website/CHANGELOG.txt +1 -0
- data/asciidoc/examples/website/INSTALL.html +34 -36
- data/asciidoc/examples/website/INSTALL.txt +1 -0
- data/asciidoc/examples/website/LaTeXMathML.js +1 -0
- data/asciidoc/examples/website/README-website.html +26 -37
- data/asciidoc/examples/website/README-website.txt +6 -6
- data/asciidoc/examples/website/README.html +15 -15
- data/asciidoc/examples/website/README.txt +1 -0
- data/asciidoc/examples/website/a2x.1.html +74 -50
- data/asciidoc/examples/website/a2x.1.txt +1 -0
- data/asciidoc/examples/website/asciidoc-docbook-xsl.html +13 -48
- data/asciidoc/examples/website/asciidoc-docbook-xsl.txt +1 -0
- data/asciidoc/examples/website/asciimathml.txt +1 -0
- data/asciidoc/examples/website/customers.csv +1 -0
- data/asciidoc/examples/website/downloads.html +69 -31
- data/asciidoc/examples/website/downloads.txt +28 -5
- data/asciidoc/examples/website/faq.html +370 -124
- data/asciidoc/examples/website/faq.txt +1 -0
- data/asciidoc/examples/website/images +1 -0
- data/asciidoc/examples/website/index.html +64 -64
- data/asciidoc/examples/website/index.txt +22 -15
- data/asciidoc/examples/website/latex-backend.html +152 -257
- data/asciidoc/examples/website/latex-backend.txt +1 -0
- data/asciidoc/examples/website/latexmathml.txt +1 -0
- data/asciidoc/examples/website/manpage.html +27 -27
- data/asciidoc/examples/website/manpage.txt +1 -0
- data/asciidoc/examples/website/music-filter.html +18 -18
- data/asciidoc/examples/website/music-filter.txt +1 -0
- data/asciidoc/examples/website/music1.abc +1 -1
- data/asciidoc/examples/website/music1.png +0 -0
- data/asciidoc/examples/website/music2.ly +1 -1
- data/asciidoc/examples/website/music2.png +0 -0
- data/asciidoc/examples/website/newlists.txt +40 -0
- data/asciidoc/examples/website/newtables.txt +397 -0
- data/asciidoc/examples/website/source-highlight-filter.html +67 -32
- data/asciidoc/examples/website/source-highlight-filter.txt +1 -0
- data/asciidoc/examples/website/support.html +4 -4
- data/asciidoc/examples/website/toc.js +1 -0
- data/asciidoc/examples/website/userguide.html +2190 -2339
- data/asciidoc/examples/website/userguide.txt +1 -0
- data/asciidoc/examples/website/version83.txt +37 -0
- data/asciidoc/examples/website/version9.html +13 -13
- data/asciidoc/examples/website/xhtml11-manpage.css +1 -0
- data/asciidoc/examples/website/xhtml11-quirks.css +1 -0
- data/asciidoc/examples/website/xhtml11.css +1 -0
- data/asciidoc/filters/code-filter-readme.txt +3 -3
- data/asciidoc/filters/code-filter-test.txt +6 -6
- data/asciidoc/filters/source-highlight-filter.conf +12 -5
- data/asciidoc/html4.conf +152 -58
- data/asciidoc/install-sh +201 -0
- data/asciidoc/latex.conf +41 -41
- data/asciidoc/stylesheets/docbook-xsl.css +1 -0
- data/asciidoc/stylesheets/xhtml11.css +39 -4
- data/asciidoc/text.conf +4 -4
- data/asciidoc/vim/syntax/asciidoc.vim +58 -32
- data/asciidoc/wordpress.conf +48 -0
- data/asciidoc/xhtml11-quirks.conf +1 -1
- data/asciidoc/xhtml11.conf +198 -70
- data/bin/mizuho +5 -2
- data/lib/mizuho/generator.rb +48 -19
- data/mizuho.gemspec +16 -6
- metadata +58 -15
- data/asciidoc/doc/asciimath.txt +0 -47
- data/asciidoc/docbook-xsl/shaded-literallayout.patch +0 -32
- data/asciidoc/examples/website/asciimath.html +0 -157
- data/asciidoc/examples/website/latexmath.html +0 -119
- data/asciidoc/filters/code-filter-test-c++.txt +0 -7
- data/asciidoc/install.sh +0 -55
- data/asciidoc/linuxdoc.conf +0 -285
- data/asciidoc/math.conf +0 -50
- data/asciidoc/stylesheets/xhtml-deprecated-manpage.css +0 -21
- data/asciidoc/stylesheets/xhtml-deprecated.css +0 -247
- data/asciidoc/t.conf +0 -20
- data/asciidoc/xhtml-deprecated-css.conf +0 -235
- data/asciidoc/xhtml-deprecated.conf +0 -351
@@ -0,0 +1,41 @@
|
|
1
|
+
LaTeXMathML Formulae
|
2
|
+
====================
|
3
|
+
|
4
|
+
http://www.maths.nottingham.ac.uk/personal/drw/lm.html[LaTeXMathML]
|
5
|
+
capability has been added to AsciiDoc for users who are more familar
|
6
|
+
with or prefer LaTeX math formulas to the
|
7
|
+
http://www.methods.co.nz/asciidoc/asciimathml.html[ASCIIMathML]
|
8
|
+
notation.
|
9
|
+
|
10
|
+
'LaTeXMathML' is a derivative of
|
11
|
+
http://www.methods.co.nz/asciidoc/asciimathml.html[ASCIIMathML] -- in
|
12
|
+
terms of usage the only difference it that you use the `latexmath`
|
13
|
+
attribute instead of the `asciimath` attribute.
|
14
|
+
|
15
|
+
'LaTeXMathML' processes LaTeX math formulas not arbitrary LaTeX (as
|
16
|
+
`dblatex(1)` does). See the
|
17
|
+
http://www.maths.nottingham.ac.uk/personal/drw/lm.html[LaTeXMathML]
|
18
|
+
website for details.
|
19
|
+
|
20
|
+
Here's the link:latexmath.txt[AsciiDoc source] that generated this
|
21
|
+
page.
|
22
|
+
|
23
|
+
Some example 'LaTeXMathML' formulas:
|
24
|
+
|
25
|
+
- latexmath:[$R_x = 10.0 \times \sin(R_\phi)$]
|
26
|
+
|
27
|
+
- [,,2]##latexmath:[$\sum_{n=1}^\infty \frac{1}{2^n}$]##
|
28
|
+
|
29
|
+
- latexmath:[$\lim_{x\to\infty} f(x) = k \choose r + \frac ab
|
30
|
+
\sum_{n=1}^\infty a_n + \displaystyle{ \left\{ \frac{1}{13}
|
31
|
+
\sum_{n=1}^\infty b_n \right\} }$]
|
32
|
+
|
33
|
+
- latexmath:[$\$\alpha + \$\beta = \$(\alpha + \beta)$]
|
34
|
+
|
35
|
+
- latexmath:[$\begin{eqnarray} x & = & \frac{-7 \pm
|
36
|
+
\sqrt{49 - 24}}{6} \\ & = & -2 \textrm{ or } -\frac13.
|
37
|
+
\end{eqnarray}$]
|
38
|
+
|
39
|
+
- latexmath:[$\displaystyle{ V_i = C_0 - C_3
|
40
|
+
\frac{C_1\cos(\theta_i+C_3)}{C_4+C_1\cos(\theta_i+C_2)} }$]
|
41
|
+
|
data/asciidoc/doc/main.aap
CHANGED
@@ -60,13 +60,15 @@ OUTFILES = $*(ROOT).html $*(ROOT).css.html $*(ROOT).css-embedded.html \
|
|
60
60
|
${HTMLHELP_FILE}.chm \
|
61
61
|
$CHUNK_DIR/index.html \
|
62
62
|
article.pdf \
|
63
|
+
latexmath.pdf \
|
63
64
|
source-highlight-filter.pdf \
|
64
65
|
music-filter.pdf
|
65
66
|
|
66
67
|
TEST_FILES = $*(ROOT).css-embedded.html
|
67
68
|
article.css-embedded.html book.css-embedded.html \
|
68
69
|
article.xml book.xml book-multi.xml asciidoc.xml asciidoc.1.xml \
|
69
|
-
asciidoc.1.html a2x.1.xml music-filter.xml
|
70
|
+
asciidoc.1.html a2x.1.xml music-filter.xml \
|
71
|
+
../examples/oldtables.xml ../examples/oldtables.html
|
70
72
|
|
71
73
|
|
72
74
|
#####################################################################
|
@@ -168,11 +170,13 @@ TEST_FILES = $*(ROOT).css-embedded.html
|
|
168
170
|
:rule %.fo: %.xml
|
169
171
|
:sys $XSLTPROC --nonet --stringparam admon.textlabel 0 ../docbook-xsl/fo.xsl $source >$target
|
170
172
|
|
171
|
-
# This kludge forces the User Guide
|
172
|
-
# so we include a dblatex example in the distribution.
|
173
|
+
# This kludge forces the User Guide and LaTeX Math PDFs to be generated using
|
174
|
+
# dblatex so we include a dblatex example in the distribution.
|
173
175
|
@if _no.DBLATEX:
|
174
176
|
asciidoc.pdf: asciidoc.xml
|
175
177
|
:sys $DBLATEX -p ../dblatex/asciidoc-dblatex.xsl -s ../dblatex/asciidoc-dblatex.sty -o $target $source
|
178
|
+
latexmath.pdf: latexmath.xml
|
179
|
+
:sys $DBLATEX -p ../dblatex/asciidoc-dblatex.xsl -s ../dblatex/asciidoc-dblatex.sty -o $target $source
|
176
180
|
|
177
181
|
# Force the Source Highlighter PDF to be generated using dblatex
|
178
182
|
# because dblatex has builtin source code highlighting.
|
@@ -260,11 +264,11 @@ book-multi.xml: book-multi.txt
|
|
260
264
|
# Make INSTALL.text and copy to INSTALL.
|
261
265
|
:copy ../INSTALL.text ../INSTALL
|
262
266
|
|
263
|
-
|
267
|
+
asciimathml.html: asciimathml.txt
|
264
268
|
:sys $ASCIIDOC -a asciimath $source
|
265
269
|
# No xmllint(1) checking -- fails on embedded JavaScript.
|
266
270
|
|
267
|
-
|
271
|
+
latexmathml.html: latexmathml.txt
|
268
272
|
:sys $ASCIIDOC -a latexmath $source
|
269
273
|
# No xmllint(1) checking -- fails on embedded JavaScript.
|
270
274
|
|
Binary file
|
@@ -26,7 +26,7 @@ output document.
|
|
26
26
|
This Music Block:
|
27
27
|
|
28
28
|
---------------------------------------------------------------------
|
29
|
-
[music,music1.png]
|
29
|
+
["music","music1.png",scaledwidth="100%"]
|
30
30
|
---------------------------------------------------------------------
|
31
31
|
T:The Butterfly
|
32
32
|
R:slip jig
|
@@ -45,7 +45,7 @@ This Music Block:
|
|
45
45
|
|
46
46
|
Renders:
|
47
47
|
|
48
|
-
[music,music1.png]
|
48
|
+
["music","music1.png",scaledwidth="100%"]
|
49
49
|
---------------------------------------------------------------------
|
50
50
|
T:The Butterfly
|
51
51
|
R:slip jig
|
@@ -1,30 +1,378 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD
|
2
|
-
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
3
4
|
<head>
|
4
|
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
|
5
|
-
<meta name="generator" content="AsciiDoc 8.2.7"
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
6
|
+
<meta name="generator" content="AsciiDoc 8.2.7" />
|
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>
|
6
342
|
<title>Source Code Highlight Filter</title>
|
7
343
|
</head>
|
8
344
|
<body>
|
345
|
+
<div id="header">
|
9
346
|
<h1>Source Code Highlight Filter</h1>
|
10
|
-
|
11
|
-
|
12
|
-
<
|
347
|
+
</div>
|
348
|
+
<div id="preamble">
|
349
|
+
<div class="sectionbody">
|
350
|
+
<div class="para"><p>The <em>AsciiDoc</em> distribution includes a source code syntax highlight
|
13
351
|
filter (<tt>source-highlight-filter.conf</tt>). It uses
|
14
352
|
<a href="http://www.gnu.org/software/src-highlite/">GNU source-highlight</a> to
|
15
353
|
highlight HTML outputs; DocBook outputs are highlighted by toolchains
|
16
354
|
that have <tt>programlisting</tt> element highlight support, for example
|
17
|
-
<em>dblatex</em>.</p>
|
18
|
-
<
|
355
|
+
<em>dblatex</em>.</p></div>
|
356
|
+
<div class="admonitionblock">
|
357
|
+
<table><tr>
|
358
|
+
<td class="icon">
|
359
|
+
<div class="title">Tip</div>
|
360
|
+
</td>
|
361
|
+
<td class="content">If the source <em>language</em> attribute has been set (using an
|
19
362
|
<em>AttributeEntry</em> or from the command-line) you don't have to specify
|
20
|
-
it in each source code block.</
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
<
|
27
|
-
<
|
363
|
+
it in each source code block.</td>
|
364
|
+
</tr></table>
|
365
|
+
</div>
|
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]
|
28
376
|
if n < 0: print 'Hello World!'
|
29
377
|
|
30
378
|
:language: python
|
@@ -34,32 +382,36 @@ if n < 0: print 'Hello World!'
|
|
34
382
|
|
35
383
|
[source,ruby,numbered]
|
36
384
|
[true, false].cycle([0, 1, 2, 3, 4]) do |a, b|
|
37
|
-
puts "#{a.inspect} => #{b.inspect}"</pre>
|
38
|
-
</
|
39
|
-
<p>Render this highlighted source code:</p>
|
40
|
-
|
385
|
+
puts "#{a.inspect} => #{b.inspect}"</tt></pre>
|
386
|
+
</div></div>
|
387
|
+
<div class="para"><p>Render this highlighted source code:</p></div>
|
388
|
+
<div class="exampleblock">
|
389
|
+
<div class="exampleblock-content"><!-- Generator: GNU source-highlight 2.4
|
41
390
|
by Lorenzo Bettini
|
42
391
|
http://www.lorenzobettini.it
|
43
392
|
http://www.gnu.org/software/src-highlite -->
|
44
|
-
<pre><tt><
|
45
|
-
</tt></pre>
|
46
|
-
|
393
|
+
<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">if</span></span> n <span style="color: #990000"><</span> <span style="color: #993399">0</span><span style="color: #990000">:</span> <span style="font-weight: bold"><span style="color: #0000FF">print</span></span> <span style="color: #FF0000">'Hello World!'</span>
|
394
|
+
</tt></pre></div></div>
|
395
|
+
<div class="exampleblock">
|
396
|
+
<div class="exampleblock-content"><!-- Generator: GNU source-highlight 2.4
|
47
397
|
by Lorenzo Bettini
|
48
398
|
http://www.lorenzobettini.it
|
49
399
|
http://www.gnu.org/software/src-highlite -->
|
50
|
-
<pre><tt><
|
51
|
-
</tt></pre>
|
52
|
-
|
400
|
+
<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">if</span></span> n <span style="color: #990000"><</span> <span style="color: #993399">0</span><span style="color: #990000">:</span> <span style="font-weight: bold"><span style="color: #0000FF">print</span></span> <span style="color: #FF0000">'Hello World!'</span>
|
401
|
+
</tt></pre></div></div>
|
402
|
+
<div class="exampleblock">
|
403
|
+
<div class="exampleblock-content"><!-- Generator: GNU source-highlight 2.4
|
53
404
|
by Lorenzo Bettini
|
54
405
|
http://www.lorenzobettini.it
|
55
406
|
http://www.gnu.org/software/src-highlite -->
|
56
|
-
<pre><tt><
|
57
|
-
<
|
58
|
-
</tt></pre>
|
59
|
-
<h3
|
60
|
-
<p>This source-highlight filtered block:</p>
|
61
|
-
<
|
62
|
-
<
|
407
|
+
<pre><tt><span style="color: #000000">00001:</span> <span style="color: #990000">[</span><span style="font-weight: bold"><span style="color: #0000FF">true</span></span><span style="color: #990000">,</span> <span style="font-weight: bold"><span style="color: #0000FF">false</span></span><span style="color: #990000">].</span><span style="font-weight: bold"><span style="color: #000000">cycle</span></span><span style="color: #990000">([</span><span style="color: #993399">0</span><span style="color: #990000">,</span> <span style="color: #993399">1</span><span style="color: #990000">,</span> <span style="color: #993399">2</span><span style="color: #990000">,</span> <span style="color: #993399">3</span><span style="color: #990000">,</span> <span style="color: #993399">4</span><span style="color: #990000">])</span> <span style="font-weight: bold"><span style="color: #0000FF">do</span></span> <span style="color: #990000">|</span>a<span style="color: #990000">,</span> b<span style="color: #990000">|</span>
|
408
|
+
<span style="color: #000000">00002:</span> puts <span style="color: #FF0000">"#{a.inspect} => #{b.inspect}"</span>
|
409
|
+
</tt></pre></div></div>
|
410
|
+
<h3 id="_unnumbered_source_code_listing">Unnumbered source code listing</h3><div style="clear:left"></div>
|
411
|
+
<div class="para"><p>This source-highlight filtered block:</p></div>
|
412
|
+
<div class="listingblock">
|
413
|
+
<div class="content">
|
414
|
+
<pre><tt> [source,python]
|
63
415
|
---------------------------------------------------------------------
|
64
416
|
''' A multi-line
|
65
417
|
comment.'''
|
@@ -70,29 +422,29 @@ http://www.gnu.org/software/src-highlite -->
|
|
70
422
|
return quote + word + quote
|
71
423
|
else:
|
72
424
|
return word
|
73
|
-
---------------------------------------------------------------------</pre>
|
74
|
-
</
|
75
|
-
<p>Renders this highlighted source code:</p>
|
76
|
-
<
|
77
|
-
<
|
425
|
+
---------------------------------------------------------------------</tt></pre>
|
426
|
+
</div></div>
|
427
|
+
<div class="para"><p>Renders this highlighted source code:</p></div>
|
428
|
+
<div class="listingblock">
|
429
|
+
<div class="content"><!-- Generator: GNU source-highlight 2.4
|
78
430
|
by Lorenzo Bettini
|
79
431
|
http://www.lorenzobettini.it
|
80
432
|
http://www.gnu.org/software/src-highlite -->
|
81
|
-
<pre><tt><
|
82
|
-
<
|
83
|
-
<
|
84
|
-
<
|
85
|
-
word <
|
86
|
-
<
|
87
|
-
<
|
88
|
-
<
|
89
|
-
<
|
90
|
-
</tt></pre></
|
91
|
-
</
|
92
|
-
<
|
93
|
-
<
|
94
|
-
<
|
95
|
-
<pre> [source,ruby,numbered]
|
433
|
+
<pre><tt><span style="font-style: italic"><span style="color: #9A1900">''' A multi-line</span></span>
|
434
|
+
<span style="font-style: italic"><span style="color: #9A1900"> comment.'''</span></span>
|
435
|
+
<span style="font-weight: bold"><span style="color: #0000FF">def</span></span> <span style="font-weight: bold"><span style="color: #000000">sub_word</span></span><span style="color: #990000">(</span>mo<span style="color: #990000">):</span>
|
436
|
+
<span style="font-style: italic"><span style="color: #9A1900"> ''' Single line comment.'''</span></span>
|
437
|
+
word <span style="color: #990000">=</span> mo<span style="color: #990000">.</span><span style="font-weight: bold"><span style="color: #000000">group</span></span><span style="color: #990000">(</span><span style="color: #FF0000">'word'</span><span style="color: #990000">)</span> <span style="font-style: italic"><span style="color: #9A1900"># Inline comment</span></span>
|
438
|
+
<span style="font-weight: bold"><span style="color: #0000FF">if</span></span> word <span style="font-weight: bold"><span style="color: #0000FF">in</span></span> keywords<span style="color: #990000">[</span>language<span style="color: #990000">]:</span>
|
439
|
+
<span style="font-weight: bold"><span style="color: #0000FF">return</span></span> quote <span style="color: #990000">+</span> word <span style="color: #990000">+</span> quote
|
440
|
+
<span style="font-weight: bold"><span style="color: #0000FF">else</span></span><span style="color: #990000">:</span>
|
441
|
+
<span style="font-weight: bold"><span style="color: #0000FF">return</span></span> word
|
442
|
+
</tt></pre></div></div>
|
443
|
+
<h3 id="_numbered_source_code_listing_with_callouts">Numbered source code listing with callouts</h3><div style="clear:left"></div>
|
444
|
+
<div class="para"><p>This source-highlight filtered block:</p></div>
|
445
|
+
<div class="listingblock">
|
446
|
+
<div class="content">
|
447
|
+
<pre><tt> [source,ruby,numbered]
|
96
448
|
---------------------------------------------------------------------
|
97
449
|
#
|
98
450
|
# Useful Ruby base class extensions.
|
@@ -112,72 +464,91 @@ http://www.gnu.org/software/src-highlite -->
|
|
112
464
|
|
113
465
|
end
|
114
466
|
|
115
|
-
if $0 == __FILE__
|
467
|
+
if $0 == __FILE__ <1>
|
116
468
|
# Array#cycle test
|
117
469
|
# true => 0
|
118
470
|
# false => 1
|
119
471
|
# true => 2
|
120
472
|
# false => 3
|
121
473
|
# true => 4
|
122
|
-
puts 'Array#cycle test'
|
474
|
+
puts 'Array#cycle test' <2>
|
123
475
|
[true, false].cycle([0, 1, 2, 3, 4]) do |a, b|
|
124
476
|
puts "#{a.inspect} => #{b.inspect}"
|
125
477
|
end
|
126
478
|
end
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
479
|
+
---------------------------------------------------------------------
|
480
|
+
|
481
|
+
<1> First callout.
|
482
|
+
<2> Second call out.</tt></pre>
|
483
|
+
</div></div>
|
484
|
+
<div class="para"><p>Renders this highlighted source code:</p></div>
|
485
|
+
<div class="listingblock">
|
486
|
+
<div class="content"><!-- Generator: GNU source-highlight 2.4
|
132
487
|
by Lorenzo Bettini
|
133
488
|
http://www.lorenzobettini.it
|
134
489
|
http://www.gnu.org/software/src-highlite -->
|
135
|
-
<pre><tt><
|
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
|
-
</tt></pre></
|
166
|
-
|
167
|
-
<
|
168
|
-
<
|
169
|
-
|
490
|
+
<pre><tt><span style="color: #000000">00001:</span> <span style="font-style: italic"><span style="color: #9A1900">#</span></span>
|
491
|
+
<span style="color: #000000">00002:</span> <span style="font-style: italic"><span style="color: #9A1900"># Useful Ruby base class extensions.</span></span>
|
492
|
+
<span style="color: #000000">00003:</span> <span style="font-style: italic"><span style="color: #9A1900">#</span></span>
|
493
|
+
<span style="color: #000000">00004:</span>
|
494
|
+
<span style="color: #000000">00005:</span> <span style="font-weight: bold"><span style="color: #0000FF">class</span></span> Array
|
495
|
+
<span style="color: #000000">00006:</span>
|
496
|
+
<span style="color: #000000">00007:</span> <span style="font-style: italic"><span style="color: #9A1900"># Execute a block passing it corresponding items in</span></span>
|
497
|
+
<span style="color: #000000">00008:</span> <span style="font-style: italic"><span style="color: #9A1900"># +self+ and +other_array+.</span></span>
|
498
|
+
<span style="color: #000000">00009:</span> <span style="font-style: italic"><span style="color: #9A1900"># If self has less items than other_array it is repeated.</span></span>
|
499
|
+
<span style="color: #000000">00010:</span>
|
500
|
+
<span style="color: #000000">00011:</span> <span style="font-weight: bold"><span style="color: #0000FF">def</span></span> <span style="font-weight: bold"><span style="color: #000000">cycle</span></span><span style="color: #990000">(</span>other_array<span style="color: #990000">)</span> <span style="font-style: italic"><span style="color: #9A1900"># :yields: item, other_item</span></span>
|
501
|
+
<span style="color: #000000">00012:</span> other_array<span style="color: #990000">.</span>each_with_index <span style="font-weight: bold"><span style="color: #0000FF">do</span></span> <span style="color: #990000">|</span>item<span style="color: #990000">,</span> index<span style="color: #990000">|</span>
|
502
|
+
<span style="color: #000000">00013:</span> <span style="font-weight: bold"><span style="color: #0000FF">yield</span></span><span style="color: #990000">(</span><span style="font-weight: bold"><span style="color: #0000FF">self</span></span><span style="color: #990000">[</span>index <span style="color: #990000">%</span> <span style="font-weight: bold"><span style="color: #0000FF">self</span></span><span style="color: #990000">.</span>length<span style="color: #990000">],</span> item<span style="color: #990000">)</span>
|
503
|
+
<span style="color: #000000">00014:</span> <span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
|
504
|
+
<span style="color: #000000">00015:</span> <span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
|
505
|
+
<span style="color: #000000">00016:</span>
|
506
|
+
<span style="color: #000000">00017:</span> <span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
|
507
|
+
<span style="color: #000000">00018:</span>
|
508
|
+
<span style="color: #000000">00019:</span> <span style="font-weight: bold"><span style="color: #0000FF">if</span></span> <span style="color: #009900">$0</span> <span style="color: #990000">==</span> <span style="font-weight: bold"><span style="color: #0000FF">__FILE__</span></span> <span style="color: #FF0000"><b><1></b></span>
|
509
|
+
<span style="color: #000000">00020:</span> <span style="font-style: italic"><span style="color: #9A1900"># Array#cycle test</span></span>
|
510
|
+
<span style="color: #000000">00021:</span> <span style="font-style: italic"><span style="color: #9A1900"># true => 0</span></span>
|
511
|
+
<span style="color: #000000">00022:</span> <span style="font-style: italic"><span style="color: #9A1900"># false => 1</span></span>
|
512
|
+
<span style="color: #000000">00023:</span> <span style="font-style: italic"><span style="color: #9A1900"># true => 2</span></span>
|
513
|
+
<span style="color: #000000">00024:</span> <span style="font-style: italic"><span style="color: #9A1900"># false => 3</span></span>
|
514
|
+
<span style="color: #000000">00025:</span> <span style="font-style: italic"><span style="color: #9A1900"># true => 4</span></span>
|
515
|
+
<span style="color: #000000">00026:</span> puts <span style="color: #FF0000">'Array#cycle test'</span> <span style="color: #FF0000"><b><2></b></span>
|
516
|
+
<span style="color: #000000">00027:</span> <span style="color: #990000">[</span><span style="font-weight: bold"><span style="color: #0000FF">true</span></span><span style="color: #990000">,</span> <span style="font-weight: bold"><span style="color: #0000FF">false</span></span><span style="color: #990000">].</span><span style="font-weight: bold"><span style="color: #000000">cycle</span></span><span style="color: #990000">([</span><span style="color: #993399">0</span><span style="color: #990000">,</span> <span style="color: #993399">1</span><span style="color: #990000">,</span> <span style="color: #993399">2</span><span style="color: #990000">,</span> <span style="color: #993399">3</span><span style="color: #990000">,</span> <span style="color: #993399">4</span><span style="color: #990000">])</span> <span style="font-weight: bold"><span style="color: #0000FF">do</span></span> <span style="color: #990000">|</span>a<span style="color: #990000">,</span> b<span style="color: #990000">|</span>
|
517
|
+
<span style="color: #000000">00028:</span> puts <span style="color: #FF0000">"#{a.inspect} => #{b.inspect}"</span>
|
518
|
+
<span style="color: #000000">00029:</span> <span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
|
519
|
+
<span style="color: #000000">00030:</span> <span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
|
520
|
+
</tt></pre></div></div>
|
521
|
+
<div class="colist"><ol>
|
522
|
+
<li>
|
523
|
+
<p>
|
524
|
+
First callout.
|
525
|
+
</p>
|
526
|
+
</li>
|
527
|
+
<li>
|
528
|
+
<p>
|
529
|
+
Second call out.
|
530
|
+
</p>
|
531
|
+
</li>
|
532
|
+
</ol></div>
|
533
|
+
</div>
|
534
|
+
<h2 id="_installation">Installation</h2>
|
535
|
+
<div class="sectionbody">
|
536
|
+
<div class="para"><p>If you want to syntax highlight <em>AsciiDoc</em> HTML outputs you need to
|
170
537
|
install <a href="http://www.gnu.org/software/src-highlite/">GNU
|
171
538
|
source-highlight</a> (most distributions have this package). It's not
|
172
539
|
required if you are generating DocBook output (DocBook syntax
|
173
|
-
highlighting is handled by the DocBook toolchain).</p>
|
174
|
-
<p>Test the filter by converting the test file to HTML with <em>AsciiDoc</em>:</p>
|
175
|
-
<
|
176
|
-
|
177
|
-
<
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
540
|
+
highlighting is handled by the DocBook toolchain).</p></div>
|
541
|
+
<div class="para"><p>Test the filter by converting the test file to HTML with <em>AsciiDoc</em>:</p></div>
|
542
|
+
<div class="literalblock">
|
543
|
+
<div class="content">
|
544
|
+
<pre><tt>$ asciidoc -v ./filters/source-highlight-filter-test.txt
|
545
|
+
$ firefox ./filters/source-highlight-filter-test.html &</tt></pre>
|
546
|
+
</div></div>
|
547
|
+
</div>
|
548
|
+
<div id="footer">
|
549
|
+
<div id="footer-text">
|
550
|
+
Last updated 2008-07-06 13:37:16 NZDT
|
551
|
+
</div>
|
552
|
+
</div>
|
182
553
|
</body>
|
183
554
|
</html>
|