review 2.0.0.beta1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +66 -1
- data/.rubocop_todo.yml +617 -0
- data/.travis.yml +16 -1
- data/ChangeLog +48 -0
- data/Dockerfile +22 -0
- data/Gemfile +0 -1
- data/README.md +97 -0
- data/Rakefile +10 -11
- data/appveyor.yml +9 -0
- data/bin/review +46 -0
- data/bin/review-check +8 -21
- data/bin/review-compile +26 -43
- data/bin/review-index +9 -22
- data/bin/review-init +21 -25
- data/bin/review-preproc +9 -13
- data/bin/review-validate +1 -1
- data/bin/review-vol +3 -17
- data/bin/review-webmaker +15 -0
- data/doc/NEWS.ja.md +534 -0
- data/doc/NEWS.md +538 -0
- data/doc/catalog.ja.md +10 -18
- data/doc/catalog.md +5 -9
- data/doc/config.yml.sample +319 -0
- data/doc/customize_epub.ja.md +42 -0
- data/doc/format.ja.md +320 -288
- data/doc/format.md +277 -170
- data/doc/format_idg.ja.md +82 -175
- data/doc/pdfmaker.ja.md +61 -0
- data/doc/pdfmaker.md +65 -0
- data/doc/quickstart.ja.md +88 -98
- data/doc/quickstart.md +72 -110
- data/doc/sample.css +41 -0
- data/doc/writing_vertical.ja.md +55 -0
- data/doc/writing_vertical.md +5 -0
- data/lib/epubmaker/content.rb +3 -3
- data/lib/epubmaker/epubcommon.rb +173 -145
- data/lib/epubmaker/epubv2.rb +24 -77
- data/lib/epubmaker/epubv3.rb +72 -73
- data/lib/epubmaker/producer.rb +54 -30
- data/lib/lineinput.rb +48 -0
- data/lib/review/book.rb +0 -1
- data/lib/review/book/base.rb +47 -27
- data/lib/review/book/chapter.rb +48 -19
- data/lib/review/book/compilable.rb +10 -14
- data/lib/review/book/index.rb +10 -19
- data/lib/review/book/page_metric.rb +0 -10
- data/lib/review/book/part.rb +17 -3
- data/lib/review/builder.rb +84 -68
- data/lib/review/catalog.rb +5 -1
- data/lib/review/compiler.rb +327 -4657
- data/lib/review/configure.rb +84 -10
- data/lib/review/converter.rb +28 -0
- data/lib/review/epubbuilder.rb +1 -1
- data/lib/review/epubmaker.rb +142 -158
- data/lib/review/ewbbuilder.rb +5 -5
- data/lib/review/exception.rb +1 -1
- data/lib/review/extentions.rb +1 -1
- data/lib/review/extentions/hash.rb +15 -0
- data/lib/review/extentions/string.rb +2 -1
- data/lib/review/htmlbuilder.rb +364 -348
- data/lib/review/htmltoc.rb +44 -0
- data/lib/review/htmlutils.rb +12 -6
- data/lib/review/i18n.rb +78 -6
- data/lib/review/i18n.yml +7 -4
- data/lib/review/idgxmlbuilder.rb +226 -267
- data/lib/review/latexbuilder.rb +281 -274
- data/lib/review/latexutils.rb +56 -49
- data/lib/review/makerhelper.rb +8 -4
- data/lib/review/markdownbuilder.rb +80 -124
- data/lib/review/pdfmaker.rb +197 -138
- data/lib/review/preprocessor.rb +16 -67
- data/lib/review/template.rb +24 -0
- data/lib/review/textbuilder.rb +1 -1
- data/lib/review/textutils.rb +18 -24
- data/lib/review/tocparser.rb +51 -106
- data/lib/review/tocprinter.rb +61 -117
- data/lib/review/topbuilder.rb +119 -126
- data/lib/review/unfold.rb +2 -2
- data/lib/review/version.rb +1 -1
- data/lib/review/webmaker.rb +302 -0
- data/lib/review/webtocprinter.rb +48 -0
- data/lib/review/yamlloader.rb +47 -0
- data/review.gemspec +3 -3
- data/templates/html/layout-html5.html.erb +17 -0
- data/templates/html/layout-xhtml1.html.erb +20 -0
- data/{lib/review → templates/latex}/layout.tex.erb +107 -115
- data/templates/ncx/epubv2.ncx.erb +11 -0
- data/templates/opf/epubv2.opf.erb +21 -0
- data/templates/opf/epubv3.opf.erb +18 -0
- data/templates/web/html/layout-html5.html.erb +56 -0
- data/templates/web/html/layout-xhtml1.html.erb +20 -0
- data/templates/xml/container.xml.erb +6 -0
- data/test/assets/test.xml.erb +3 -0
- data/test/assets/test_template.tex +28 -71
- data/test/assets/test_template_backmatter.tex +1 -9
- data/test/sample-book/src/Rakefile +12 -3
- data/{doc/sample.yml → test/sample-book/src/config-epub2.yml} +92 -147
- data/test/sample-book/src/config.yml +40 -154
- data/test/sample-book/src/style-web.css +45 -0
- data/test/sample-book/src/style.css +23 -1
- data/test/test.re +1 -1
- data/test/test_book.rb +15 -17
- data/test/test_book_chapter.rb +2 -80
- data/test/test_book_part.rb +1 -1
- data/test/test_builder.rb +28 -6
- data/test/test_catalog.rb +17 -0
- data/test/test_compiler.rb +14 -59
- data/test/test_configure.rb +94 -0
- data/test/test_converter.rb +21 -0
- data/test/test_epub3maker.rb +155 -3
- data/test/test_epubmaker.rb +245 -30
- data/test/test_epubmaker_cmd.rb +2 -2
- data/test/test_extentions_hash.rb +60 -0
- data/test/test_helper.rb +4 -47
- data/test/test_htmlbuilder.rb +282 -175
- data/test/test_htmltoc.rb +33 -0
- data/test/test_i18n.rb +134 -70
- data/test/test_idgxmlbuilder.rb +58 -39
- data/test/test_latexbuilder.rb +132 -14
- data/test/test_lineinput.rb +5 -26
- data/test/test_makerhelper.rb +6 -4
- data/test/test_markdownbuilder.rb +23 -5
- data/test/test_pdfmaker.rb +86 -20
- data/test/test_pdfmaker_cmd.rb +1 -3
- data/test/test_review_ext.rb +1 -1
- data/test/test_template.rb +27 -0
- data/test/test_textutils.rb +36 -0
- data/test/test_tocparser.rb +25 -0
- data/test/test_topbuilder.rb +34 -2
- data/test/test_yamlloader.rb +188 -0
- metadata +71 -29
- data/README.rdoc +0 -81
- data/bin/review-epubmaker-legacy +0 -1024
- data/doc/ruby-uuid/README +0 -11
- data/doc/ruby-uuid/README.ja +0 -34
- data/lib/review/compiler/literals_1_8.kpeg +0 -19
- data/lib/review/compiler/literals_1_8.rb +0 -432
- data/lib/review/compiler/literals_1_9.kpeg +0 -22
- data/lib/review/compiler/literals_1_9.rb +0 -435
- data/lib/review/extentions/array.rb +0 -25
- data/lib/review/htmllayout.rb +0 -41
- data/lib/review/inaobuilder.rb +0 -357
- data/lib/review/location.rb +0 -24
- data/lib/review/node.rb +0 -267
- data/lib/review/review.kpeg +0 -724
- data/lib/uuid.rb +0 -312
- data/rubocop-todo.yml +0 -456
- data/test/test_inaobuilder.rb +0 -247
- data/test/test_uuid.rb +0 -157
data/lib/review/topbuilder.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
#
|
3
3
|
# Copyright (c) 2002-2006 Minero Aoki
|
4
|
-
# 2008-
|
4
|
+
# 2008-2016 Minero Aoki, Kenshi Muto
|
5
5
|
#
|
6
6
|
# This program is free software.
|
7
7
|
# You can distribute or modify this program under the terms of
|
@@ -22,21 +22,17 @@ module ReVIEW
|
|
22
22
|
}
|
23
23
|
Compiler.defsingle(:dtp, 1)
|
24
24
|
|
25
|
-
Compiler.
|
26
|
-
Compiler.defblock(:memo, 0..1)
|
27
|
-
Compiler.defblock(:tip, 0..1)
|
28
|
-
Compiler.defblock(:info, 0..1)
|
25
|
+
Compiler.defblock(:insn, 1)
|
29
26
|
Compiler.defblock(:planning, 0..1)
|
30
27
|
Compiler.defblock(:best, 0..1)
|
31
|
-
Compiler.defblock(:important, 0..1)
|
32
28
|
Compiler.defblock(:securty, 0..1)
|
33
|
-
Compiler.defblock(:caution, 0..1)
|
34
|
-
Compiler.defblock(:notice, 0..1)
|
35
29
|
Compiler.defblock(:point, 0..1)
|
36
30
|
Compiler.defblock(:reference, 0)
|
37
31
|
Compiler.defblock(:term, 0)
|
38
32
|
Compiler.defblock(:practice, 0)
|
39
33
|
Compiler.defblock(:expert, 0)
|
34
|
+
Compiler.defblock(:link, 0..1)
|
35
|
+
Compiler.defblock(:shoot, 0..1)
|
40
36
|
|
41
37
|
def pre_paragraph
|
42
38
|
''
|
@@ -55,6 +51,7 @@ module ReVIEW
|
|
55
51
|
@subsection = 0
|
56
52
|
@subsubsection = 0
|
57
53
|
@subsubsubsection = 0
|
54
|
+
@blank_seen = true
|
58
55
|
|
59
56
|
@titles = {
|
60
57
|
"emlist" => "インラインリスト",
|
@@ -71,6 +68,7 @@ module ReVIEW
|
|
71
68
|
"term" => "用語解説",
|
72
69
|
"notice" => "注意",
|
73
70
|
"caution" => "警告",
|
71
|
+
"warning" => "危険",
|
74
72
|
"point" => "ここがポイント",
|
75
73
|
"reference" => "参考",
|
76
74
|
"link" => "リンク",
|
@@ -101,6 +99,28 @@ module ReVIEW
|
|
101
99
|
end
|
102
100
|
private :builder_init_file
|
103
101
|
|
102
|
+
def print(s)
|
103
|
+
@blank_seen = false
|
104
|
+
super
|
105
|
+
end
|
106
|
+
private :print
|
107
|
+
|
108
|
+
def puts(s)
|
109
|
+
@blank_seen = false
|
110
|
+
super
|
111
|
+
end
|
112
|
+
private :puts
|
113
|
+
|
114
|
+
def blank
|
115
|
+
@output.puts unless @blank_seen
|
116
|
+
@blank_seen = true
|
117
|
+
end
|
118
|
+
private :blank
|
119
|
+
|
120
|
+
def result
|
121
|
+
@output.string
|
122
|
+
end
|
123
|
+
|
104
124
|
def warn(msg)
|
105
125
|
$stderr.puts "#{@location.filename}:#{@location.lineno}: warning: #{msg}"
|
106
126
|
end
|
@@ -114,8 +134,8 @@ module ReVIEW
|
|
114
134
|
end
|
115
135
|
|
116
136
|
def headline(level, label, caption)
|
117
|
-
buf = ""
|
118
137
|
prefix = ""
|
138
|
+
blank
|
119
139
|
case level
|
120
140
|
when 1
|
121
141
|
if @chapter.number.to_s =~ /\A\d+\Z/
|
@@ -149,67 +169,62 @@ module ReVIEW
|
|
149
169
|
raise "caption level too deep or unsupported: #{level}"
|
150
170
|
end
|
151
171
|
prefix = "" if (level.to_i > @book.config["secnolevel"])
|
152
|
-
|
153
|
-
buf
|
172
|
+
puts "■H#{level}■#{prefix}#{compile_inline(caption)}"
|
154
173
|
end
|
155
174
|
|
156
175
|
def ul_begin
|
157
|
-
|
176
|
+
blank
|
158
177
|
end
|
159
178
|
|
160
179
|
def ul_item(lines)
|
161
|
-
"●\t#{lines.join}
|
180
|
+
puts "●\t#{lines.join}"
|
162
181
|
end
|
163
182
|
|
164
183
|
def ul_end
|
165
|
-
|
184
|
+
blank
|
166
185
|
end
|
167
186
|
|
168
187
|
def ol_begin
|
188
|
+
blank
|
169
189
|
@olitem = 0
|
170
|
-
"\n"
|
171
190
|
end
|
172
191
|
|
173
192
|
def ol_item(lines, num)
|
174
|
-
"#{num}\t#{lines.join}
|
193
|
+
puts "#{num}\t#{lines.join}"
|
175
194
|
end
|
176
195
|
|
177
196
|
def ol_end
|
197
|
+
blank
|
178
198
|
@olitem = nil
|
179
|
-
"\n"
|
180
199
|
end
|
181
200
|
|
182
201
|
def dl_begin
|
183
|
-
|
202
|
+
blank
|
184
203
|
end
|
185
204
|
|
186
205
|
def dt(line)
|
187
|
-
"★#{line}
|
206
|
+
puts "★#{line}☆"
|
188
207
|
end
|
189
208
|
|
190
209
|
def dd(lines)
|
191
|
-
|
192
|
-
|
193
|
-
buf << "\t#{paragraph.gsub(/\n/, '')}\n"
|
210
|
+
split_paragraph(lines).each do |paragraph|
|
211
|
+
puts "\t#{paragraph.gsub(/\n/, '')}"
|
194
212
|
end
|
195
|
-
buf
|
196
213
|
end
|
197
214
|
|
198
215
|
def dl_end
|
199
|
-
|
216
|
+
blank
|
200
217
|
end
|
201
218
|
|
202
219
|
def paragraph(lines)
|
203
|
-
lines.join
|
220
|
+
puts lines.join
|
204
221
|
end
|
205
222
|
|
206
223
|
def read(lines)
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
buf << "\n"
|
212
|
-
buf
|
224
|
+
puts "◆→開始:#{@titles["lead"]}←◆"
|
225
|
+
puts split_paragraph(lines).join("\n")
|
226
|
+
puts "◆→終了:#{@titles["lead"]}←◆"
|
227
|
+
blank
|
213
228
|
end
|
214
229
|
|
215
230
|
alias_method :lead, :read
|
@@ -221,50 +236,44 @@ module ReVIEW
|
|
221
236
|
else
|
222
237
|
%Q[#{I18n.t("list")}#{I18n.t("format_number", [get_chap(chapter), @chapter.list(id).number])}]
|
223
238
|
end
|
239
|
+
|
224
240
|
end
|
225
241
|
|
226
242
|
def list_header(id, caption, lang)
|
227
|
-
|
228
|
-
|
229
|
-
buf << "◆→開始:#{@titles["list"]}←◆\n"
|
243
|
+
blank
|
244
|
+
puts "◆→開始:#{@titles["list"]}←◆"
|
230
245
|
if get_chap.nil?
|
231
|
-
|
246
|
+
puts %Q[#{I18n.t("list")}#{I18n.t("format_number_without_chapter", [@chapter.list(id).number])}#{I18n.t("caption_prefix_idgxml")}#{compile_inline(caption)}]
|
232
247
|
else
|
233
|
-
|
248
|
+
puts %Q[#{I18n.t("list")}#{I18n.t("format_number", [get_chap, @chapter.list(id).number])}#{I18n.t("caption_prefix_idgxml")}#{compile_inline(caption)}]
|
234
249
|
end
|
235
|
-
|
236
|
-
buf
|
250
|
+
blank
|
237
251
|
end
|
238
252
|
|
239
253
|
def list_body(id, lines, lang)
|
240
|
-
buf = ""
|
241
254
|
lines.each do |line|
|
242
|
-
|
255
|
+
puts detab(line)
|
243
256
|
end
|
244
|
-
|
245
|
-
|
246
|
-
buf
|
257
|
+
puts "◆→終了:#{@titles["list"]}←◆"
|
258
|
+
blank
|
247
259
|
end
|
248
260
|
|
249
261
|
def base_block(type, lines, caption = nil)
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
buf << "\n"
|
257
|
-
buf
|
262
|
+
blank
|
263
|
+
puts "◆→開始:#{@titles[type]}←◆"
|
264
|
+
puts "■#{compile_inline(caption)}" unless caption.nil?
|
265
|
+
puts lines.join("\n")
|
266
|
+
puts "◆→終了:#{@titles[type]}←◆"
|
267
|
+
blank
|
258
268
|
end
|
259
269
|
|
260
270
|
def base_parablock(type, lines, caption = nil)
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
buf
|
271
|
+
blank
|
272
|
+
puts "◆→開始:#{@titles[type]}←◆"
|
273
|
+
puts "■#{compile_inline(caption)}" unless caption.nil?
|
274
|
+
puts split_paragraph(lines).join("\n")
|
275
|
+
puts "◆→終了:#{@titles[type]}←◆"
|
276
|
+
blank
|
268
277
|
end
|
269
278
|
|
270
279
|
def emlist(lines, caption = nil, lang = nil)
|
@@ -272,26 +281,23 @@ module ReVIEW
|
|
272
281
|
end
|
273
282
|
|
274
283
|
def emlistnum(lines, caption = nil, lang = nil)
|
275
|
-
|
276
|
-
|
277
|
-
|
284
|
+
blank
|
285
|
+
puts "◆→開始:#{@titles["emlist"]}←◆"
|
286
|
+
puts "■#{compile_inline(caption)}" unless caption.nil?
|
278
287
|
_lines = []
|
279
288
|
lines.each_with_index do |line, i|
|
280
|
-
|
289
|
+
puts (i + 1).to_s.rjust(2) + ": #{line}"
|
281
290
|
end
|
282
|
-
|
283
|
-
|
284
|
-
buf
|
291
|
+
puts "◆→終了:#{@titles["emlist"]}←◆"
|
292
|
+
blank
|
285
293
|
end
|
286
294
|
|
287
295
|
def listnum_body(lines, lang)
|
288
|
-
buf = ""
|
289
296
|
lines.each_with_index do |line, i|
|
290
|
-
|
297
|
+
puts (i + 1).to_s.rjust(2) + ": #{line}"
|
291
298
|
end
|
292
|
-
|
293
|
-
|
294
|
-
buf
|
299
|
+
puts "◆→終了:#{@titles["list"]}←◆"
|
300
|
+
blank
|
295
301
|
end
|
296
302
|
|
297
303
|
def cmd(lines, caption = nil)
|
@@ -321,57 +327,48 @@ module ReVIEW
|
|
321
327
|
end
|
322
328
|
|
323
329
|
def image(lines, id, caption, metric=nil)
|
324
|
-
|
325
|
-
|
326
|
-
buf << "◆→開始:#{@titles["image"]}←◆\n"
|
330
|
+
blank
|
331
|
+
puts "◆→開始:#{@titles["image"]}←◆"
|
327
332
|
if get_chap.nil?
|
328
|
-
|
333
|
+
puts "#{I18n.t("image")}#{I18n.t("format_number_without_chapter", [@chapter.image(id).number])}#{I18n.t("caption_prefix_idgxml")}#{compile_inline(caption)}"
|
329
334
|
else
|
330
|
-
|
335
|
+
puts "#{I18n.t("image")}#{I18n.t("format_number", [get_chap, @chapter.image(id).number])}#{I18n.t("caption_prefix_idgxml")}#{compile_inline(caption)}"
|
331
336
|
end
|
332
|
-
|
337
|
+
blank
|
333
338
|
if @chapter.image(id).bound?
|
334
|
-
|
339
|
+
puts "◆→#{@chapter.image(id).path}←◆"
|
335
340
|
else
|
336
341
|
lines.each do |line|
|
337
|
-
|
342
|
+
puts line
|
338
343
|
end
|
339
344
|
end
|
340
|
-
|
341
|
-
|
342
|
-
buf
|
345
|
+
puts "◆→終了:#{@titles["image"]}←◆"
|
346
|
+
blank
|
343
347
|
end
|
344
348
|
|
345
349
|
def texequation(lines)
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
buf << "\n"
|
351
|
-
buf
|
350
|
+
puts "◆→開始:#{@titles["texequation"]}←◆"
|
351
|
+
puts "#{lines.join("\n")}"
|
352
|
+
puts "◆→終了:#{@titles["texequation"]}←◆"
|
353
|
+
blank
|
352
354
|
end
|
353
355
|
|
354
356
|
def table_header(id, caption)
|
355
|
-
|
356
|
-
|
357
|
-
buf << "◆→開始:#{@titles["table"]}←◆\n"
|
357
|
+
blank
|
358
|
+
puts "◆→開始:#{@titles["table"]}←◆"
|
358
359
|
if get_chap.nil?
|
359
|
-
|
360
|
+
puts "#{I18n.t("table")}#{I18n.t("format_number_without_chapter", [@chapter.table(id).number])}#{I18n.t("caption_prefix_idgxml")}#{compile_inline(caption)}"
|
360
361
|
else
|
361
|
-
|
362
|
+
puts "#{I18n.t("table")}#{I18n.t("format_number", [get_chap, @chapter.table(id).number])}#{I18n.t("caption_prefix_idgxml")}#{compile_inline(caption)}"
|
362
363
|
end
|
363
|
-
|
364
|
-
buf
|
364
|
+
blank
|
365
365
|
end
|
366
366
|
|
367
367
|
def table_begin(ncols)
|
368
|
-
""
|
369
368
|
end
|
370
369
|
|
371
370
|
def tr(rows)
|
372
|
-
|
373
|
-
buf << rows.join("\t") << "\n"
|
374
|
-
buf
|
371
|
+
puts rows.join("\t")
|
375
372
|
end
|
376
373
|
|
377
374
|
def th(str)
|
@@ -383,21 +380,19 @@ module ReVIEW
|
|
383
380
|
end
|
384
381
|
|
385
382
|
def table_end
|
386
|
-
|
387
|
-
|
388
|
-
buf << "\n"
|
389
|
-
buf
|
383
|
+
puts "◆→終了:#{@titles["table"]}←◆"
|
384
|
+
blank
|
390
385
|
end
|
391
386
|
|
392
387
|
def comment(lines, comment = nil)
|
393
388
|
lines ||= []
|
394
389
|
lines.unshift comment unless comment.blank?
|
395
390
|
str = lines.join("")
|
396
|
-
"◆→DTP連絡:#{str}
|
391
|
+
puts "◆→DTP連絡:#{str}←◆"
|
397
392
|
end
|
398
393
|
|
399
394
|
def footnote(id, str)
|
400
|
-
"【注#{@chapter.footnote(id).number}】#{str}
|
395
|
+
puts "【注#{@chapter.footnote(id).number}】#{compile_inline(str)}"
|
401
396
|
end
|
402
397
|
|
403
398
|
def inline_fn(id)
|
@@ -513,28 +508,25 @@ module ReVIEW
|
|
513
508
|
end
|
514
509
|
|
515
510
|
def noindent
|
516
|
-
"◆→DTP連絡:次の1
|
511
|
+
puts "◆→DTP連絡:次の1行インデントなし←◆"
|
517
512
|
end
|
518
513
|
|
519
514
|
def nonum_begin(level, label, caption)
|
520
|
-
"■H#{level}■#{caption}
|
515
|
+
puts "■H#{level}■#{compile_inline(caption)}"
|
521
516
|
end
|
522
517
|
|
523
518
|
def nonum_end(level)
|
524
519
|
end
|
525
520
|
|
526
521
|
def common_column_begin(type, caption)
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
buf
|
522
|
+
blank
|
523
|
+
puts "◆→開始:#{@titles[type]}←◆"
|
524
|
+
puts %Q[■#{compile_inline(caption)}]
|
531
525
|
end
|
532
526
|
|
533
527
|
def common_column_end(type)
|
534
|
-
|
535
|
-
|
536
|
-
buf << "\n"
|
537
|
-
buf
|
528
|
+
puts %Q[◆→終了:#{@titles[type]}←◆]
|
529
|
+
blank
|
538
530
|
end
|
539
531
|
|
540
532
|
def column_begin(level, label, caption)
|
@@ -681,20 +673,22 @@ module ReVIEW
|
|
681
673
|
base_block "insn", lines, caption
|
682
674
|
end
|
683
675
|
|
676
|
+
def warning(lines, caption = nil)
|
677
|
+
base_parablock "warning", lines, caption
|
678
|
+
end
|
679
|
+
|
684
680
|
alias_method :box, :insn
|
685
681
|
|
686
682
|
def indepimage(id, caption=nil, metric=nil)
|
687
|
-
|
688
|
-
buf << "\n"
|
683
|
+
blank
|
689
684
|
begin
|
690
|
-
|
685
|
+
puts "◆→画像 #{@chapter.image(id).path.sub(/\A\.\//, "")} #{metric.join(" ")}←◆"
|
691
686
|
rescue
|
692
687
|
warn "no such image: #{id}"
|
693
|
-
|
688
|
+
puts "◆→画像 #{id}←◆"
|
694
689
|
end
|
695
|
-
|
696
|
-
|
697
|
-
buf
|
690
|
+
puts "図 #{compile_inline(caption)}" if caption.present?
|
691
|
+
blank
|
698
692
|
end
|
699
693
|
|
700
694
|
alias_method :numberlessimage, :indepimage
|
@@ -748,8 +742,7 @@ module ReVIEW
|
|
748
742
|
def inline_chapref(id)
|
749
743
|
chs = ["", "「", "」"]
|
750
744
|
unless @book.config["chapref"].nil?
|
751
|
-
_chs =
|
752
|
-
@book.config["inencoding"]).split(",")
|
745
|
+
_chs = @book.config["chapref"].split(",")
|
753
746
|
if _chs.size != 3
|
754
747
|
error "--chapsplitter must have exactly 3 parameters with comma."
|
755
748
|
else
|
@@ -763,7 +756,7 @@ module ReVIEW
|
|
763
756
|
nofunc_text("[UnknownChapter:#{id}]")
|
764
757
|
end
|
765
758
|
|
766
|
-
def source(lines, caption = nil)
|
759
|
+
def source(lines, caption = nil, lang = nil)
|
767
760
|
base_block "source", lines, caption
|
768
761
|
end
|
769
762
|
|
@@ -782,7 +775,7 @@ module ReVIEW
|
|
782
775
|
end
|
783
776
|
|
784
777
|
def circle_begin(level, label, caption)
|
785
|
-
"・\t#{caption}
|
778
|
+
puts "・\t#{caption}"
|
786
779
|
end
|
787
780
|
|
788
781
|
def circle_end(level)
|
@@ -794,4 +787,4 @@ module ReVIEW
|
|
794
787
|
|
795
788
|
end
|
796
789
|
|
797
|
-
end
|
790
|
+
end # module ReVIEW
|