ulmul 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. data/README-en +118 -63
  2. data/README-ja +92 -58
  3. data/Rakefile +26 -10
  4. data/bin/ulmul2html5 +7 -58
  5. data/bin/ulmul2latex +34 -0
  6. data/bin/ulmul2xhtml +6 -58
  7. data/google-code-prettify/CHANGES.html +130 -0
  8. data/google-code-prettify/COPYING +202 -0
  9. data/google-code-prettify/README-zh-Hans.html +143 -0
  10. data/google-code-prettify/README.html +203 -0
  11. data/google-code-prettify/src/lang-apollo.js +51 -0
  12. data/google-code-prettify/src/lang-css.js +78 -0
  13. data/google-code-prettify/src/lang-fortran.js +53 -0
  14. data/google-code-prettify/src/lang-hs.js +101 -0
  15. data/google-code-prettify/src/lang-lisp.js +93 -0
  16. data/google-code-prettify/src/lang-lua.js +59 -0
  17. data/google-code-prettify/src/lang-ml.js +56 -0
  18. data/google-code-prettify/src/lang-proto.js +35 -0
  19. data/google-code-prettify/src/lang-scala.js +54 -0
  20. data/google-code-prettify/src/lang-sql.js +57 -0
  21. data/google-code-prettify/src/lang-vb.js +61 -0
  22. data/google-code-prettify/src/lang-vhdl.js +34 -0
  23. data/google-code-prettify/src/lang-wiki.js +53 -0
  24. data/google-code-prettify/src/lang-yaml.js +27 -0
  25. data/google-code-prettify/src/prettify.css +44 -0
  26. data/google-code-prettify/src/prettify.js +1508 -0
  27. data/google-code-prettify/tests/large_input_test.html +122 -0
  28. data/google-code-prettify/tests/prettify_test.html +2772 -0
  29. data/google-code-prettify/tests/test_base.js +132 -0
  30. data/google-code-prettify/tests/test_styles.css +5 -0
  31. data/hello.c +7 -0
  32. data/index.en.html +221 -120
  33. data/index.ja.html +182 -115
  34. data/lib/ulmul.rb +477 -276
  35. data/test/unit/ulmul_test.rb +21 -0
  36. data/ulmul-slidy.css +21 -8
  37. data/ulmul.gemspec +9 -5
  38. data/ulmul2html5.css +19 -5
  39. data/ulmul2xhtml.css +17 -1
  40. metadata +90 -12
  41. data/tests/ulmul_test.rb +0 -14
@@ -0,0 +1,132 @@
1
+ // get accurate timing.
2
+ // This file must be loaded after prettify.js for this to work.
3
+ PR_SHOULD_USE_CONTINUATION = false;
4
+ var realIsIE6 = _pr_isIE6();
5
+ if (!/\btestcopypaste\b/.test(location.fragment)) {
6
+ _pr_isIE6 = function() { return false; }; // Ensure consistent output.
7
+ }
8
+
9
+ /**
10
+ * @param golden a mapping from IDs of prettyprinted chunks to an abbreviated
11
+ * form of the expected output. See "var goldens" in prettify_test.html
12
+ * for an example.
13
+ */
14
+ function go(goldens) {
15
+ startClock();
16
+ prettyPrint(function () { stopClock(); runTests(goldens); });
17
+ }
18
+
19
+ function runTests(goldens) {
20
+ /** number of characters in common at the end up to max. */
21
+ function commonPrefix(a, b) {
22
+ var n = Math.min(a.length, b.length);
23
+ var i;
24
+ for (i = 0; i < n; ++i) {
25
+ if (a.charAt(i) !== b.charAt(i)) { break; }
26
+ }
27
+ return i;
28
+ }
29
+
30
+ /** number of characters in common at the end up to max. */
31
+ function commonSuffix(a, b, max) {
32
+ var n = Math.min(a.length - max, b.length - max);
33
+ var i;
34
+ for (i = 0; i < n; ++i) {
35
+ if (a.charAt(a.length - i - 1) !== b.charAt(b.length - i - 1)) { break; }
36
+ }
37
+ return i;
38
+ }
39
+
40
+ /** convert a plain text string to html by escaping html special chars. */
41
+ function html(plainText) {
42
+ return plainText.replace(/\046/g, '&amp;')
43
+ .replace(/\074/g, '&lt;')
44
+ .replace(/\076/g, '&gt;')
45
+ .replace(/\042/g, '&quot;')
46
+ .replace(/\xa0/g, '&nbsp;');
47
+ }
48
+
49
+ /**
50
+ * get normalized markup. innerHTML varies enough across browsers that we
51
+ * can't use it.
52
+ */
53
+ function normalizedInnerHtml(node) {
54
+ var out = [];
55
+ for (var child = node.firstChild; child; child = child.nextSibling) {
56
+ PR_normalizedHtml(child, out, true);
57
+ }
58
+ out = out.join('');
59
+ // more normalization to work around problems with non-ascii chars in
60
+ // regexps in Safari
61
+ for (var i = 0; (i = out.indexOf('\xa0')) >= 0;) {
62
+ out = out.substring(0, i) + '&nbsp;' + out.substring(i + 1);
63
+ }
64
+ return out;
65
+ }
66
+
67
+ var htmlOut = [];
68
+ var failures = 0;
69
+ document.getElementById('errorReport').innerHTML =
70
+ '<h1>Running tests&hellip;<\/h1>';
71
+ htmlOut.push('<h1>Test results<\/h1>');
72
+ for (var lang in goldens) {
73
+ var container = document.getElementById(lang);
74
+ if (realIsIE6 && /\bknown_ie6_failure\b/.test(container.className)) {
75
+ continue;
76
+ }
77
+ // Convert abbreviations that start with `.
78
+ var golden = goldens[lang].replace(/`([A-Z]{3})/g, function (_, lbl) {
79
+ return (lbl == 'END'
80
+ ? '<\/span>'
81
+ : '<span class="' + lbl.toLowerCase() + '">');
82
+ })
83
+ // Line numbers
84
+ .replace(/`#(?![0-9])/, '<li class="L0">')
85
+ .replace(/`#([0-9])/g, '</li><li class="L$1">');
86
+ var actual = normalizedInnerHtml(container);
87
+ if (golden !== actual) { // test failed
88
+ // write out
89
+ var pre = commonPrefix(golden, actual);
90
+ var post = commonSuffix(golden, actual, pre);
91
+
92
+ ++failures;
93
+ htmlOut.push(
94
+ '<h2><a href="#' + html(lang) + '">'
95
+ + html(lang) + '<\/a> Failed<\/h2>');
96
+ htmlOut.push(
97
+ '<tt>' + html(golden.substring(0, pre)) +
98
+ '&raquo;<span class="mismatch">' +
99
+ html(golden.substring(pre, golden.length - post)) +
100
+ '<\/span>&laquo;' +
101
+ html(golden.substring(golden.length - post)) +
102
+
103
+ '<br>!==<br>' +
104
+
105
+ html(actual.substring(0, pre)) +
106
+ '&raquo;<span class="mismatch">' +
107
+ html(actual.substring(pre, actual.length - post)) +
108
+ '<\/span>&laquo;' +
109
+ html(actual.substring(actual.length - post)) + '<\/tt>');
110
+ } else {
111
+ htmlOut.push(
112
+ '<h2><a href="#' + html(lang) + '">' + html(lang) + '<\/a> OK<\/h2>');
113
+ }
114
+ }
115
+ var summary = (failures ? (failures + ' test(s) failed') : 'Tests Passed');
116
+ htmlOut.push('<h2>' + summary + '<\/h2>');
117
+ document.title += ' \u2014 ' + summary;
118
+ document.getElementById('errorReport').innerHTML =
119
+ htmlOut.join('').replace(/&lt;br&gt;/g, '&lt;br&gt;\n');
120
+ }
121
+
122
+ var startTime = null;
123
+ function startClock() {
124
+ startTime = (new Date).getTime();
125
+ }
126
+
127
+ function stopClock() {
128
+ var delta = (new Date).getTime() - startTime;
129
+ startTime = null;
130
+ document.getElementById('timing').innerHTML = 'Took ' + delta + ' ms';
131
+ }
132
+
@@ -0,0 +1,5 @@
1
+ /* Used by error reporting code in test_base.js */
2
+ .mismatch { background: #fee; font-weight: bold }
3
+ span.annot { margin:2px 2px 2px 3em; border:1px dotted #88f; background:#eef;
4
+ padding: 0 2px 0 2px }
5
+ .nocode { background: #f8f8f8 }
data/hello.c ADDED
@@ -0,0 +1,7 @@
1
+ /* hello.c */
2
+ #include <stdio.h>
3
+ int main()
4
+ {
5
+ printf("hello, world\n");
6
+ return 0;
7
+ }
data/index.en.html CHANGED
@@ -1,22 +1,22 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
3
- "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
4
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr">
1
+ <!DOCTYPE html>
2
+ <html lang="en">
5
3
  <head>
6
- <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
5
  <title>ULMUL (Ultra Lightweight MarkUp Language)</title>
8
6
  <meta name="author" content="Takeshi Nishimatsu" />
9
- <meta name="copyright" content="Copyright &#169; 2010 Takeshi Nishimatsu" />
10
- <link rel="stylesheet" href="ulmul2xhtml.css" type="text/css" />
7
+ <meta name="copyright" content="Copyright &#169; 2011 Takeshi Nishimatsu" />
8
+ <link rel="stylesheet" href="ulmul2html5.css" type="text/css" />
9
+ <link rel="stylesheet" href="google-code-prettify/src/prettify.css" type="text/css" />
10
+ <script src="google-code-prettify/src/prettify.js" type="text/javascript"></script>
11
11
  <link rel="shortcut icon" href="favicon.ico" />
12
12
  </head>
13
- <body>
13
+ <body onload="prettyPrint()">
14
14
  <div class="slide cover">
15
15
  <h1 id="LABEL-1">ULMUL (Ultra Lightweight MarkUp Language)</h1><div class="navi">[<a href="index.en.html">English</a>/<a href="index.ja.html">Japanese</a>]</div>
16
16
  <p>
17
17
  "ULMUL" is an original Ultra Lightweight MarkUp Language.
18
- ULMUL texts can be converted into HTML5 with "ulmul2html5" command
19
- and into XHTML with "ulmul2xhtml" command.
18
+ ULMUL texts can be converted into HTML5 with "ulmul2html5"
19
+ command and into LaTeX with "ulmul2latex" command.
20
20
  TeX style equations are converted into MathML.
21
21
  ULMUL is written in Ruby.
22
22
  You can also use ulmul.rb as a library.
@@ -25,34 +25,37 @@ You can also use ulmul.rb as a library.
25
25
  Homepage of ULMUL: <a href="http://ulmul.rubyforge.org/">http://ulmul.rubyforge.org/</a>
26
26
  </p>
27
27
  <p>
28
- Download ULMUL from: <a href="http://rubyforge.org/projects/ulmul">http://rubyforge.org/projects/ulmul</a> or <a href="http://rubygems.org/gems/ulmul">http://rubygems.org/gems/ulmul</a>
28
+ Download ULMUL from: <a href="http://rubygems.org/gems/ulmul">http://rubygems.org/gems/ulmul</a> or <a href="http://rubyforge.org/projects/ulmul">http://rubyforge.org/projects/ulmul</a>
29
29
  </p>
30
- <br />Contents:
30
+ <br />
31
+ <div class="table of contents">
32
+ Table of Contents:
31
33
  <ul>
32
34
  <li><a href="#LABEL-2">Features</a></li>
33
- <li><a href="#LABEL-3">Installation of ULMUL</a>
35
+ <li><a href="#LABEL-3">Installation of ULMUL</a></li>
36
+ <li><a href="#LABEL-4">How to write ULMUL texts</a>
34
37
  <ul>
35
- <li><a href="#LABEL-4">I. Conservative way; use setup.rb</a></li>
36
- <li><a href="#LABEL-5">II. RubyGems users can take an easy way</a></li>
38
+ <li><a href="#LABEL-5">lines</a></li>
39
+ <li><a href="#LABEL-13">Other rules</a></li>
40
+ <li><a href="#LABEL-14">Equations</a></li>
41
+ <li><a href="#LABEL-15">Figures</a></li>
42
+ <li><a href="#LABEL-16">Tables</a></li>
43
+ <li><a href="#LABEL-17">Code</a></li>
37
44
  </ul></li>
38
- <li><a href="#LABEL-6">How to write ULMUL texts</a>
39
- <ul>
40
- <li><a href="#LABEL-7">lines</a></li>
41
- <li><a href="#LABEL-15">Other rules</a></li>
42
- <li><a href="#LABEL-16">Equations</a></li>
43
- <li><a href="#LABEL-17">Figures</a></li>
44
- </ul></li>
45
- <li><a href="#LABEL-18">Usage</a>
45
+ <li><a href="#LABEL-18">Usage of ulmul2html5</a>
46
46
  <ul>
47
47
  <li><a href="#LABEL-19">Examples</a></li>
48
48
  <li><a href="#LABEL-20">Command options</a></li>
49
49
  <li><a href="#LABEL-27">ULMUL and Slidy examples</a></li>
50
+ <li><a href="#LABEL-28">ulmul2xhtml is obsolete</a></li>
50
51
  </ul></li>
51
- <li><a href="#LABEL-28">TODO</a></li>
52
- <li><a href="#LABEL-29">Subversion repository</a></li>
53
- <li><a href="#LABEL-30">Copying</a></li>
54
- <li><a href="#LABEL-31">Author of ULMUL</a></li>
52
+ <li><a href="#LABEL-29">Usage of ulmul2latex</a></li>
53
+ <li><a href="#LABEL-30">TODO</a></li>
54
+ <li><a href="#LABEL-31">Subversion repository</a></li>
55
+ <li><a href="#LABEL-32">Copying</a></li>
56
+ <li><a href="#LABEL-33">Author of ULMUL</a></li>
55
57
  </ul>
58
+ </div>
56
59
 
57
60
  </div>
58
61
 
@@ -61,15 +64,16 @@ Download ULMUL from: <a href="http://rubyforge.org/projects/ulmul">http://rubyfo
61
64
  <h2 id="LABEL-2">Features</h2>
62
65
 
63
66
  <ul>
64
- <li>TeX style equations between two dollar marks ($) and between Eq. and /Eq.
65
- will be converted into MathML. You can use Firefox version 3.x, IE+MathPlayer,
66
- etc. to read MathML.</li>
67
- <li>ulmul2xhtml output is good with the Slidy presentation environment
67
+ <li>TeX style equations between two dollar marks ($) and between \Eq:foo and /Eq:foo
68
+ will be converted into MathML. You can use Firefox4, IE9, etc. to read MathML.</li>
69
+ <li>ulmul2html5 output is good with the Slidy presentation environment
68
70
  <a href="http://www.w3.org/Talks/Tools/Slidy/">http://www.w3.org/Talks/Tools/Slidy/</a> using Firefox+CSS+XHTML+JavaScript.
69
71
  Please use ulmul-slidy.js and ulmul-slidy.css in the package.</li>
72
+ <li>Figures, tables and code can be inserted to the document.
73
+ They can be easily refered in the text.</li>
70
74
  <li>Lines starting from "#" are comments.</li>
71
75
  <li>You can add your conversion rules to @subs_rules.</li>
72
- <li>List of contents will be automatically generated.</li>
76
+ <li>"Table of Contents" will be automatically generated.</li>
73
77
  <li>"= ABC EFGH" will be the document title and the cover page of Slidy.</li>
74
78
  <li>Use utf-8 for ULMUL texts.
75
79
  Specify your natural language with a --language option, e.g. --language=en.</li>
@@ -80,149 +84,220 @@ Download ULMUL from: <a href="http://rubyforge.org/projects/ulmul">http://rubyfo
80
84
  <div class="slide">
81
85
  <h2 id="LABEL-3">Installation of ULMUL</h2>
82
86
  <p>
83
- There are two different ways to install ULMUL.
84
- </p>
85
- <h3 id="LABEL-4">I. Conservative way; use setup.rb</h3>
86
- <p>
87
- ulmul-X.Y.Z.tgz package can be installed as:
88
- </p>
89
- <pre> $ tar zxf ulmul-X.Y.Z.tgz
90
- $ cd ulmul-X.Y.Z
91
- $ su
92
- # ruby setup.rb
93
- </pre>
94
- <p>
95
- Note that the eim_xml and math_ml libraries are required.
96
- </p>
97
- <h3 id="LABEL-5">II. RubyGems users can take an easy way</h3>
98
- <p>
99
- There is an easy way, if you are a RubyGems user:
87
+ Please use gem ( RubyGems <a href="https://rubygems.org/">https://rubygems.org/</a> ) for the installation.
100
88
  </p>
101
- <pre> $ su
102
- # gem install ulmul
89
+ <pre>
90
+ $ sudo gem install ulmul
103
91
  </pre>
104
92
  <p>
105
- If you do not have the eim_xml and math_ml libraries, gem will download and install the
106
- library automatically.
93
+ If you do not have the eim_xml, math_ml, aasm and exifr libraries,
94
+ gem will download and install the libraries automatically.
107
95
  </p>
108
96
  </div>
109
97
 
110
98
 
111
99
  <div class="slide">
112
- <h2 id="LABEL-6">How to write ULMUL texts</h2>
100
+ <h2 id="LABEL-4">How to write ULMUL texts</h2>
113
101
  <p>
114
102
  The encode of input file must be utf-8.
115
103
  </p>
116
- <h3 id="LABEL-7">lines</h3>
117
- <h4 id="LABEL-8">empty</h4>
104
+ <h3 id="LABEL-5">lines</h3>
105
+ <p>
106
+ Inside ulmul.rb, input lines are processed as "events"
107
+ with aasm library <a href="https://rubygems.org/gems/aasm">https://rubygems.org/gems/aasm</a> .
108
+ </p>
109
+ <h4 id="LABEL-6">empty</h4>
118
110
  <p>
119
111
  Empty lines divide paragraphs.
120
112
  </p>
121
- <h4 id="LABEL-9">heading</h4>
113
+ <h4 id="LABEL-7">heading</h4>
122
114
  <p>
123
115
  Starting with "= ", "== ", "=== ", "==== ", "===== ", and "====== ".
124
116
  "= " will be used for the title.
125
117
  </p>
126
- <h4 id="LABEL-10">asterisk</h4>
127
- <p>
128
- Lines starting with
129
- </p>
130
- <pre>" *"
131
- " *"
132
- " *"
133
- " *"
134
- " *"
118
+ <h4 id="LABEL-8">asterisk</h4>
119
+ <p>
120
+ Lines starting with asterisks become itemizing list.
121
+ For example,
122
+ </p>
123
+ <pre>
124
+ # Nesting is allowed uo to 5th level.
125
+ * First
126
+ * Second
127
+ * Third
128
+ * Fourth
129
+ * more for Fourth
130
+ second continue
131
+ * More for third
132
+ * More for first
135
133
  </pre>
136
134
  <p>
137
- become itemize.
135
+ become
138
136
  </p>
139
- <h4 id="LABEL-11">offset</h4>
137
+
138
+ <ul>
139
+ <li>First
140
+ <ul>
141
+ <li>Second
142
+ <ul>
143
+ <li>Third
144
+ <ul>
145
+ <li>Fourth</li>
146
+ <li>more for Fourth</li>
147
+ </ul></li>
148
+ </ul>
149
+ second continue
150
+ <ul>
151
+ <li>More for third</li>
152
+ </ul></li>
153
+ </ul></li>
154
+ <li>More for first</li>
155
+ </ul>
156
+ <h4 id="LABEL-9">offset</h4>
140
157
  <p>
141
158
  Lines starting with some spaces but not asterisks become verbatim lines.
142
159
  </p>
143
- <h4 id="LABEL-12">end</h4>
160
+ <h4 id="LABEL-10">end</h4>
144
161
  <p>
145
162
  EOF or "=end" end the process.
146
163
  </p>
147
- <h4 id="LABEL-13">ignore</h4>
164
+ <h4 id="LABEL-11">ignore</h4>
148
165
  <p>
149
- Lines starting with"#" and "=begin" are ignored.
166
+ Lines starting with "#" and "=begin" are ignored.
150
167
  </p>
151
- <h4 id="LABEL-14">normal</h4>
168
+ <h4 id="LABEL-12">normal</h4>
152
169
  <p>
153
170
  Other lines.
154
171
  </p>
155
- <h3 id="LABEL-15">Other rules</h3>
172
+ <h3 id="LABEL-13">Other rules</h3>
156
173
 
157
174
  <ul>
158
175
  <li>Lines after "=end" are ignored.</li>
159
176
  <li>Add your substitution rules to @subs_rules.</li>
160
177
  </ul>
161
- <h3 id="LABEL-16">Equations</h3>
178
+ <h3 id="LABEL-14">Equations</h3>
162
179
  <p>
163
180
  Input:
164
181
  </p>
165
- <pre>Mass $m$ can be converted into energy $E$ as
166
- Eq. 1
182
+ <pre>
183
+ Mass $m$ can be converted into energy $E$ as
184
+ \Eq:Emc2
167
185
  E=mc^2.
168
- /Eq.
186
+ /Eq:Emc2
169
187
  </pre>
170
188
  <p>
171
189
  Output:
172
190
  </p>
173
191
  <p>
174
- Mass <math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><mi>m</mi></math> can be converted into energy <math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><mi>E</mi></math> as
175
- <math xmlns='http://www.w3.org/1998/Math/MathML' display='block'><mi>E</mi><mo>=</mo><mi>m</mi><msup><mi>c</mi><mn>2</mn></msup><mo>.</mo></math>
192
+ Mass <math display='inline' xmlns='http://www.w3.org/1998/Math/MathML'><mi>m</mi></math> can be converted into energy <math display='inline' xmlns='http://www.w3.org/1998/Math/MathML'><mi>E</mi></math> as
193
+ <math id="Eq:Emc2" display='block' xmlns='http://www.w3.org/1998/Math/MathML'><mi>E</mi><mo>=</mo><mi>m</mi><msup><mi>c</mi><mn>2</mn></msup><mo>.</mo></math>
176
194
  </p>
177
195
  <p>
178
196
  To view the equations in MathML correctly, please use
179
197
  </p>
180
198
 
181
199
  <ul>
182
- <li>Firefox <a href="http://mozilla.jp/firefox/">http://mozilla.jp/firefox/</a></li>
183
- <li>IE8 + MathPlayer <a href="http://www.dessci.com/en/products/mathplayer/">http://www.dessci.com/en/products/mathplayer/</a></li>
200
+ <li>Firefox 4 <a href="http://mozilla.jp/firefox/">http://mozilla.jp/firefox/</a></li>
201
+ <li>IE9</li>
184
202
  <li>etc.</li>
185
203
  </ul>
186
- <h3 id="LABEL-17">Figures</h3>
204
+ <h3 id="LABEL-15">Figures</h3>
205
+ <p>
206
+ Start a Figure environment with "\Fig:foo FILENAME.jpg"
207
+ and terminate it with "/Fig:foo", where "foo" is a tag for the figure.
208
+ You can write a figure caption between them.
209
+ You can refer the figure with "Fig:foo" as <a href="#Fig:ruby">Fig. 1</a>.
210
+ </p>
187
211
  <p>
188
212
  Input:
189
213
  </p>
190
- <pre>Fig. 1 ruby.jpg
214
+ <pre>
215
+ \Fig:ruby ruby.jpg
191
216
  The is a dummy figure for an example.
192
217
  Cute red logo of Ruby, isn't it?
193
- /Fig.
218
+ /Fig:ruby
194
219
  </pre>
195
220
  <p>
196
221
  Output:
197
222
  </p>
198
- <div class="figure">
223
+ <figure id="Fig:ruby">
199
224
  <img src="ruby.jpg" alt="ruby.jpg" />
200
- <div class="figcaption">
201
- The is a dummy figure for an example.
225
+ <figcaption>
226
+ Figure 1: The is a dummy figure for an example.
202
227
  Cute red logo of Ruby, isn't it?
203
- </div>
204
- </div>
205
- </div>
206
-
207
-
208
- <div class="slide">
209
- <h2 id="LABEL-18">Usage</h2>
228
+ </figcaption>
229
+ </figure>
230
+ <h3 id="LABEL-16">Tables</h3>
231
+ <p>
232
+ Table environment is NOT IMPLEMENTED yet.
233
+ Start a Table environment with "\Table:bar"
234
+ and terminate it with "/Table:bar", where "bar" is a tag for the table.
235
+ You can write a figure caption between them.
236
+ You can refer the figure with "Table:bar" as <a href="#Table:diamond">Table 1</a>.
237
+ </p>
210
238
  <p>
211
- There are ulmul2xhtml and ulmul2html5 commands.
239
+ Input:
240
+ </p>
241
+ <pre>
242
+ \Table:diamond
243
+ The is a dummy caption for the table.
244
+ /Table:diamond
245
+ </pre>
246
+ <p>
247
+ Output:
248
+ </p>
249
+ <table id="Table:diamond">
250
+ <caption>
251
+ Table 1: The is a dummy caption for the table.
252
+ </caption>
253
+ <thead><tr><th> TABLE </th></tr></thead>
254
+ <tbody><tr><td>Not yet implemented</td></tr></tbody>
255
+ </table>
256
+ <h3 id="LABEL-17">Code</h3>
257
+ <p>
258
+ Start a Code environment with "\Code:baz FILENAME"
259
+ and terminate it with "/Code:baz", where "baz" is a tag for the code.
260
+ You can write a figure caption between them.
261
+ You can refer the figure with "Code:baz" as <a href="#Code:hello">Code 1</a>.
262
+ Code will be highlighted with
263
+ google-code-prettify <a href="http://code.google.com/p/google-code-prettify/">http://code.google.com/p/google-code-prettify/</a> ,
264
+ when options of -s google-code-prettify/src/prettify.css and
265
+ -j google-code-prettify/src/prettify.js are given.
212
266
  </p>
213
267
  <p>
214
- Use .html extensions even for ulmul2xhtml outputs.
268
+ Input:
215
269
  </p>
270
+ <pre>
271
+ \Code:hello hello.c
272
+ Ordinary hello.c.
273
+ Can you see stdio.h?
274
+ /Code:hello
275
+ </pre>
216
276
  <p>
217
- To view HTML5 documents,
218
- change the setting of the "html5.enable" entry to "true" in "about:config".
219
- See <a href="http://kb.mozillazine.org/About:config">http://kb.mozillazine.org/About:config</a> for details.
277
+ Output:
220
278
  </p>
279
+ <p id="Code:hello" class="code caption">
280
+ Code 1: Ordinary hello.c.
281
+ Can you see stdio.h?
282
+ (download: <a href="hello.c">hello.c</a>)</p>
283
+ <pre class="prettyprint">
284
+ /* hello.c */
285
+ #include &lt;stdio.h&gt;
286
+ int main()
287
+ {
288
+ printf("hello, world\n");
289
+ return 0;
290
+ }
291
+ </pre>
292
+ </div>
293
+
294
+
295
+ <div class="slide">
296
+ <h2 id="LABEL-18">Usage of ulmul2html5</h2>
221
297
  <h3 id="LABEL-19">Examples</h3>
222
- <pre>$ ulmul2xhtml without-equations.txt &gt; without-equations.html # XHTML1.0 Transitional
223
- $ ulmul2xhtml with-equations.txt &gt; with-equations.html # XHTML1.1 + MathML2.0
224
- $ ulmul2xhtml -n 'Takeshi Nishimatsu' -s ulmul-slidy.css -j ulmul-slidy.js presentation.txt &gt; presentation.xhtml
225
- $ ulmul2html5 with-equations.txt &gt; with-equations.html # HTML5
298
+ <pre>
299
+ $ ulmul2html5 foo.txt > foo.html
300
+ $ ulmul2html5 -n 'Takeshi Nishimatsu' -s ulmul-slidy.css -j ulmul-slidy.js presentation.txt > presentation.html
226
301
  </pre>
227
302
  <h3 id="LABEL-20">Command options</h3>
228
303
  <h4 id="LABEL-21">--help</h4>
@@ -245,11 +320,11 @@ Specify JavaScript filename.
245
320
  <p>
246
321
  Specify natural language. Its default is "en".
247
322
  </p>
248
- <h4 id="LABEL-26">-c, --contents-range</h4>
323
+ <h4 id="LABEL-26">-m, --max-table-of-contents</h4>
249
324
  <p>
250
- Range of "Contents". Its default is "2..3".
251
- If you do not need "Contents" at the beginning of the
252
- output HTML file, set it 3..2.
325
+ Maximum depth for the Table of Contents.
326
+ Its default is 3.
327
+ If you do not need the Table of Contents, specify 1.
253
328
  </p>
254
329
  <h3 id="LABEL-27">ULMUL and Slidy examples</h3>
255
330
 
@@ -267,39 +342,59 @@ output HTML file, set it 3..2.
267
342
  <li>Its source is <a href="http://ulmul.rubyforge.org/README-en">http://ulmul.rubyforge.org/README-en</a> (this document)</li>
268
343
  </ul></li>
269
344
  </ul>
345
+ <h3 id="LABEL-28">ulmul2xhtml is obsolete</h3>
346
+ <p>
347
+ ulmul2xhtml will be removed from next version 0.6.x.
348
+ </p>
349
+ </div>
350
+
351
+
352
+ <div class="slide">
353
+ <h2 id="LABEL-29">Usage of ulmul2latex</h2>
354
+ <pre>
355
+ $ ulmul2latex --help
356
+ $ ulmul2latex test.ulmul | tee test.tex
357
+ $ latex test.tex
358
+ $ latex test.tex
359
+ $ dvipdfmx test.dvi
360
+ </pre>
361
+ <p>
362
+ ulmul2latex is still under development. Sorry.
363
+ </p>
270
364
  </div>
271
365
 
272
366
 
273
367
  <div class="slide">
274
- <h2 id="LABEL-28">TODO</h2>
368
+ <h2 id="LABEL-30">TODO</h2>
275
369
 
276
370
  <ul>
277
- <li>rescue syntax errors (raises) in an input file and report the
278
- errors as #{$FILENAME}:#{file.lineno}:...</li>
371
+ <li>More usefull error messages for syntax errors.</li>
279
372
  <li>Unit test, tests/ulmul_test.rb</li>
280
- <li>@body must be XML object, not a String.</li>
281
- <li>Tables.</li>
282
- <li>References to figures, tables and code.</li>
373
+ <li>@body shoud be XML object, not a String.</li>
283
374
  <li>Citation.</li>
284
- <li>Include highlighted code between Code.../Code.</li>
285
375
  </ul>
376
+ <p>
377
+ For more, see TODO file.
378
+ </p>
286
379
  </div>
287
380
 
288
381
 
289
382
  <div class="slide">
290
- <h2 id="LABEL-29">Subversion repository</h2>
383
+ <h2 id="LABEL-31">Subversion repository</h2>
291
384
  <p>
292
- You can checkout the latest source tree of ULMUL anonymously from RubyForge with svn(1) command:
385
+ You can checkout the latest source tree of ULMUL anonymously from RubyForge
386
+ with svn(1) command:
293
387
  </p>
294
- <pre>$ svn co svn://rubyforge.org/var/svn/ulmul/ulmul/trunk ulmul
388
+ <pre>
389
+ $ svn co svn://rubyforge.org/var/svn/ulmul/ulmul/trunk ulmul
295
390
  </pre>
296
391
  </div>
297
392
 
298
393
 
299
394
  <div class="slide">
300
- <h2 id="LABEL-30">Copying</h2>
395
+ <h2 id="LABEL-32">Copying</h2>
301
396
  <p>
302
- Copyright © 2008-2010 by Takeshi Nishimatsu
397
+ Copyright © 2008-2011 by Takeshi Nishimatsu
303
398
  </p>
304
399
  <p>
305
400
  ulmul.rb is distributed in the hope that
@@ -317,11 +412,17 @@ You can download the original package, slidy.zip, from
317
412
  their licenses at <a href="http://www.w3.org/Consortium/Legal/copyright-documents">http://www.w3.org/Consortium/Legal/copyright-documents</a>
318
413
  and <a href="http://www.w3.org/Consortium/Legal/copyright-software">http://www.w3.org/Consortium/Legal/copyright-software</a> .
319
414
  </p>
415
+ <p>
416
+ Google Inc. has copyrights for files under google-code-prettify
417
+ directory. Package prettify-21-Jul-2010.zip is distributed
418
+ from <a href="http://code.google.com/p/google-code-prettify/">http://code.google.com/p/google-code-prettify/</a> under the
419
+ Apache License, Version 2.0.
420
+ </p>
320
421
  </div>
321
422
 
322
423
 
323
424
  <div class="slide">
324
- <h2 id="LABEL-31">Author of ULMUL</h2>
425
+ <h2 id="LABEL-33">Author of ULMUL</h2>
325
426
  <p>
326
427
  Takeshi Nishimatsu (t_nissie{at}yahoo.co.jp) <a href="http://t-nissie.users.sourceforge.net/">http://t-nissie.users.sourceforge.net/</a>
327
428
  </p>