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.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +66 -1
  3. data/.rubocop_todo.yml +617 -0
  4. data/.travis.yml +16 -1
  5. data/ChangeLog +48 -0
  6. data/Dockerfile +22 -0
  7. data/Gemfile +0 -1
  8. data/README.md +97 -0
  9. data/Rakefile +10 -11
  10. data/appveyor.yml +9 -0
  11. data/bin/review +46 -0
  12. data/bin/review-check +8 -21
  13. data/bin/review-compile +26 -43
  14. data/bin/review-index +9 -22
  15. data/bin/review-init +21 -25
  16. data/bin/review-preproc +9 -13
  17. data/bin/review-validate +1 -1
  18. data/bin/review-vol +3 -17
  19. data/bin/review-webmaker +15 -0
  20. data/doc/NEWS.ja.md +534 -0
  21. data/doc/NEWS.md +538 -0
  22. data/doc/catalog.ja.md +10 -18
  23. data/doc/catalog.md +5 -9
  24. data/doc/config.yml.sample +319 -0
  25. data/doc/customize_epub.ja.md +42 -0
  26. data/doc/format.ja.md +320 -288
  27. data/doc/format.md +277 -170
  28. data/doc/format_idg.ja.md +82 -175
  29. data/doc/pdfmaker.ja.md +61 -0
  30. data/doc/pdfmaker.md +65 -0
  31. data/doc/quickstart.ja.md +88 -98
  32. data/doc/quickstart.md +72 -110
  33. data/doc/sample.css +41 -0
  34. data/doc/writing_vertical.ja.md +55 -0
  35. data/doc/writing_vertical.md +5 -0
  36. data/lib/epubmaker/content.rb +3 -3
  37. data/lib/epubmaker/epubcommon.rb +173 -145
  38. data/lib/epubmaker/epubv2.rb +24 -77
  39. data/lib/epubmaker/epubv3.rb +72 -73
  40. data/lib/epubmaker/producer.rb +54 -30
  41. data/lib/lineinput.rb +48 -0
  42. data/lib/review/book.rb +0 -1
  43. data/lib/review/book/base.rb +47 -27
  44. data/lib/review/book/chapter.rb +48 -19
  45. data/lib/review/book/compilable.rb +10 -14
  46. data/lib/review/book/index.rb +10 -19
  47. data/lib/review/book/page_metric.rb +0 -10
  48. data/lib/review/book/part.rb +17 -3
  49. data/lib/review/builder.rb +84 -68
  50. data/lib/review/catalog.rb +5 -1
  51. data/lib/review/compiler.rb +327 -4657
  52. data/lib/review/configure.rb +84 -10
  53. data/lib/review/converter.rb +28 -0
  54. data/lib/review/epubbuilder.rb +1 -1
  55. data/lib/review/epubmaker.rb +142 -158
  56. data/lib/review/ewbbuilder.rb +5 -5
  57. data/lib/review/exception.rb +1 -1
  58. data/lib/review/extentions.rb +1 -1
  59. data/lib/review/extentions/hash.rb +15 -0
  60. data/lib/review/extentions/string.rb +2 -1
  61. data/lib/review/htmlbuilder.rb +364 -348
  62. data/lib/review/htmltoc.rb +44 -0
  63. data/lib/review/htmlutils.rb +12 -6
  64. data/lib/review/i18n.rb +78 -6
  65. data/lib/review/i18n.yml +7 -4
  66. data/lib/review/idgxmlbuilder.rb +226 -267
  67. data/lib/review/latexbuilder.rb +281 -274
  68. data/lib/review/latexutils.rb +56 -49
  69. data/lib/review/makerhelper.rb +8 -4
  70. data/lib/review/markdownbuilder.rb +80 -124
  71. data/lib/review/pdfmaker.rb +197 -138
  72. data/lib/review/preprocessor.rb +16 -67
  73. data/lib/review/template.rb +24 -0
  74. data/lib/review/textbuilder.rb +1 -1
  75. data/lib/review/textutils.rb +18 -24
  76. data/lib/review/tocparser.rb +51 -106
  77. data/lib/review/tocprinter.rb +61 -117
  78. data/lib/review/topbuilder.rb +119 -126
  79. data/lib/review/unfold.rb +2 -2
  80. data/lib/review/version.rb +1 -1
  81. data/lib/review/webmaker.rb +302 -0
  82. data/lib/review/webtocprinter.rb +48 -0
  83. data/lib/review/yamlloader.rb +47 -0
  84. data/review.gemspec +3 -3
  85. data/templates/html/layout-html5.html.erb +17 -0
  86. data/templates/html/layout-xhtml1.html.erb +20 -0
  87. data/{lib/review → templates/latex}/layout.tex.erb +107 -115
  88. data/templates/ncx/epubv2.ncx.erb +11 -0
  89. data/templates/opf/epubv2.opf.erb +21 -0
  90. data/templates/opf/epubv3.opf.erb +18 -0
  91. data/templates/web/html/layout-html5.html.erb +56 -0
  92. data/templates/web/html/layout-xhtml1.html.erb +20 -0
  93. data/templates/xml/container.xml.erb +6 -0
  94. data/test/assets/test.xml.erb +3 -0
  95. data/test/assets/test_template.tex +28 -71
  96. data/test/assets/test_template_backmatter.tex +1 -9
  97. data/test/sample-book/src/Rakefile +12 -3
  98. data/{doc/sample.yml → test/sample-book/src/config-epub2.yml} +92 -147
  99. data/test/sample-book/src/config.yml +40 -154
  100. data/test/sample-book/src/style-web.css +45 -0
  101. data/test/sample-book/src/style.css +23 -1
  102. data/test/test.re +1 -1
  103. data/test/test_book.rb +15 -17
  104. data/test/test_book_chapter.rb +2 -80
  105. data/test/test_book_part.rb +1 -1
  106. data/test/test_builder.rb +28 -6
  107. data/test/test_catalog.rb +17 -0
  108. data/test/test_compiler.rb +14 -59
  109. data/test/test_configure.rb +94 -0
  110. data/test/test_converter.rb +21 -0
  111. data/test/test_epub3maker.rb +155 -3
  112. data/test/test_epubmaker.rb +245 -30
  113. data/test/test_epubmaker_cmd.rb +2 -2
  114. data/test/test_extentions_hash.rb +60 -0
  115. data/test/test_helper.rb +4 -47
  116. data/test/test_htmlbuilder.rb +282 -175
  117. data/test/test_htmltoc.rb +33 -0
  118. data/test/test_i18n.rb +134 -70
  119. data/test/test_idgxmlbuilder.rb +58 -39
  120. data/test/test_latexbuilder.rb +132 -14
  121. data/test/test_lineinput.rb +5 -26
  122. data/test/test_makerhelper.rb +6 -4
  123. data/test/test_markdownbuilder.rb +23 -5
  124. data/test/test_pdfmaker.rb +86 -20
  125. data/test/test_pdfmaker_cmd.rb +1 -3
  126. data/test/test_review_ext.rb +1 -1
  127. data/test/test_template.rb +27 -0
  128. data/test/test_textutils.rb +36 -0
  129. data/test/test_tocparser.rb +25 -0
  130. data/test/test_topbuilder.rb +34 -2
  131. data/test/test_yamlloader.rb +188 -0
  132. metadata +71 -29
  133. data/README.rdoc +0 -81
  134. data/bin/review-epubmaker-legacy +0 -1024
  135. data/doc/ruby-uuid/README +0 -11
  136. data/doc/ruby-uuid/README.ja +0 -34
  137. data/lib/review/compiler/literals_1_8.kpeg +0 -19
  138. data/lib/review/compiler/literals_1_8.rb +0 -432
  139. data/lib/review/compiler/literals_1_9.kpeg +0 -22
  140. data/lib/review/compiler/literals_1_9.rb +0 -435
  141. data/lib/review/extentions/array.rb +0 -25
  142. data/lib/review/htmllayout.rb +0 -41
  143. data/lib/review/inaobuilder.rb +0 -357
  144. data/lib/review/location.rb +0 -24
  145. data/lib/review/node.rb +0 -267
  146. data/lib/review/review.kpeg +0 -724
  147. data/lib/uuid.rb +0 -312
  148. data/rubocop-todo.yml +0 -456
  149. data/test/test_inaobuilder.rb +0 -247
  150. data/test/test_uuid.rb +0 -157
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  #
3
3
  # Copyright (c) 2002-2006 Minero Aoki
4
- # 2008-2010 Minero Aoki, Kenshi Muto
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.defcodeblock(:insn, 1)
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
- buf << "■H#{level}■#{prefix}#{caption}\n"
153
- buf
172
+ puts "■H#{level}■#{prefix}#{compile_inline(caption)}"
154
173
  end
155
174
 
156
175
  def ul_begin
157
- "\n"
176
+ blank
158
177
  end
159
178
 
160
179
  def ul_item(lines)
161
- "●\t#{lines.join}\n"
180
+ puts "●\t#{lines.join}"
162
181
  end
163
182
 
164
183
  def ul_end
165
- "\n"
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}\n"
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
- "\n"
202
+ blank
184
203
  end
185
204
 
186
205
  def dt(line)
187
- "★#{line}☆\n"
206
+ puts "★#{line}"
188
207
  end
189
208
 
190
209
  def dd(lines)
191
- buf = ""
192
- lines.each do |paragraph|
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
- "\n"
216
+ blank
200
217
  end
201
218
 
202
219
  def paragraph(lines)
203
- lines.join+"\n"
220
+ puts lines.join
204
221
  end
205
222
 
206
223
  def read(lines)
207
- buf = ""
208
- buf << "◆→開始:#{@titles["lead"]}←◆\n"
209
- buf << lines.join("\n") << "\n"
210
- buf << "◆→終了:#{@titles["lead"]}←◆\n"
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
- buf = ""
228
- #buf << "\n"
229
- buf << "◆→開始:#{@titles["list"]}←◆\n"
243
+ blank
244
+ puts "◆→開始:#{@titles["list"]}←◆"
230
245
  if get_chap.nil?
231
- buf << %Q[#{I18n.t("list")}#{I18n.t("format_number_without_chapter", [@chapter.list(id).number])}#{I18n.t("caption_prefix_idgxml")}#{caption}] << "\n"
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
- buf << %Q[#{I18n.t("list")}#{I18n.t("format_number", [get_chap, @chapter.list(id).number])}#{I18n.t("caption_prefix_idgxml")}#{caption}] << "\n"
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
- buf << "\n"
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
- buf << detab(line) << "\n"
255
+ puts detab(line)
243
256
  end
244
- buf << "◆→終了:#{@titles["list"]}←◆\n"
245
- buf << "\n"
246
- buf
257
+ puts "◆→終了:#{@titles["list"]}←◆"
258
+ blank
247
259
  end
248
260
 
249
261
  def base_block(type, lines, caption = nil)
250
- buf = ""
251
- buf << "\n"
252
- buf << "◆→開始:#{@titles[type]}←◆\n"
253
- buf << "■#{caption}\n" unless caption.nil?
254
- buf << lines.join("")
255
- buf << "◆→終了:#{@titles[type]}←◆\n"
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
- buf = ""
262
- buf << "◆→開始:#{@titles[type]}←◆\n"
263
- buf << "■#{caption}\n" unless caption.nil?
264
- buf << lines.join("")
265
- buf << "◆→終了:#{@titles[type]}←◆\n"
266
- buf << "\n"
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
- buf = ""
276
- buf << "◆→開始:#{@titles["emlist"]}←◆\n"
277
- buf << "■#{caption}\n" unless caption.nil?
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
- buf << (i + 1).to_s.rjust(2) + ": #{line}\n"
289
+ puts (i + 1).to_s.rjust(2) + ": #{line}"
281
290
  end
282
- buf << "◆→終了:#{@titles["emlist"]}←◆\n"
283
- buf << "\n"
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
- buf << (i + 1).to_s.rjust(2) + ": #{line}\n"
297
+ puts (i + 1).to_s.rjust(2) + ": #{line}"
291
298
  end
292
- buf << "◆→終了:#{@titles["list"]}←◆\n"
293
- buf << "\n"
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
- buf = ""
325
- #buf << "\n"
326
- buf << "◆→開始:#{@titles["image"]}←◆\n"
330
+ blank
331
+ puts "◆→開始:#{@titles["image"]}←◆"
327
332
  if get_chap.nil?
328
- buf << "#{I18n.t("image")}#{I18n.t("format_number_without_chapter", [@chapter.image(id).number])}#{I18n.t("caption_prefix_idgxml")}#{caption}\n"
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
- buf << "#{I18n.t("image")}#{I18n.t("format_number", [get_chap, @chapter.image(id).number])}#{I18n.t("caption_prefix_idgxml")}#{caption}\n"
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
- buf << "\n"
337
+ blank
333
338
  if @chapter.image(id).bound?
334
- buf << "◆→#{@chapter.image(id).path}←◆\n"
339
+ puts "◆→#{@chapter.image(id).path}←◆"
335
340
  else
336
341
  lines.each do |line|
337
- buf << line << "\n"
342
+ puts line
338
343
  end
339
344
  end
340
- buf << "◆→終了:#{@titles["image"]}←◆\n"
341
- buf << "\n"
342
- buf
345
+ puts "◆→終了:#{@titles["image"]}←◆"
346
+ blank
343
347
  end
344
348
 
345
349
  def texequation(lines)
346
- buf = ""
347
- buf << "◆→開始:#{@titles["texequation"]}←◆\n"
348
- buf << "#{lines.join("\n")}\n"
349
- buf << "◆→終了:#{@titles["texequation"]}←◆\n"
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
- buf = ""
356
- buf << "\n"
357
- buf << "◆→開始:#{@titles["table"]}←◆\n"
357
+ blank
358
+ puts "◆→開始:#{@titles["table"]}←◆"
358
359
  if get_chap.nil?
359
- buf << "#{I18n.t("table")}#{I18n.t("format_number_without_chapter", [@chapter.table(id).number])}#{I18n.t("caption_prefix_idgxml")}#{caption}\n"
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
- buf << "#{I18n.t("table")}#{I18n.t("format_number", [get_chap, @chapter.table(id).number])}#{I18n.t("caption_prefix_idgxml")}#{caption}\n"
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
- buf << "\n"
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
- buf = ""
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
- buf = ""
387
- buf << "◆→終了:#{@titles["table"]}←◆\n"
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}←◆\n"
391
+ puts "◆→DTP連絡:#{str}←◆"
397
392
  end
398
393
 
399
394
  def footnote(id, str)
400
- "【注#{@chapter.footnote(id).number}】#{str}\n"
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行インデントなし←◆\n"
511
+ puts "◆→DTP連絡:次の1行インデントなし←◆"
517
512
  end
518
513
 
519
514
  def nonum_begin(level, label, caption)
520
- "■H#{level}■#{caption}\n"
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
- buf = ""
528
- buf << "◆→開始:#{@titles[type]}←◆\n"
529
- buf << %Q[■#{caption}\n]
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
- buf = ""
535
- buf << %Q[◆→終了:#{@titles[type]}←◆\n]
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
- buf = ""
688
- buf << "\n"
683
+ blank
689
684
  begin
690
- buf << "◆→画像 #{@chapter.image(id).path.sub(/\A\.\//, "")} #{metric.join(" ")}←◆\n"
685
+ puts "◆→画像 #{@chapter.image(id).path.sub(/\A\.\//, "")} #{metric.join(" ")}←◆"
691
686
  rescue
692
687
  warn "no such image: #{id}"
693
- buf << "◆→画像 #{id}←◆\n"
688
+ puts "◆→画像 #{id}←◆"
694
689
  end
695
- buf << "図 #{caption}\n" if caption.present?
696
- buf << "\n"
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 = convert_inencoding(@book.config["chapref"],
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}\n"
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 # module ReVIEW
790
+ end # module ReVIEW