review 0.9.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/.travis.yml +9 -0
  2. data/ChangeLog +326 -0
  3. data/Rakefile +3 -5
  4. data/VERSION +1 -1
  5. data/bin/review-compile +50 -50
  6. data/bin/review-epubmaker +62 -75
  7. data/bin/review-epubmaker-ng +185 -0
  8. data/bin/review-index +2 -1
  9. data/bin/review-pdfmaker +158 -101
  10. data/bin/review-vol +6 -2
  11. data/doc/format.rdoc +111 -46
  12. data/doc/libepubmaker/sample.yaml +90 -0
  13. data/doc/quickstart.rdoc +188 -0
  14. data/doc/sample.yaml +8 -0
  15. data/lib/epubmaker.rb +28 -0
  16. data/lib/epubmaker/content.rb +82 -0
  17. data/lib/epubmaker/epubv2.rb +419 -0
  18. data/lib/epubmaker/epubv3.rb +249 -0
  19. data/lib/epubmaker/producer.rb +204 -0
  20. data/lib/epubmaker/resource.rb +66 -0
  21. data/lib/review.rb +1 -1
  22. data/lib/review/book.rb +27 -4
  23. data/lib/review/builder.rb +153 -20
  24. data/lib/review/compiler.rb +61 -10
  25. data/lib/review/ewbbuilder.rb +3 -2
  26. data/lib/review/htmlbuilder.rb +174 -67
  27. data/lib/review/i18n.rb +30 -0
  28. data/lib/review/i18n.yaml +23 -0
  29. data/lib/review/idgxmlbuilder.rb +110 -63
  30. data/lib/review/index.rb +34 -12
  31. data/lib/review/latexbuilder.rb +128 -33
  32. data/lib/review/latexutils.rb +18 -1
  33. data/lib/review/textbuilder.rb +17 -0
  34. data/lib/review/tocparser.rb +3 -1
  35. data/lib/review/tocprinter.rb +1 -0
  36. data/lib/review/topbuilder.rb +397 -198
  37. data/review.gemspec +101 -100
  38. data/test/test_book.rb +27 -0
  39. data/test/test_epubmaker.rb +507 -0
  40. data/test/test_helper.rb +8 -0
  41. data/test/test_htmlbuilder.rb +295 -10
  42. data/test/test_i18n.rb +64 -0
  43. data/test/test_idgxmlbuilder.rb +268 -10
  44. data/test/test_latexbuilder.rb +316 -20
  45. data/test/test_preprocessor.rb +23 -0
  46. data/test/test_topbuilder.rb +246 -0
  47. metadata +46 -53
  48. data/doc/format.re +0 -505
  49. data/test/test_index.rb +0 -15
data/.travis.yml ADDED
@@ -0,0 +1,9 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+ - 1.9.3
5
+ - ruby-head
6
+
7
+ branches:
8
+ only:
9
+ - master
data/ChangeLog CHANGED
@@ -1,3 +1,329 @@
1
+ Mon Jan 30 20:39:17 2012 Masayoshi Takahashi <takahashimm@gmail.com>
2
+
3
+ * Version bump to 1.0.0.
4
+
5
+ Sat Jan 28 00:28:34 2012 Kenshi Muto <kmuto@debian.org>
6
+
7
+ * //raw supports to indicate builder(s) by using
8
+ //raw[|builder,builder| ...]
9
+ * merge kdmsnr's branch.
10
+ commit 207c787c961d61bbc517e160effadf417f05e28e
11
+ unescape in inline_raw: refs #54
12
+
13
+ Sun Jan 22 19:49:42 2012 Kenshi Muto <kmuto@debian.org>
14
+
15
+ * revert 17b0deb55b599deb1bdfbd6c61957d6edd5977ed change.
16
+ It caused a bug that '#@#' was included in paragraphs when
17
+ '#@#' was located just after paragraph line.
18
+
19
+ Sat Jan 14 23:24:52 2012 Kenshi Muto <kmuto@debian.org>
20
+
21
+ * lib/review/builder.rb, lib/review/htmlbuilder.rb,
22
+ lib/review/i18n.yaml, lib/review/idgxmlbuilder.rb,
23
+ lib/review/topbuilder.rb: show only counter on
24
+ image/list/table caption, if chapter number is
25
+ undefined.
26
+
27
+ Sat Jan 14 22:33:04 2012 Kenshi Muto <kmuto@debian.org>
28
+
29
+ * lib/review/tocparser.rb: remove BOM (\xEF\xBB\xBF) from
30
+ line head to avoid review-index error. Closes #72.
31
+
32
+ Sat Jan 14 22:02:29 2012 Kenshi Muto <kmuto@debian.org>
33
+
34
+ * lib/review/compiler.rb, lib/review/preprocessor.rb,
35
+ test/test_preprocessor.rb: fix difference of line#
36
+ between error output and source file which has comments.
37
+ Closes #73.
38
+
39
+ Mon Jan 2 01:09:58 2012 Kenshi Muto <kmuto@debian.org>
40
+
41
+ * lib/review/idgxmlbuilder: put <listinfo> to codelist element
42
+ (//list) as same as list (//emlist).
43
+
44
+ Fri Dec 16 01:01:31 2011 Masayoshi Takahashi <takahashimm@gmail.com>
45
+
46
+ * lib/review/latexbuilder.rb: LATEXBuilder: fix dlist(dd) bug
47
+
48
+ Sat Nov 12 18:42:24 2011 Masayoshi Takahashi <takahashimm@gmail.com>
49
+
50
+ * bin/review-pdfmaker:
51
+ LATEXBuilder: appendix and backmatter should be able to redefine
52
+
53
+ Fri Nov 11 02:45:50 2011 Masayoshi Takahashi <takahashimm@gmail.com>
54
+
55
+ * lib/review/latexbuilder.rb:
56
+ LATEXBuilder: use \url instead of \href if label is empty
57
+
58
+ Sat Nov 5 15:37:58 2011 Masayoshi Takahashi <takahashimm@gmail.com>
59
+
60
+ * bin/review-epubmaker, bin/review-pdfmaker:
61
+ fixes #50; make name of files generated in review-{epub|pdf}maker same as source filenames
62
+
63
+ Fri Nov 4 22:39:23 2011 Masayoshi Takahashi <takahashimm@gmail.com>
64
+
65
+ * bin/review-pdfmaker:
66
+ Force to execute platex command 3 times.
67
+ Executing only 2 times, some documents convert into PDF with
68
+ invalid page number :-(
69
+
70
+ Thu Oct 27 16:30:08 2011 Kenshi Muto <kmuto@debian.org>
71
+
72
+ * lib/review/topbuilder.rb: trivial bug fixes around //raw.
73
+
74
+ Sun Oct 9 00:43:51 2011 Masayoshi Takahashi <takahashimm@gmail.com>
75
+
76
+ * lib/review/latexbuilder.rb, lib/review/latexutils.rb:
77
+ LATEXBuilder: fix escape in URL (use special method)
78
+
79
+ Tue Sep 27 21:44:13 2011 Masayoshi Takahashi <takahashimm@gmail.com>
80
+
81
+ * bin/review-epubmaker: default author should be nil
82
+
83
+ Tue Sep 27 21:36:00 2011 Masayoshi Takahashi <takahashimm@gmail.com>
84
+
85
+ * bin/review-epubmaker: fix Issue #43: fix generating invalid EPUB toc.html file
86
+
87
+ Tue Sep 27 18:51:27 2011 Masayoshi Takahashi <takahashimm@gmail.com>
88
+
89
+ * lib/review/book.rb, bin/review-pdfmaker:
90
+ support *.pdf file for images in LATEXBuilder
91
+
92
+ Tue Sep 27 18:19:20 2011 Masayoshi Takahashi <takahashimm@gmail.com>
93
+
94
+ * bin/review-pdfmaker:
95
+ support customizing coverfile in LATEXBuilder (same as HTMLBuilder)
96
+
97
+ Fri Sep 23 22:06:26 2011 Masayoshi Takahashi <takahashimm@gmail.com>
98
+
99
+ * lib/review/latexutils.rb:
100
+ support MARUSUJI(number in circle) 0-10
101
+
102
+ Wed Sep 21 19:51:57 2011 Masayoshi Takahashi <takahashimm@gmail.com>
103
+
104
+ * lib/review/compiler.rb: fix slow regexp (cf. [ruby-list:48379])
105
+
106
+ Thu Sep 15 00:28:05 2011 Kenshi Muto <kmuto@debian.org>
107
+
108
+ * lib/review/builder.rb, lib/review/htmlbuilder.rb,
109
+ lib/review/texbuilder.rb, lib/review/idgxmlbuilder.rb,
110
+ test/test_htmlbuilder.rb, test/test_latexbuilder.rb,
111
+ test/test_idgxmlbuilder.rb: handle metric parameter of
112
+ //image and //indepimage more portable.
113
+ Builder specific parameter can be specified with prefix
114
+ html::, latex::, and idgxml::.
115
+
116
+ Thu Sep 1 13:21:16 2011 Kenshi Muto <kmuto@debian.org>
117
+
118
+ * lib/review/htmlbuilder.rb: support --draft flag.
119
+ add @<comment>. //comment and @<comment> will show in the
120
+ output when --draft flag is specified. Without this flag
121
+ (default), they will be converted to '<!-- -->'.
122
+
123
+ Thu Sep 1 12:39:54 2011 Kenshi Muto <kmuto@debian.org>
124
+
125
+ * lib/review/htmlbuilder.rb: escape html in @<code>.
126
+
127
+ Mon Aug 29 10:59:15 2011 Masayoshi Takahashi <takahashimm@gmail.com>
128
+
129
+ * bin/review-pdfmaker:
130
+ add translater in okuduke and titlepage if values["trl"] has value
131
+ * bin/review-epubmaker:
132
+ add translater in okuduke if values["trl"] has value
133
+
134
+ Fri Aug 26 14:57:35 2011 Masayoshi Takahashi <takahashimm@gmail.com>
135
+
136
+ * bin/review-pdfmaker: fix some style broken in TeXLive 2011
137
+ * bin/review-pdfmaker: use extractbb instead of ebb
138
+
139
+ Sat Aug 13 11:06:17 2011 Masayoshi Takahashi <takahashimm@gmail.com>
140
+
141
+ * bin/review-epubmaker:
142
+ fix Issue #34: generating stylesheet with appropriate filename
143
+
144
+ Sat Aug 11 01:23:00 2011 Masayoshi Takahashi <takahashimm@gmail.com>
145
+
146
+ * test/test_latexbuilder.rb, lib/review/latexbuilder.rb:
147
+ fix //noindent in LATEXBuilder
148
+
149
+ Sat Jul 2 13:34:00 2011 Masayoshi Takahashi <takahashimm@gmail.com>
150
+
151
+ * lib/review/latexbuilder.rb, lib/review/compiler.rb, bin/review-compile:
152
+ support //comment and @<comment> as PDF Annotation in LATEXBuilder
153
+
154
+ Sat Jul 2 11:22:53 2011 Masayoshi Takahashi <takahashimm@gmail.com>
155
+
156
+ * bin/review-epubmaker, lib/review/htmlbuilder.rb:
157
+ fix @<bib> and bib.re support in EPUB
158
+
159
+ Sun Jun 26 22:38:09 2011 KADO Masanori <kdmsnr@gmail.com>
160
+
161
+ * lib/review/builder.rb, lib/review/compiler.rb, lib/review/index.rb,
162
+ lib/review/latexbuilder.rb, lib/review/idgxmlbuilder.rb, lib/review/htmlbuilder.rb:
163
+ support //graph
164
+
165
+ Thu Jun 16 15:59:35 2011 Kenshi Muto <kmuto@debian.org>
166
+
167
+ * lib/review/idgxmlbuilder.rb, test/test_idgxmlbuilder.rb:
168
+ <td> has xyh attribution to point cell location and a number
169
+ of header lines.
170
+
171
+ Wed Jun 1 23:32:06 2011 Kenshi Muto <kmuto@debian.org>
172
+
173
+ * lib/review/idgxmlbuilder.rb: <recipe> uses full
174
+ width blank instead of tab, because tab breaks
175
+ a table element.
176
+
177
+ Wed Jun 1 18:42:52 2011 Masayoshi Takahashi <takahashimm@gmail.com>
178
+
179
+ * support caption as optional in //cmd{..} and
180
+ //emlist{..}.
181
+
182
+ Tue May 24 12:57:37 2011 Kenshi Muto <kmuto@debian.org>
183
+
184
+ * lib/review/idgxmlbuilder.rb: Use <lead> element for
185
+ //lead and //read by default, to avoid nested <p>
186
+ elements.
187
+
188
+ Wed May 11 14:54:50 2011 Kenshi Muto <kmuto@debian.org>
189
+
190
+ * merge Yutaka HARA's branch.
191
+ commit b4cf87a791f7dcca475cec9a5e838cc0da09de3b
192
+ Author: Yutaka HARA <yutaka.hara+github@gmail.com>
193
+ Date: Wed May 11 14:28:41 2011 +0900
194
+
195
+ bin/review-vol: review-vol should accept --directory
196
+
197
+ Mon Apr 25 07:22:39 2011 Kenshi Muto <kmuto@debian.org>
198
+
199
+ * bin/review-compile, lib/review/htmlbuilder.rb:
200
+ add --htmlversion option. This parameter takes the
201
+ HTML version value 4 or 5.
202
+ * bin/review-epubmaker-ng: now works. It gets an ability to
203
+ produce EPUB3 book.
204
+ * lib/epubmaker/epubv3.rb. lib/epubmaker/producer.rb: support
205
+ EPUB3.
206
+ * lib/epubmaker/epubv2.rb: fix indents.
207
+
208
+ Sat Apr 23 12:15:46 2011 Kenshi Muto <kmuto@debian.org>
209
+
210
+ * Cherry-pick from Kouji Takao's branch.
211
+ commit 133c44c61da8b1057a6883e95a9165815f163cb4
212
+ Author: Kouji Takao <kouji@takao7.net>
213
+ Date: Sun Jan 2 20:42:40 2011 +0900
214
+
215
+ display chapter name.
216
+
217
+ commit 35b65a3e13463c54e696c71b6ec92d9c04a036df
218
+ Author: Kouji Takao <kouji@takao7.net>
219
+ Date: Sun Jan 2 20:38:47 2011 +0900
220
+
221
+ supported book configuration in config.rb.
222
+
223
+ commit 0c493c434bda7bc5b58d5927cc8caedb8da5105c
224
+ Author: Kouji Takao <kouji@takao7.net>
225
+ Date: Sun Jan 2 20:37:56 2011 +0900
226
+
227
+ supported comment in CHAPS file.
228
+
229
+ Mon Apr 11 18:41:26 2011 Masayoshi Takahashi <takahashimm@gmail.com>
230
+
231
+ * bin/review-pdfmaker: add texdocumentclass option in config.yml
232
+
233
+ Wed Mar 16 16:09:42 2011 Kenshi Muto <kmuto@debian.org>
234
+
235
+ * Mege nari's branch.
236
+ - use compile_inline() to caption on //bibpaper.
237
+
238
+ Fri Feb 25 22:40:18 2011 Kenshi Muto <kmuto@debian.org>
239
+
240
+ * Merge nari's branch.
241
+ - add maxwidth for latex indepimage.
242
+
243
+ Thu Feb 3 23:29:07 2011 Kenshi Muto <kmuto@debian.org>
244
+
245
+ * lib/review/book.rb, lib/review/index.rb: workaround for
246
+ inline icon file support. (it still exports duplicate ID warning...)
247
+
248
+ Sat Jan 29 23:03:37 2011 Kenshi Muto <kmuto@debian.org>
249
+
250
+ * Merge nari's branch.
251
+ - add @<bib> //bib to latexbuilder.
252
+
253
+ Sat Jan 29 19:00:07 2011 Kenshi Muto <kmuto@debian.org>
254
+
255
+ * lib/epubmaker/epubv2.rb: add dc:publisher value in opf file
256
+ (same value of prt).
257
+
258
+ Wed Jan 12 23:49:05 2011 Kenshi Muto <kmuto@debian.org>
259
+
260
+ * lib/epubmaker/epubv2.rb: fix level handling of mytoc.
261
+
262
+ Mon Dec 20 23:41:04 2010 Kenshi Muto <kmuto@debian.org>
263
+
264
+ * lib/epubmaker/epubv2.rb: fix indent.
265
+ * test/test_epubmaker.rb: initial test codes.
266
+
267
+ Mon Dec 20 00:12:41 2010 Kenshi Muto <kmuto@debian.org>
268
+
269
+ * lib/epubmaker.rb: separate files to content, epubv2, epubv3,
270
+ producer, and resource.
271
+
272
+ Sat Dec 18 10:50:24 2010 Kenshi Muto <kmuto@debian.org>
273
+
274
+ * bin/review-compile, lib/review/htmlbuilder.rb,
275
+ lib/review/idgxmlbuilder.rb: unify block coding styles and regexp
276
+ coding styles.
277
+ * bin/review-compile: accept multiple stylesheets.
278
+ set default values for language and htmlext.
279
+ use YAML file by passing --yaml=YAMLFILE option.
280
+ * lib/review/htmlbuilder.rb: support htmlext and language parameter.
281
+ support multiple stylesheets.
282
+ * lib/epubmaker.rb: new EPUB support library. Not only ReVIEW can
283
+ use this library. This library is experimental.
284
+ * bin/review-epubmaker-ng: experimental alternative implementation
285
+ for review-epubmaker using epubmaker.rb. This tools is under
286
+ construction and may be changed widely.
287
+ * doc/libepubmaker/sample.yaml: sample YAML file for epubmaker.rb
288
+ library.
289
+
290
+ Sat Dec 12 09:30:28 2010 KADO Masanori <kdmsnr@gmail.com>
291
+
292
+ * lib/review/compiler.rb: add [/column] notation
293
+ * test/test_htmlbuilder.rb, test/test_idgxmlbuilder.rb, test/test_latexbuilder.rb: add test for [/column] notation
294
+ * lib/review/tocparser.rb: ignore [/column] notation for review-index
295
+ * doc/format.rdoc: add [/column] notation
296
+
297
+ Sat Dec 11 08:49:48 2010 KADO Masanori <kdmsnr@gmail.com>
298
+
299
+ * bin/review-pdfmaker, lib/review/latexbuilder.rb: add maxwidth
300
+ for latex image
301
+ * bin/review-pdfmaker: include image subdir for ebb
302
+
303
+ Sat Dec 11 02:39:37 2010 Masayoshi Takahashi <takahashimm@gmail.com>
304
+
305
+ * lib/review/htmlbuilder.rb: remove empty line after <pre> tag
306
+
307
+ Thu Dec 9 11:15:11 2010 Masayoshi Takahashi <takahashimm@gmail.com>
308
+
309
+ * lib/review/compiler.rb: fix slow regexp for compiling inline
310
+ (ex. '@<href>{http://very.long.name/and/missing/close/curly/brace')
311
+
312
+ Sat Dec 4 00:18:45 2010 Kenshi Muto <kmuto@debian.org>
313
+
314
+ * doc/quickstart.rdoc: created.
315
+ * lib/review/textbuilder.rb: provide a wrapper of topbuilder.rb.
316
+ 'review-compile --target text' (or review2text) makes a plain
317
+ text file with pseudo tags.
318
+
319
+ Thu Dec 2 08:23:14 2010 Kenshi Muto <kmuto@debian.org>
320
+
321
+ * lib/review/compiler.rb, lib/review/htmlbuilder.rb,
322
+ lib/review/latexbuilder.rb: move core tag @<icon> to
323
+ compiler.rb.
324
+ * lib/review/topbuilder.rb, test/test_topbuilder.rb: supports
325
+ same tags with other builders.
326
+
1
327
  Wed Dec 1 16:41:40 2010 Masayoshi Takahashi <takahashimm@gmail.com>
2
328
 
3
329
  * VERSION: Version bump to 0.9.0
data/Rakefile CHANGED
@@ -21,14 +21,12 @@ rescue LoadError
21
21
  end
22
22
 
23
23
 
24
- task :test => :check_dependencies
25
-
26
24
  task :default => [:test]
27
25
 
28
26
  Rake::TestTask.new("test") do |t|
29
- t.libs << "test"
30
- t.pattern = "test/test_*.rb"
31
- t.verbose = true
27
+ t.libs << "test"
28
+ t.pattern = "test/test_*.rb"
29
+ t.verbose = true
32
30
  end
33
31
 
34
32
  begin
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.0
1
+ 1.0.0
data/bin/review-compile CHANGED
@@ -15,6 +15,7 @@ require 'pathname'
15
15
  bindir = Pathname.new(__FILE__).realpath.dirname
16
16
  $LOAD_PATH.unshift((bindir + '../lib').realpath)
17
17
 
18
+ require 'review'
18
19
  require 'review/compiler'
19
20
  require 'review/book'
20
21
  require 'fileutils'
@@ -48,70 +49,62 @@ def _main
48
49
  "inencoding" => "UTF-8",
49
50
  "outencoding" => "UTF-8",
50
51
  "subdirmode" => nil,
51
- "stylesheet" => nil, # for HTML
52
+ "singledirmode" => nil,
53
+ "stylesheet" => [], # for HTML
52
54
  "mathml" => nil, # for HTML
55
+ "language" => "ja", # for HTML
53
56
  "deprecated-blocklines" => nil,
57
+ "footnotetext" => false,
58
+ "htmlext" => "html",
59
+ "htmlversion" => 4,
54
60
  }
55
61
 
56
62
  parser = OptionParser.new
57
63
  parser.banner = "Usage: #{File.basename($0)} [--target=FMT]"
58
- parser.on('--inencoding=ENCODING', 'Set input encoding. (UTF-8, EUC, JIS, and SJIS)') {|enc|
59
- param["inencoding"] = enc
60
- }
61
- parser.on('--outencoding=ENCODING', 'Set output encoding. (UTF-8[default], EUC, JIS, and SJIS)') {|enc|
62
- param["outencoding"] = enc
63
- }
64
- parser.on('-c', '--check', 'Check manuscript') {
65
- check_only = true
66
- }
67
- parser.on('--level=LVL', 'Section level to append number.') {|lvl|
68
- param["secnolevel"] = lvl.to_i
69
- }
70
- parser.on('--nolfinxml', 'Do not insert LF in XML. (idgxml)') {
71
- param["nolf"] = true
72
- }
73
- parser.on('--table=WIDTH', 'Default table width. (idgxml)') {|tbl|
74
- param["tableopt"] = tbl
75
- }
76
- parser.on('--listinfo', 'Append listinfo tag to lists to indicate begin/end. (idgxml)') {
77
- param["listinfo"] = true
78
- }
79
- parser.on('--chapref="before,middle,after"', 'Chapref decoration.') {|cdec|
80
- param["chapref"] = cdec
81
- }
82
- parser.on('--subdirmode', 'Use chapter/id.ext path style to find images.') {
83
- param["subdirmode"] = true
84
- }
85
- parser.on('--stylesheet=file', 'Stylesheet file for HTML') {|file|
86
- param["stylesheet"] = file
87
- }
88
- parser.on('--mathml', 'Use MathML for TeX equation in HTML') {
64
+ parser.on('--yaml=YAML', 'Read configurations from YAML file.') do |yaml|
65
+ require 'yaml'
66
+ param = param.merge(YAML.load_file(yaml))
67
+ end
68
+ parser.on('--inencoding=ENCODING', 'Set input encoding. (UTF-8, EUC, JIS, and SJIS)') {|enc| param["inencoding"] = enc }
69
+ parser.on('--outencoding=ENCODING', 'Set output encoding. (UTF-8[default], EUC, JIS, and SJIS)') {|enc| param["outencoding"] = enc }
70
+ parser.on('-c', '--check', 'Check manuscript') { check_only = true }
71
+ parser.on('--level=LVL', 'Section level to append number.') {|lvl| param["secnolevel"] = lvl.to_i }
72
+ parser.on('--nolfinxml', 'Do not insert LF in XML. (idgxml)') { param["nolf"] = true }
73
+ parser.on('--table=WIDTH', 'Default table width. (idgxml)') {|tbl| param["tableopt"] = tbl }
74
+ parser.on('--listinfo', 'Append listinfo tag to lists to indicate begin/end. (idgxml)') { param["listinfo"] = true }
75
+ parser.on('--chapref="before,middle,after"', 'Chapref decoration.') {|cdec| param["chapref"] = cdec }
76
+ parser.on('--subdirmode', 'Use chapter/id.ext path style to find images.') { param["subdirmode"] = true }
77
+ parser.on('--singledirmode', 'Use id.ext path style to find images.') { param["singledirmode"] = true }
78
+ parser.on('--chapterlink', 'make chapref hyperlink') { param["chapterlink"] = true }
79
+ parser.on('--stylesheet=file', 'Stylesheet file for HTML (comma separated)') {|files| param["stylesheet"] = files.split(/\s*,\s*/) }
80
+ parser.on('--mathml', 'Use MathML for TeX equation in HTML') do
89
81
  param["mathml"] = true
90
82
  require 'math_ml'
91
- }
92
- parser.on('--hdnumberingmode', 'Output numbering headlines. (deprecated)') {
93
- param["hdnumberingmode"] = true
94
- }
95
- parser.on('--deprecated-blocklines', 'Disable paragrahs in block tags. Treat physical line as a paragraph. (deprecated)') {
96
- param["deprecated-blocklines"] = true
97
- }
98
- unless target
99
- parser.on('--target=FMT', 'Target format.') {|fmt|
100
- target = fmt
101
- }
102
83
  end
103
- parser.on('-a', '--all', 'Compile all chapters.') {
84
+ parser.on('--htmlversion=VERSION', 'HTML version.') do |v|
85
+ v = v.to_i
86
+ param["htmlversion"] = v if v == 4 || v == 5
87
+ end
88
+ parser.on('--hdnumberingmode', 'Output numbering headlines. (deprecated)') { param["hdnumberingmode"] = true }
89
+ parser.on('--deprecated-blocklines', 'Disable paragrahs in block tags. Treat physical line as a paragraph. (deprecated)') { param["deprecated-blocklines"] = true }
90
+ parser.on('--target=FMT', 'Target format.') {|fmt| target = fmt } unless target
91
+ parser.on('--footnotetext',
92
+ 'Use footnotetext and footnotemark instead of footnote (latex)') {
93
+ param["footnotetext"] = true
94
+ }
95
+ parser.on('--draft', 'use draft mode(inline comment)') { param["draft"] = true }
96
+ parser.on('-a', '--all', 'Compile all chapters.') do
104
97
  mode = :dir
105
98
  basedir = nil
106
- }
107
- parser.on('--directory=DIR', 'Compile all chapters in DIR.') {|path|
99
+ end
100
+ parser.on('--directory=DIR', 'Compile all chapters in DIR.') do |path|
108
101
  mode = :dir
109
102
  basedir = path
110
- }
111
- parser.on('--help', 'Prints this message and quit.') {
103
+ end
104
+ parser.on('--help', 'Prints this message and quit.') do
112
105
  puts parser.help
113
106
  exit 0
114
- }
107
+ end
115
108
  begin
116
109
  parser.parse!
117
110
  unless target
@@ -127,6 +120,13 @@ def _main
127
120
  exit 1
128
121
  end
129
122
 
123
+ # array parameter
124
+ ["stylesheet"].each do |k|
125
+ if param["k"].instance_of?(String)
126
+ param["k"] = [param["k"]]
127
+ end
128
+ end
129
+
130
130
  begin
131
131
  compiler = ReVIEW::Compiler.new(load_strategy_class(target, check_only))
132
132
  ReVIEW.book.param = param
@@ -138,7 +138,7 @@ def _main
138
138
  end
139
139
  ReVIEW::Chapter.intern_pathes(ARGV).each do |chap|
140
140
  result = compiler.compile(chap)
141
- print result unless check_only
141
+ puts result unless check_only
142
142
  end
143
143
  when :dir
144
144
  book = basedir ? ReVIEW::Book.load(basedir) : ReVIEW.book