mizuho 0.9.10 → 0.9.11
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +18 -2
- data/asciidoc/BUGS +3 -6
- data/asciidoc/BUGS.txt +0 -3
- data/asciidoc/CHANGELOG +660 -397
- data/asciidoc/CHANGELOG.txt +237 -2
- data/asciidoc/INSTALL +14 -14
- data/asciidoc/MANIFEST +2 -0
- data/asciidoc/Makefile.in +9 -1
- data/asciidoc/README +2 -2
- data/asciidoc/a2x.py +101 -43
- data/asciidoc/asciidoc.conf +18 -11
- data/asciidoc/asciidoc.py +615 -260
- data/asciidoc/common.aap +2 -2
- data/asciidoc/configure +9 -9
- data/asciidoc/configure.ac +1 -1
- data/asciidoc/doc/a2x.1 +34 -4
- data/asciidoc/doc/a2x.1.txt +12 -0
- data/asciidoc/doc/article.pdf +0 -0
- data/asciidoc/doc/asciidoc.1 +73 -29
- data/asciidoc/doc/asciidoc.1.txt +56 -30
- data/asciidoc/doc/asciidoc.dict +23 -2
- data/asciidoc/doc/asciidoc.txt +468 -327
- data/asciidoc/doc/book.epub +0 -0
- data/asciidoc/doc/faq.txt +201 -25
- data/asciidoc/doc/latex-filter.pdf +0 -0
- data/asciidoc/doc/music-filter.pdf +0 -0
- data/asciidoc/doc/publishing-ebooks-with-asciidoc.txt +1 -1
- data/asciidoc/doc/source-highlight-filter.pdf +0 -0
- data/asciidoc/doc/source-highlight-filter.txt +48 -37
- data/asciidoc/docbook45.conf +4 -4
- data/asciidoc/examples/website/ASCIIMathML.js +938 -0
- data/asciidoc/examples/website/CHANGELOG.txt +3056 -0
- data/asciidoc/examples/website/INSTALL.txt +227 -0
- data/asciidoc/examples/website/LaTeXMathML.js +1223 -0
- data/asciidoc/examples/website/README-website.txt +29 -0
- data/asciidoc/examples/website/README.txt +35 -0
- data/asciidoc/examples/website/a2x.1.txt +358 -0
- data/asciidoc/examples/website/asciidoc-docbook-xsl.txt +65 -0
- data/asciidoc/examples/website/asciidoc-graphviz-sample.txt +170 -0
- data/asciidoc/examples/website/asciidoc.css +533 -0
- data/asciidoc/examples/website/asciidoc.js +189 -0
- data/asciidoc/examples/website/asciidocapi.txt +189 -0
- data/asciidoc/examples/website/asciimathml.txt +61 -0
- data/asciidoc/examples/website/build-website.sh +25 -0
- data/asciidoc/examples/website/customers.csv +18 -0
- data/asciidoc/examples/website/epub-notes.txt +210 -0
- data/asciidoc/examples/website/faq.txt +1298 -0
- data/asciidoc/examples/website/index.txt +502 -0
- data/asciidoc/examples/website/latex-backend.txt +192 -0
- data/asciidoc/examples/website/latex-bugs.txt +134 -0
- data/asciidoc/examples/website/latex-filter.txt +196 -0
- data/asciidoc/examples/website/latexmathml.txt +41 -0
- data/asciidoc/examples/website/layout1.conf +153 -0
- data/asciidoc/examples/website/layout1.css +65 -0
- data/asciidoc/examples/website/layout2.conf +153 -0
- data/asciidoc/examples/website/layout2.css +83 -0
- data/asciidoc/examples/website/main.aap +159 -0
- data/asciidoc/examples/website/manpage.txt +197 -0
- data/asciidoc/examples/website/music-filter.txt +148 -0
- data/asciidoc/examples/website/newlists.txt +40 -0
- data/asciidoc/examples/website/newtables.txt +743 -0
- data/asciidoc/examples/website/plugins.txt +91 -0
- data/asciidoc/examples/website/publishing-ebooks-with-asciidoc.txt +398 -0
- data/asciidoc/examples/website/slidy-example.txt +167 -0
- data/asciidoc/examples/website/slidy.txt +113 -0
- data/asciidoc/examples/website/source-highlight-filter.txt +239 -0
- data/asciidoc/examples/website/support.txt +5 -0
- data/asciidoc/examples/website/testasciidoc.txt +231 -0
- data/asciidoc/examples/website/userguide.txt +5991 -0
- data/asciidoc/examples/website/version83.txt +37 -0
- data/asciidoc/examples/website/xhtml11-quirks.css +43 -0
- data/asciidoc/filters/latex/latex2png.py +28 -12
- data/asciidoc/filters/music/music2png.py +22 -6
- data/asciidoc/filters/source/source-highlight-filter.conf +7 -5
- data/asciidoc/help.conf +147 -131
- data/asciidoc/html4.conf +1 -0
- data/asciidoc/html5.conf +37 -39
- data/asciidoc/javascripts/asciidoc.js +3 -3
- data/asciidoc/lang-de.conf +4 -0
- data/asciidoc/lang-es.conf +2 -0
- data/asciidoc/lang-fr.conf +1 -1
- data/asciidoc/lang-hu.conf +2 -0
- data/asciidoc/lang-it.conf +2 -0
- data/asciidoc/lang-nl.conf +5 -0
- data/asciidoc/lang-pt-BR.conf +2 -0
- data/asciidoc/lang-ru.conf +2 -3
- data/asciidoc/latex.conf +2 -2
- data/asciidoc/slidy.conf +4 -2
- data/asciidoc/stylesheets/asciidoc.css +29 -4
- data/asciidoc/stylesheets/docbook-xsl.css +12 -5
- data/asciidoc/stylesheets/toc2.css +1 -0
- data/asciidoc/stylesheets/xhtml11-quirks.css +1 -1
- data/asciidoc/tests/data/lang-de-man-test.txt +21 -0
- data/asciidoc/tests/data/lang-en-man-test.txt +21 -0
- data/asciidoc/tests/data/lang-es-man-test.txt +21 -0
- data/asciidoc/tests/data/lang-fr-man-test.txt +21 -0
- data/asciidoc/tests/data/lang-hu-man-test.txt +21 -0
- data/asciidoc/tests/data/lang-it-man-test.txt +21 -0
- data/asciidoc/tests/data/lang-it-test.txt +106 -0
- data/asciidoc/tests/data/lang-nl-man-test.txt +21 -0
- data/asciidoc/tests/data/lang-pt-BR-man-test.txt +21 -0
- data/asciidoc/tests/data/lang-ru-man-test.txt +21 -0
- data/asciidoc/tests/data/lang-uk-man-test.txt +21 -0
- data/asciidoc/tests/data/testcases.conf +10 -0
- data/asciidoc/tests/data/testcases.txt +40 -0
- data/asciidoc/tests/testasciidoc.conf +143 -17
- data/asciidoc/tests/testasciidoc.py +11 -2
- data/asciidoc/{stylesheets → themes/flask}/flask.css +0 -0
- data/asciidoc/{stylesheets → themes/volnitsky}/volnitsky.css +1 -1
- data/asciidoc/vim/ftdetect/asciidoc_filetype.vim +1 -1
- data/asciidoc/vim/syntax/asciidoc.vim +1 -1
- data/asciidoc/xhtml11-quirks.conf +2 -2
- data/asciidoc/xhtml11.conf +35 -37
- data/lib/mizuho.rb +1 -1
- data/lib/mizuho/generator.rb +3 -1
- data/source-highlight/darwin/source-highlight +0 -0
- data/templates/juvia.js +30 -5
- metadata +58 -9
- data/asciidoc/stylesheets/asciidoc-manpage.css +0 -18
- data/asciidoc/stylesheets/flask-manpage.css +0 -1
- data/asciidoc/stylesheets/volnitsky-manpage.css +0 -1
@@ -0,0 +1,189 @@
|
|
1
|
+
var asciidoc = { // Namespace.
|
2
|
+
|
3
|
+
/////////////////////////////////////////////////////////////////////
|
4
|
+
// Table Of Contents generator
|
5
|
+
/////////////////////////////////////////////////////////////////////
|
6
|
+
|
7
|
+
/* Author: Mihai Bazon, September 2002
|
8
|
+
* http://students.infoiasi.ro/~mishoo
|
9
|
+
*
|
10
|
+
* Table Of Content generator
|
11
|
+
* Version: 0.4
|
12
|
+
*
|
13
|
+
* Feel free to use this script under the terms of the GNU General Public
|
14
|
+
* License, as long as you do not remove or alter this notice.
|
15
|
+
*/
|
16
|
+
|
17
|
+
/* modified by Troy D. Hanson, September 2006. License: GPL */
|
18
|
+
/* modified by Stuart Rackham, 2006, 2009. License: GPL */
|
19
|
+
|
20
|
+
// toclevels = 1..4.
|
21
|
+
toc: function (toclevels) {
|
22
|
+
|
23
|
+
function getText(el) {
|
24
|
+
var text = "";
|
25
|
+
for (var i = el.firstChild; i != null; i = i.nextSibling) {
|
26
|
+
if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
|
27
|
+
text += i.data;
|
28
|
+
else if (i.firstChild != null)
|
29
|
+
text += getText(i);
|
30
|
+
}
|
31
|
+
return text;
|
32
|
+
}
|
33
|
+
|
34
|
+
function TocEntry(el, text, toclevel) {
|
35
|
+
this.element = el;
|
36
|
+
this.text = text;
|
37
|
+
this.toclevel = toclevel;
|
38
|
+
}
|
39
|
+
|
40
|
+
function tocEntries(el, toclevels) {
|
41
|
+
var result = new Array;
|
42
|
+
var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
|
43
|
+
// Function that scans the DOM tree for header elements (the DOM2
|
44
|
+
// nodeIterator API would be a better technique but not supported by all
|
45
|
+
// browsers).
|
46
|
+
var iterate = function (el) {
|
47
|
+
for (var i = el.firstChild; i != null; i = i.nextSibling) {
|
48
|
+
if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
|
49
|
+
var mo = re.exec(i.tagName);
|
50
|
+
if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
|
51
|
+
result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
|
52
|
+
}
|
53
|
+
iterate(i);
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
57
|
+
iterate(el);
|
58
|
+
return result;
|
59
|
+
}
|
60
|
+
|
61
|
+
var toc = document.getElementById("toc");
|
62
|
+
if (!toc) {
|
63
|
+
return;
|
64
|
+
}
|
65
|
+
|
66
|
+
// Delete existing TOC entries in case we're reloading the TOC.
|
67
|
+
var tocEntriesToRemove = [];
|
68
|
+
var i;
|
69
|
+
for (i = 0; i < toc.childNodes.length; i++) {
|
70
|
+
var entry = toc.childNodes[i];
|
71
|
+
if (entry.nodeName.toLowerCase() == 'div'
|
72
|
+
&& entry.getAttribute("class")
|
73
|
+
&& entry.getAttribute("class").match(/^toclevel/))
|
74
|
+
tocEntriesToRemove.push(entry);
|
75
|
+
}
|
76
|
+
for (i = 0; i < tocEntriesToRemove.length; i++) {
|
77
|
+
toc.removeChild(tocEntriesToRemove[i]);
|
78
|
+
}
|
79
|
+
|
80
|
+
// Rebuild TOC entries.
|
81
|
+
var entries = tocEntries(document.getElementById("content"), toclevels);
|
82
|
+
for (var i = 0; i < entries.length; ++i) {
|
83
|
+
var entry = entries[i];
|
84
|
+
if (entry.element.id == "")
|
85
|
+
entry.element.id = "_toc_" + i;
|
86
|
+
var a = document.createElement("a");
|
87
|
+
a.href = "#" + entry.element.id;
|
88
|
+
a.appendChild(document.createTextNode(entry.text));
|
89
|
+
var div = document.createElement("div");
|
90
|
+
div.appendChild(a);
|
91
|
+
div.className = "toclevel" + entry.toclevel;
|
92
|
+
toc.appendChild(div);
|
93
|
+
}
|
94
|
+
if (entries.length == 0)
|
95
|
+
toc.parentNode.removeChild(toc);
|
96
|
+
},
|
97
|
+
|
98
|
+
|
99
|
+
/////////////////////////////////////////////////////////////////////
|
100
|
+
// Footnotes generator
|
101
|
+
/////////////////////////////////////////////////////////////////////
|
102
|
+
|
103
|
+
/* Based on footnote generation code from:
|
104
|
+
* http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
|
105
|
+
*/
|
106
|
+
|
107
|
+
footnotes: function () {
|
108
|
+
// Delete existing footnote entries in case we're reloading the footnodes.
|
109
|
+
var i;
|
110
|
+
var noteholder = document.getElementById("footnotes");
|
111
|
+
if (!noteholder) {
|
112
|
+
return;
|
113
|
+
}
|
114
|
+
var entriesToRemove = [];
|
115
|
+
for (i = 0; i < noteholder.childNodes.length; i++) {
|
116
|
+
var entry = noteholder.childNodes[i];
|
117
|
+
if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
|
118
|
+
entriesToRemove.push(entry);
|
119
|
+
}
|
120
|
+
for (i = 0; i < entriesToRemove.length; i++) {
|
121
|
+
noteholder.removeChild(entriesToRemove[i]);
|
122
|
+
}
|
123
|
+
|
124
|
+
// Rebuild footnote entries.
|
125
|
+
var cont = document.getElementById("content");
|
126
|
+
var spans = cont.getElementsByTagName("span");
|
127
|
+
var refs = {};
|
128
|
+
var n = 0;
|
129
|
+
for (i=0; i<spans.length; i++) {
|
130
|
+
if (spans[i].className == "footnote") {
|
131
|
+
n++;
|
132
|
+
var note = spans[i].getAttribute("data-note");
|
133
|
+
if (!note) {
|
134
|
+
// Use [\s\S] in place of . so multi-line matches work.
|
135
|
+
// Because JavaScript has no s (dotall) regex flag.
|
136
|
+
note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
|
137
|
+
spans[i].innerHTML =
|
138
|
+
"[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
|
139
|
+
"' title='View footnote' class='footnote'>" + n + "</a>]";
|
140
|
+
spans[i].setAttribute("data-note", note);
|
141
|
+
}
|
142
|
+
noteholder.innerHTML +=
|
143
|
+
"<div class='footnote' id='_footnote_" + n + "'>" +
|
144
|
+
"<a href='#_footnoteref_" + n + "' title='Return to text'>" +
|
145
|
+
n + "</a>. " + note + "</div>";
|
146
|
+
var id =spans[i].getAttribute("id");
|
147
|
+
if (id != null) refs["#"+id] = n;
|
148
|
+
}
|
149
|
+
}
|
150
|
+
if (n == 0)
|
151
|
+
noteholder.parentNode.removeChild(noteholder);
|
152
|
+
else {
|
153
|
+
// Process footnoterefs.
|
154
|
+
for (i=0; i<spans.length; i++) {
|
155
|
+
if (spans[i].className == "footnoteref") {
|
156
|
+
var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
|
157
|
+
href = href.match(/#.*/)[0]; // Because IE return full URL.
|
158
|
+
n = refs[href];
|
159
|
+
spans[i].innerHTML =
|
160
|
+
"[<a href='#_footnote_" + n +
|
161
|
+
"' title='View footnote' class='footnote'>" + n + "</a>]";
|
162
|
+
}
|
163
|
+
}
|
164
|
+
}
|
165
|
+
},
|
166
|
+
|
167
|
+
install: function(toclevels) {
|
168
|
+
var timerId;
|
169
|
+
|
170
|
+
function reinstall() {
|
171
|
+
asciidoc.footnotes();
|
172
|
+
if (toclevels) {
|
173
|
+
asciidoc.toc(toclevels);
|
174
|
+
}
|
175
|
+
}
|
176
|
+
|
177
|
+
function reinstallAndRemoveTimer() {
|
178
|
+
clearInterval(timerId);
|
179
|
+
reinstall();
|
180
|
+
}
|
181
|
+
|
182
|
+
timerId = setInterval(reinstall, 500);
|
183
|
+
if (document.addEventListener)
|
184
|
+
document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
|
185
|
+
else
|
186
|
+
window.onload = reinstallAndRemoveTimer;
|
187
|
+
}
|
188
|
+
|
189
|
+
}
|
@@ -0,0 +1,189 @@
|
|
1
|
+
AsciiDoc API
|
2
|
+
============
|
3
|
+
|
4
|
+
'asciidocapi' -- a Python API module for 'AsciiDoc'.
|
5
|
+
|
6
|
+
|
7
|
+
Introduction
|
8
|
+
------------
|
9
|
+
The 'asciidocapi' module implements a Python API for AsciiDoc. It
|
10
|
+
allows you to set `asciidoc(1)` program options, compile an AsciiDoc
|
11
|
+
source file and then interrogate the results. The `asciidocapi.py`
|
12
|
+
module file contains the `AsciiDocAPI` wrapper class for
|
13
|
+
`asciidoc.py`.
|
14
|
+
|
15
|
+
.Benefits
|
16
|
+
- Stable API Shields the user from the undocumented and possibly
|
17
|
+
volatile `asciidoc.py` internals.
|
18
|
+
- Easier to use and more flexible than the alternative of running
|
19
|
+
`asciidoc(1)` as a separate process.
|
20
|
+
- Executes inside your application (better performance than running
|
21
|
+
separate `asciidoc(1)` command processes).
|
22
|
+
|
23
|
+
|
24
|
+
Using asciidocapi
|
25
|
+
-----------------
|
26
|
+
To use the API just drop the `asciidocapi.py` file into your
|
27
|
+
application directory, import it and use the `AsciiDocAPI` class. The
|
28
|
+
only requirement is that a compatible version of 'AsciiDoc' is already
|
29
|
+
installed -- simple, no setuptools to run, no Eggs to install, no
|
30
|
+
non-standard library dependencies.
|
31
|
+
|
32
|
+
You can find `asciidocapi.py` in the AsciiDoc
|
33
|
+
http://www.methods.co.nz/asciidoc/INSTALL.html#X1[distribution
|
34
|
+
archives] (version 8.4.1 or better).
|
35
|
+
|
36
|
+
Once you have `asciidocapi.py` Verify everything is working by running
|
37
|
+
the module doctests:
|
38
|
+
|
39
|
+
python asciidocapi.py
|
40
|
+
|
41
|
+
If there are no messages then all is well.
|
42
|
+
|
43
|
+
The following minimal example compiles `mydoc.txt` to `mydoc.html`:
|
44
|
+
|
45
|
+
[source,python]
|
46
|
+
-------------------------------------------------------------------------------
|
47
|
+
from asciidocapi import AsciiDocAPI
|
48
|
+
asciidoc = AsciiDocAPI()
|
49
|
+
asciidoc.execute('mydoc.txt')
|
50
|
+
-------------------------------------------------------------------------------
|
51
|
+
|
52
|
+
The next interactive example uses file-like objects for input and output:
|
53
|
+
|
54
|
+
-------------------------------------------------------------------------------
|
55
|
+
$ python
|
56
|
+
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
|
57
|
+
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
|
58
|
+
Type "help", "copyright", "credits" or "license" for more information.
|
59
|
+
>>> from asciidocapi import AsciiDocAPI
|
60
|
+
>>> import StringIO
|
61
|
+
>>> infile = StringIO.StringIO('Hello *{author}*')
|
62
|
+
>>> outfile = StringIO.StringIO()
|
63
|
+
>>> asciidoc = AsciiDocAPI()
|
64
|
+
>>> asciidoc.options('--no-header-footer')
|
65
|
+
>>> asciidoc.attributes['author'] = 'Joe Bloggs'
|
66
|
+
>>> asciidoc.execute(infile, outfile, backend='html4')
|
67
|
+
>>> print outfile.getvalue()
|
68
|
+
<p>Hello <strong>Joe Bloggs</strong></p>
|
69
|
+
|
70
|
+
>>>
|
71
|
+
-------------------------------------------------------------------------------
|
72
|
+
|
73
|
+
|
74
|
+
Implementation Rationale
|
75
|
+
------------------------
|
76
|
+
.Leverage existing knowledge
|
77
|
+
The API maps directly onto the `asciidoc(1)` command -- this is
|
78
|
+
deliberate -- if you know the `asciidoc(1)` command learning the API
|
79
|
+
will be trivial. A nice side effect of this goal is that API and
|
80
|
+
command-line modes share the same code -- virtually no `asciidoc(1)`
|
81
|
+
code is specific to API usage.
|
82
|
+
|
83
|
+
.Simplicity
|
84
|
+
Implemented with a single Python module file (`asciidocapi.py`)
|
85
|
+
containing the 'AsciiDocAPI' API class. 'AsciiDocAPI' contains just
|
86
|
+
one method plus a few attributes for processing options and result
|
87
|
+
messages. No external setup tools and no non-standard library
|
88
|
+
dependencies are used or required.
|
89
|
+
|
90
|
+
.Loose coupling
|
91
|
+
The dependency between `asciidocapi.py` and `asciidoc.py` is minimal
|
92
|
+
-- the current `asciidocapi.py` module uses only two attributes and
|
93
|
+
one function from the `asciidoc.py` module.
|
94
|
+
|
95
|
+
.Why isn't the API baked right into the asciidoc.py command script?
|
96
|
+
1. You can't just drop `asciidoc.py` into your application because it
|
97
|
+
requires all the related config files and filters -- complex and
|
98
|
+
unnecessary since all this was already done when you installed
|
99
|
+
AsciiDoc.
|
100
|
+
2. This scheme separates the API from the AsciiDoc application -- the
|
101
|
+
API implementation can be extended or replaced independently of
|
102
|
+
AsciiDoc.
|
103
|
+
|
104
|
+
|
105
|
+
API reference
|
106
|
+
-------------
|
107
|
+
|
108
|
+
[[X2]]
|
109
|
+
Class `AsciiDocAPI(object)`
|
110
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
111
|
+
This is the 'AsciiDoc' API class.
|
112
|
+
|
113
|
+
Instance attributes
|
114
|
+
^^^^^^^^^^^^^^^^^^^
|
115
|
+
`asciidoc`::
|
116
|
+
The imported `asciidoc.py` module.
|
117
|
+
|
118
|
+
`attributes`::
|
119
|
+
A dictionary of AsciiDoc attribute values passed to AsciiDoc.
|
120
|
+
|
121
|
+
- Setting an attribute value to `None` (`name: None`) will undefine
|
122
|
+
(delete) the attribute (this in addition to the `name!` attribute
|
123
|
+
name format that the `asciidoc(1)` command uses).
|
124
|
+
- To simply define an attribute set the attribute value to a blank
|
125
|
+
string (`name: ''`)
|
126
|
+
|
127
|
+
`cmd`::
|
128
|
+
The file path of the `asciidoc.py` script. Set by the `__init__`
|
129
|
+
method.
|
130
|
+
|
131
|
+
`messages`::
|
132
|
+
A chronologically ordered list of message strings generated during
|
133
|
+
AsciiDoc execution (last message at the end of the list).
|
134
|
+
|
135
|
+
`options`::
|
136
|
+
An instance of the <<X1,Options class>>. Contains a list of command
|
137
|
+
options passed to AsciiDoc.
|
138
|
+
|
139
|
+
Instance methods
|
140
|
+
^^^^^^^^^^^^^^^^
|
141
|
+
`__init__(self, asciidoc_py=None)`::
|
142
|
+
Locate and import `asciidoc.py` module and verify API compatibility.
|
143
|
+
Initialize instance attributes. A search for the `asciidoc` module is
|
144
|
+
made in the following order:
|
145
|
+
|
146
|
+
. Use the `ASCIIDOC_PY` environment variable if it is set.
|
147
|
+
. Use the `asciidoc_py` argument if it is set.
|
148
|
+
. Search the environment 'PATH' for `asciidoc.py`, `asciidoc.pyc` and
|
149
|
+
`asciidoc` (in that order).
|
150
|
+
. Finally repeat the previous search in the current working directory.
|
151
|
+
|
152
|
+
`execute(self, infile, outfile=None, backend=None)`::
|
153
|
+
Compile `infile` to `outfile` using `backend` format. `infile` and
|
154
|
+
`outfile` can be file path strings or file-like objects. `backend` is
|
155
|
+
name of 'AsciiDoc' backend (takes same values as `asciidoc(1)` command
|
156
|
+
`--backend` option). If `outfile` or `backend` are `None` then their
|
157
|
+
respective `asciidoc(1)` defaults are used.
|
158
|
+
|
159
|
+
|
160
|
+
[[X1]]
|
161
|
+
Class `Options(object)`
|
162
|
+
~~~~~~~~~~~~~~~~~~~~~~~
|
163
|
+
Stores `asciidoc(1)` command options. You can use any `asciidoc(1)`
|
164
|
+
options with the exception of the `--doctest` and `--filter` options.
|
165
|
+
|
166
|
+
Instance attributes
|
167
|
+
^^^^^^^^^^^^^^^^^^^
|
168
|
+
`values`::
|
169
|
+
The list of `(name,value)` command option tuples.
|
170
|
+
|
171
|
+
Instance methods
|
172
|
+
^^^^^^^^^^^^^^^^
|
173
|
+
`__call__(self, name, value=None)`::
|
174
|
+
A shortcut for the `append` method. Example:
|
175
|
+
|
176
|
+
opts = Options()
|
177
|
+
opts('--verbose')
|
178
|
+
|
179
|
+
`append(self, name, value=None)`::
|
180
|
+
Append `(name,value)` to the options list. Example:
|
181
|
+
|
182
|
+
opts = Options()
|
183
|
+
opts.append('--conf-file', 'blog.conf')
|
184
|
+
|
185
|
+
|
186
|
+
Class `AsciiDocError(Exception)`
|
187
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
188
|
+
Thrown by the <<X2,AsciiDocAPI class>> when an 'AsciiDoc' execution
|
189
|
+
error occurs.
|
@@ -0,0 +1,61 @@
|
|
1
|
+
ASCIIMathML Formulae
|
2
|
+
====================
|
3
|
+
|
4
|
+
http://www1.chapman.edu/~jipsen/mathml/asciimath.html[ASCIIMathML] is
|
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.
|
10
|
+
|
11
|
+
The AsciiDoc `xhtml11` backend supports ASCIIMathML -- it links the
|
12
|
+
ASCIIMathML script and escapes ASCIIMathML delimiters and special
|
13
|
+
characters to yield valid XHTML. To use ASCIIMathML:
|
14
|
+
|
15
|
+
1. Include the `-a asciimath` command-line option when you run
|
16
|
+
`asciidoc(1)`.
|
17
|
+
2. Enclose ASCIIMathML formulas inside math or double-dollar
|
18
|
+
passthroughs or in math passthrough blocks.
|
19
|
+
|
20
|
+
Here's the link:asciimathml.txt[AsciiDoc source] that generated this
|
21
|
+
page.
|
22
|
+
|
23
|
+
.NOTE
|
24
|
+
- When you use the `asciimath:[]` inline macro you need to escape `]`
|
25
|
+
characters in the formulas with a backslash, escaping is unnecessary
|
26
|
+
if you use the double-dollar macro (for examples see the second
|
27
|
+
formula below).
|
28
|
+
- See the
|
29
|
+
http://www1.chapman.edu/~jipsen/mathml/asciimath.html[ASCIIMathML]
|
30
|
+
website for ASCIIMathML documentation and the latest version.
|
31
|
+
- If the formulas don't appear to be correct you probably need to
|
32
|
+
install the correct math fonts (see the
|
33
|
+
http://www1.chapman.edu/~jipsen/mathml/asciimath.html[ASCIIMathML]
|
34
|
+
website for details).
|
35
|
+
- See the link:latexmathml.html[LaTeXMathML page] if you prefer to use
|
36
|
+
LaTeX math formulas.
|
37
|
+
|
38
|
+
A list of example formulas:
|
39
|
+
|
40
|
+
- $$`[[a,b],[c,d]]((n),(k))`$$
|
41
|
+
- asciimath:[x/x={(1,if x!=0),(text{undefined},if x=0):}]
|
42
|
+
- asciimath:[d/dxf(x)=lim_(h->0)(f(x+h)-f(x))/h]
|
43
|
+
- +++`sum_(i=1)\^n i=(n(n+1))/2`$+++ and *bold
|
44
|
+
asciimath:[int_0\^(pi/2) sinx\ dx=1]*
|
45
|
+
- asciimath:[(a,b\]={x in RR : a < x <= b}]
|
46
|
+
- asciimath:[x^2+y_1+z_12^34]
|
47
|
+
|
48
|
+
*********************************************************************
|
49
|
+
The first three terms factor to give
|
50
|
+
asciimath:[(x+b/(2a))^2=(b^2)/(4a^2)-c/a].
|
51
|
+
|
52
|
+
asciimath:[x+b/(2a)=+-sqrt((b^2)/(4a^2)-c/a)].
|
53
|
+
|
54
|
+
Now we take square roots on both sides and get
|
55
|
+
asciimath:[x+b/(2a)=+-sqrt((b^2)/(4a^2)-c/a)].
|
56
|
+
Finally we move the asciimath:[b/(2a)] to the right and simplify to
|
57
|
+
get the two solutions:
|
58
|
+
*asciimath:[x_(1,2)=(-b+-sqrt(b^2-4ac))/(2a)]*.
|
59
|
+
|
60
|
+
*********************************************************************
|
61
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
VERS="8.1.0"
|
4
|
+
DATE="2006-10-22"
|
5
|
+
|
6
|
+
# Leave the desired layout uncommented.
|
7
|
+
#LAYOUT=layout1 # Tables based layout.
|
8
|
+
LAYOUT=layout2 # CSS based layout.
|
9
|
+
|
10
|
+
ASCIIDOC_HTML="python ../../asciidoc.py --backend=xhtml11 --conf-file=${LAYOUT}.conf --attribute icons --attribute iconsdir=./images/icons --attribute=badges --attribute=revision=$VERS --attribute=date=$DATE"
|
11
|
+
|
12
|
+
$ASCIIDOC_HTML -a index-only index.txt
|
13
|
+
$ASCIIDOC_HTML -a toc -a numbered userguide.txt
|
14
|
+
$ASCIIDOC_HTML -d manpage manpage.txt
|
15
|
+
$ASCIIDOC_HTML downloads.txt
|
16
|
+
$ASCIIDOC_HTML latex-backend.txt
|
17
|
+
$ASCIIDOC_HTML README.txt
|
18
|
+
$ASCIIDOC_HTML INSTALL.txt
|
19
|
+
$ASCIIDOC_HTML CHANGELOG.txt
|
20
|
+
$ASCIIDOC_HTML README-website.txt
|
21
|
+
$ASCIIDOC_HTML support.txt
|
22
|
+
$ASCIIDOC_HTML source-highlight-filter.txt
|
23
|
+
$ASCIIDOC_HTML music-filter.txt
|
24
|
+
$ASCIIDOC_HTML a2x.1.txt
|
25
|
+
$ASCIIDOC_HTML asciimath.txt
|