Class: ReVIEW::TOPBuilder
Constant Summary
Constants inherited
from Builder
Builder::CAPTION_TITLES
Instance Method Summary
collapse
-
#base_block(type, lines, caption = nil) ⇒ Object
-
#base_parablock(type, lines, caption = nil) ⇒ Object
-
#best(lines, caption = nil) ⇒ Object
-
#bpo(lines) ⇒ Object
-
#caution(lines, caption = nil) ⇒ Object
-
#centering(lines) ⇒ Object
-
#circle_begin(level, label, caption) ⇒ Object
-
#circle_end(level) ⇒ Object
-
#cmd(lines, caption = nil) ⇒ Object
-
#column_begin(level, label, caption) ⇒ Object
-
#column_end(level) ⇒ Object
-
#comment(lines, comment = nil) ⇒ Object
-
#common_column_begin(type, caption) ⇒ Object
-
#common_column_end(type) ⇒ Object
-
#compile_href(url, label) ⇒ Object
-
#compile_kw(word, alt) ⇒ Object
-
#compile_ruby(base, ruby) ⇒ Object
-
#dd(lines) ⇒ Object
-
#dl_begin ⇒ Object
-
#dl_end ⇒ Object
-
#dt(line) ⇒ Object
-
#dtp(str) ⇒ Object
-
#edition_begin(level, label, caption) ⇒ Object
-
#edition_end(level) ⇒ Object
-
#emlist(lines, caption = nil, lang = nil) ⇒ Object
-
#emlistnum(lines, caption = nil, lang = nil) ⇒ Object
-
#error(msg) ⇒ Object
-
#expert(lines) ⇒ Object
-
#extname ⇒ Object
-
#flushright(lines) ⇒ Object
-
#footnote(id, str) ⇒ Object
-
#headline(level, label, caption) ⇒ Object
-
#hood_begin(level, label, caption) ⇒ Object
-
#hood_end(level) ⇒ Object
-
#image(lines, id, caption, metric = nil) ⇒ Object
-
#important(lines, caption = nil) ⇒ Object
-
#indepimage(id, caption = nil, metric = nil) ⇒ Object
(also: #numberlessimage)
-
#info(lines, caption = nil) ⇒ Object
-
#inline_ami(str) ⇒ Object
-
#inline_b(str) ⇒ Object
(also: #inline_strong)
-
#inline_balloon(str) ⇒ Object
-
#inline_bou(str) ⇒ Object
-
#inline_br(str) ⇒ Object
-
#inline_chap(id) ⇒ Object
-
#inline_chapref(id) ⇒ Object
-
#inline_code(str) ⇒ Object
-
#inline_del(str) ⇒ Object
-
#inline_dtp(str) ⇒ Object
-
#inline_fn(id) ⇒ Object
-
#inline_hidx(str) ⇒ Object
-
#inline_hint(str) ⇒ Object
-
#inline_i(str) ⇒ Object
-
#inline_icon(id) ⇒ Object
-
#inline_idx(str) ⇒ Object
-
#inline_img(id) ⇒ Object
-
#inline_keytop(str) ⇒ Object
-
#inline_labelref(idref) ⇒ Object
(also: #inline_ref)
-
#inline_list(id) ⇒ Object
-
#inline_m(str) ⇒ Object
-
#inline_maru(str) ⇒ Object
-
#inline_pageref(idref) ⇒ Object
-
#inline_raw(str) ⇒ Object
-
#inline_sub(str) ⇒ Object
-
#inline_sup(str) ⇒ Object
-
#inline_table(id) ⇒ Object
-
#inline_tt(str) ⇒ Object
-
#inline_ttb(str) ⇒ Object
(also: #inline_ttbold)
-
#inline_tti(str) ⇒ Object
-
#inline_ttibold(str) ⇒ Object
-
#inline_u(str) ⇒ Object
-
#inline_uchar(str) ⇒ Object
-
#insideout_begin(level, label, caption) ⇒ Object
-
#insideout_end(level) ⇒ Object
-
#insn(lines, caption = nil) ⇒ Object
(also: #box)
-
#label(id) ⇒ Object
-
#link(lines, caption = nil) ⇒ Object
-
#list_body(id, lines, lang) ⇒ Object
-
#list_header(id, caption, lang) ⇒ Object
-
#listnum_body(lines, lang) ⇒ Object
-
#memo(lines, caption = nil) ⇒ Object
-
#messages ⇒ Object
-
#nofunc_text(str) ⇒ Object
-
#noindent ⇒ Object
-
#nonum_begin(level, label, caption) ⇒ Object
-
#nonum_end(level) ⇒ Object
-
#note(lines, caption = nil) ⇒ Object
-
#notice(lines, caption = nil) ⇒ Object
-
#ol_begin ⇒ Object
-
#ol_end ⇒ Object
-
#ol_item(lines, num) ⇒ Object
-
#paragraph(lines) ⇒ Object
-
#planning(lines, caption = nil) ⇒ Object
-
#point(lines, caption = nil) ⇒ Object
-
#post_paragraph ⇒ Object
-
#practice(lines) ⇒ Object
-
#pre_paragraph ⇒ Object
-
#quote(lines) ⇒ Object
-
#read(lines) ⇒ Object
(also: #lead)
-
#ref_begin(level, label, caption) ⇒ Object
-
#ref_end(level) ⇒ Object
-
#reference(lines) ⇒ Object
-
#result ⇒ Object
-
#security(lines, caption = nil) ⇒ Object
-
#shoot(lines, caption = nil) ⇒ Object
-
#source(lines, caption = nil, lang = nil) ⇒ Object
-
#sup_begin(level, label, caption) ⇒ Object
-
#sup_end(level) ⇒ Object
-
#table_begin(ncols) ⇒ Object
-
#table_end ⇒ Object
-
#table_header(id, caption) ⇒ Object
-
#td(str) ⇒ Object
-
#term(lines) ⇒ Object
-
#texequation(lines) ⇒ Object
-
#text(str) ⇒ Object
-
#th(str) ⇒ Object
-
#tip(lines, caption = nil) ⇒ Object
-
#tr(rows) ⇒ Object
-
#tsize(id) ⇒ Object
-
#ul_begin ⇒ Object
-
#ul_end ⇒ Object
-
#ul_item(lines) ⇒ Object
-
#warn(msg) ⇒ Object
-
#world_begin(level, label, caption) ⇒ Object
-
#world_end(level) ⇒ Object
-
#xcolumn_begin(level, label, caption) ⇒ Object
-
#xcolumn_end(level) ⇒ Object
Methods included from TextUtils
#detab, #split_paragraph
Methods inherited from Builder
#bibpaper, #bind, #captionblock, #compile_inline, #detab, #extract_chapter_id, #get_chap, #graph, #handle_metric, #image_ext, #include, #initialize, #inline_column, #inline_hd, #inline_href, #inline_imgref, #inline_include, #inline_kw, #inline_ruby, #inline_title, #list, #listnum, #parse_metric, #raw, #result_metric, #table, #target_name, #ul_item_begin, #ul_item_end
Instance Method Details
#base_block(type, lines, caption = nil) ⇒ Object
264
265
266
267
268
269
270
271
|
# File 'lib/review/topbuilder.rb', line 264
def base_block(type, lines, caption = nil)
blank
puts "◆→開始:#{@titles[type]}←◆"
puts "■#{compile_inline(caption)}" unless caption.nil?
puts lines.join("\n")
puts "◆→終了:#{@titles[type]}←◆"
blank
end
|
#base_parablock(type, lines, caption = nil) ⇒ Object
273
274
275
276
277
278
279
280
|
# File 'lib/review/topbuilder.rb', line 273
def base_parablock(type, lines, caption = nil)
blank
puts "◆→開始:#{@titles[type]}←◆"
puts "■#{compile_inline(caption)}" unless caption.nil?
puts split_paragraph(lines).join("\n")
puts "◆→終了:#{@titles[type]}←◆"
blank
end
|
#best(lines, caption = nil) ⇒ Object
627
628
629
|
# File 'lib/review/topbuilder.rb', line 627
def best(lines, caption = nil)
base_parablock "best", lines, caption
end
|
#bpo(lines) ⇒ Object
709
710
711
|
# File 'lib/review/topbuilder.rb', line 709
def bpo(lines)
base_block "bpo", lines, nil
end
|
#caution(lines, caption = nil) ⇒ Object
639
640
641
|
# File 'lib/review/topbuilder.rb', line 639
def caution(lines, caption = nil)
base_parablock "caution", lines, caption
end
|
#centering(lines) ⇒ Object
603
604
605
|
# File 'lib/review/topbuilder.rb', line 603
def centering(lines)
base_parablock "centering", lines, nil
end
|
#circle_begin(level, label, caption) ⇒ Object
776
777
778
|
# File 'lib/review/topbuilder.rb', line 776
def circle_begin(level, label, caption)
puts "・\t#{caption}"
end
|
#circle_end(level) ⇒ Object
780
781
|
# File 'lib/review/topbuilder.rb', line 780
def circle_end(level)
end
|
#cmd(lines, caption = nil) ⇒ Object
306
307
308
|
# File 'lib/review/topbuilder.rb', line 306
def cmd(lines, caption = nil)
base_block "cmd", lines, caption
end
|
#column_begin(level, label, caption) ⇒ Object
535
536
537
|
# File 'lib/review/topbuilder.rb', line 535
def column_begin(level, label, caption)
common_column_begin("column", caption)
end
|
#column_end(level) ⇒ Object
539
540
541
|
# File 'lib/review/topbuilder.rb', line 539
def column_end(level)
common_column_end("column")
end
|
390
391
392
393
394
395
|
# File 'lib/review/topbuilder.rb', line 390
def (lines, = nil)
lines ||= []
lines.unshift unless .blank?
str = lines.join("")
puts "◆→DTP連絡:#{str}←◆"
end
|
#common_column_begin(type, caption) ⇒ Object
524
525
526
527
528
|
# File 'lib/review/topbuilder.rb', line 524
def common_column_begin(type, caption)
blank
puts "◆→開始:#{@titles[type]}←◆"
puts %Q[■#{compile_inline(caption)}]
end
|
#common_column_end(type) ⇒ Object
530
531
532
533
|
# File 'lib/review/topbuilder.rb', line 530
def common_column_end(type)
puts %Q[◆→終了:#{@titles[type]}←◆]
blank
end
|
#compile_href(url, label) ⇒ Object
416
417
418
419
420
421
422
|
# File 'lib/review/topbuilder.rb', line 416
def compile_href(url, label)
if label.nil?
%Q[△#{url}☆]
else
%Q[#{label}(△#{url}☆)]
end
end
|
#compile_kw(word, alt) ⇒ Object
409
410
411
412
413
414
|
# File 'lib/review/topbuilder.rb', line 409
def compile_kw(word, alt)
if alt
then "★#{word}☆(#{alt.strip})"
else "★#{word}☆"
end
end
|
#compile_ruby(base, ruby) ⇒ Object
405
406
407
|
# File 'lib/review/topbuilder.rb', line 405
def compile_ruby(base, ruby)
"#{base}◆→DTP連絡:「#{base}」に「#{ruby}」とルビ←◆"
end
|
#dd(lines) ⇒ Object
212
213
214
215
216
|
# File 'lib/review/topbuilder.rb', line 212
def dd(lines)
split_paragraph(lines).each do |paragraph|
puts "\t#{paragraph.gsub(/\n/, '')}"
end
end
|
204
205
206
|
# File 'lib/review/topbuilder.rb', line 204
def dl_begin
blank
end
|
218
219
220
|
# File 'lib/review/topbuilder.rb', line 218
def dl_end
blank
end
|
208
209
210
|
# File 'lib/review/topbuilder.rb', line 208
def dt(line)
puts "★#{line}☆"
end
|
705
706
707
|
# File 'lib/review/topbuilder.rb', line 705
def dtp(str)
end
|
#edition_begin(level, label, caption) ⇒ Object
567
568
569
|
# File 'lib/review/topbuilder.rb', line 567
def edition_begin(level, label, caption)
common_column_begin("edition", caption)
end
|
#edition_end(level) ⇒ Object
571
572
573
|
# File 'lib/review/topbuilder.rb', line 571
def edition_end(level)
common_column_end("edition")
end
|
#emlist(lines, caption = nil, lang = nil) ⇒ Object
282
283
284
|
# File 'lib/review/topbuilder.rb', line 282
def emlist(lines, caption = nil, lang = nil)
base_block "emlist", lines, caption
end
|
#emlistnum(lines, caption = nil, lang = nil) ⇒ Object
286
287
288
289
290
291
292
293
294
295
296
|
# File 'lib/review/topbuilder.rb', line 286
def emlistnum(lines, caption = nil, lang = nil)
blank
puts "◆→開始:#{@titles["emlist"]}←◆"
puts "■#{compile_inline(caption)}" unless caption.nil?
_lines = []
lines.each_with_index do |line, i|
puts (i + 1).to_s.rjust(2) + ": #{line}"
end
puts "◆→終了:#{@titles["emlist"]}←◆"
blank
end
|
#error(msg) ⇒ Object
131
132
133
|
# File 'lib/review/topbuilder.rb', line 131
def error(msg)
$stderr.puts "#{@location.filename}:#{@location.lineno}: error: #{msg}"
end
|
#expert(lines) ⇒ Object
671
672
673
|
# File 'lib/review/topbuilder.rb', line 671
def expert(lines)
base_parablock "expert", lines, nil
end
|
49
50
51
|
# File 'lib/review/topbuilder.rb', line 49
def extname
'.txt'
end
|
#flushright(lines) ⇒ Object
599
600
601
|
# File 'lib/review/topbuilder.rb', line 599
def flushright(lines)
base_parablock "flushright", lines, nil
end
|
397
398
399
|
# File 'lib/review/topbuilder.rb', line 397
def (id, str)
puts "【注#{@chapter.footnote(id).number}】#{compile_inline(str)}"
end
|
#headline(level, label, caption) ⇒ Object
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
# File 'lib/review/topbuilder.rb', line 139
def headline(level, label, caption)
prefix = ""
blank
case level
when 1
if @chapter.number.to_s =~ /\A\d+\Z/
prefix = "第#{@chapter.number}章 "
elsif @chapter.number.present?
prefix = "#{@chapter.number} "
end
@section = 0
@subsection = 0
@subsubsection = 0
@subsubsubsection = 0
when 2
@section += 1
prefix = @chapter.number.present? ? "#{@chapter.number}.#{@section} " : ""
@subsection = 0
@subsubsection = 0
@subsubsubsection = 0
when 3
@subsection += 1
prefix = @chapter.number.present? ? "#{@chapter.number}.#{@section}.#{@subsection} " : ""
@subsubsection = 0
@subsubsubsection = 0
when 4
@subsubsection += 1
prefix = @chapter.number.present? ? "#{@chapter.number}.#{@section}.#{@subsection}.#{@subsubsection} " : ""
@subsubsubsection = 0
when 5
@subsubsubsection += 1
prefix = @chapter.number.present? ? "#{@chapter.number}.#{@section}.#{@subsection}.#{@subsubsection}.#{@subsubsubsection} " : ""
else
raise "caption level too deep or unsupported: #{level}"
end
prefix = "" if (level.to_i > @book.config["secnolevel"])
puts "■H#{level}■#{prefix}#{compile_inline(caption)}"
end
|
#hood_begin(level, label, caption) ⇒ Object
559
560
561
|
# File 'lib/review/topbuilder.rb', line 559
def hood_begin(level, label, caption)
common_column_begin("hood", caption)
end
|
#hood_end(level) ⇒ Object
563
564
565
|
# File 'lib/review/topbuilder.rb', line 563
def hood_end(level)
common_column_end("hood")
end
|
#image(lines, id, caption, metric = nil) ⇒ Object
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
|
# File 'lib/review/topbuilder.rb', line 332
def image(lines, id, caption, metric=nil)
blank
puts "◆→開始:#{@titles["image"]}←◆"
if get_chap.nil?
puts "#{I18n.t("image")}#{I18n.t("format_number_without_chapter", [@chapter.image(id).number])}#{I18n.t("caption_prefix_idgxml")}#{compile_inline(caption)}"
else
puts "#{I18n.t("image")}#{I18n.t("format_number", [get_chap, @chapter.image(id).number])}#{I18n.t("caption_prefix_idgxml")}#{compile_inline(caption)}"
end
blank
if @chapter.image(id).bound?
puts "◆→#{@chapter.image(id).path}←◆"
else
lines.each do |line|
puts line
end
end
puts "◆→終了:#{@titles["image"]}←◆"
blank
end
|
#important(lines, caption = nil) ⇒ Object
631
632
633
|
# File 'lib/review/topbuilder.rb', line 631
def important(lines, caption = nil)
base_parablock "important", lines, caption
end
|
#indepimage(id, caption = nil, metric = nil) ⇒ Object
Also known as:
numberlessimage
681
682
683
684
685
686
687
688
689
690
691
|
# File 'lib/review/topbuilder.rb', line 681
def indepimage(id, caption=nil, metric=nil)
blank
begin
puts "◆→画像 #{@chapter.image(id).path.sub(/\A\.\//, "")} #{metric.join(" ")}←◆"
rescue
warn "no such image: #{id}"
puts "◆→画像 #{id}←◆"
end
puts "図 #{compile_inline(caption)}" if caption.present?
blank
end
|
#info(lines, caption = nil) ⇒ Object
619
620
621
|
# File 'lib/review/topbuilder.rb', line 619
def info(lines, caption = nil)
base_parablock "info", lines, caption
end
|
#inline_ami(str) ⇒ Object
452
453
454
|
# File 'lib/review/topbuilder.rb', line 452
def inline_ami(str)
"#{str}◆→DTP連絡:「#{str}」に網カケ←◆"
end
|
#inline_b(str) ⇒ Object
Also known as:
inline_strong
460
461
462
|
# File 'lib/review/topbuilder.rb', line 460
def inline_b(str)
"★#{str}☆"
end
|
#inline_balloon(str) ⇒ Object
501
502
503
|
# File 'lib/review/topbuilder.rb', line 501
def inline_balloon(str)
%Q(\t←#{str.gsub(/@maru\[(\d+)\]/, inline_maru('\1'))})
end
|
#inline_bou(str) ⇒ Object
493
494
495
|
# File 'lib/review/topbuilder.rb', line 493
def inline_bou(str)
"#{str}◆→DTP連絡:「#{str}」に傍点←◆"
end
|
#inline_br(str) ⇒ Object
727
728
729
|
# File 'lib/review/topbuilder.rb', line 727
def inline_br(str)
%Q(\n)
end
|
#inline_chap(id) ⇒ Object
735
736
737
738
739
|
# File 'lib/review/topbuilder.rb', line 735
def inline_chap(id)
super
end
|
#inline_chapref(id) ⇒ Object
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
|
# File 'lib/review/topbuilder.rb', line 741
def inline_chapref(id)
chs = ["", "「", "」"]
unless @book.config["chapref"].nil?
_chs = @book.config["chapref"].split(",")
if _chs.size != 3
error "--chapsplitter must have exactly 3 parameters with comma."
else
chs = _chs
end
else
end
"#{chs[0]}#{@book.chapter_index.number(id)}#{chs[1]}#{@book.chapter_index.title(id)}#{chs[2]}"
rescue KeyError
error "unknown chapter: #{id}"
nofunc_text("[UnknownChapter:#{id}]")
end
|
#inline_code(str) ⇒ Object
723
724
725
|
# File 'lib/review/topbuilder.rb', line 723
def inline_code(str)
%Q[△#{str}☆]
end
|
#inline_del(str) ⇒ Object
718
719
720
721
|
# File 'lib/review/topbuilder.rb', line 718
def inline_del(str)
""
end
|
#inline_dtp(str) ⇒ Object
713
714
715
716
|
# File 'lib/review/topbuilder.rb', line 713
def inline_dtp(str)
""
end
|
#inline_fn(id) ⇒ Object
401
402
403
|
# File 'lib/review/topbuilder.rb', line 401
def inline_fn(id)
"【注#{@chapter.footnote(id).number}】"
end
|
#inline_hidx(str) ⇒ Object
448
449
450
|
# File 'lib/review/topbuilder.rb', line 448
def inline_hidx(str)
"◆→索引項目:#{str}←◆"
end
|
#inline_hint(str) ⇒ Object
436
437
438
|
# File 'lib/review/topbuilder.rb', line 436
def inline_hint(str)
"◆→ヒントスタイルここから←◆#{str}◆→ヒントスタイルここまで←◆"
end
|
#inline_i(str) ⇒ Object
456
457
458
|
# File 'lib/review/topbuilder.rb', line 456
def inline_i(str)
"▲#{str}☆"
end
|
#inline_icon(id) ⇒ Object
484
485
486
487
488
489
490
491
|
# File 'lib/review/topbuilder.rb', line 484
def inline_icon(id)
begin
return "◆→画像 #{@chapter.image(id).path.sub(/\A\.\//, "")}←◆"
rescue
warn "no such icon image: #{id}"
return "◆→画像 #{id}←◆"
end
end
|
#inline_idx(str) ⇒ Object
444
445
446
|
# File 'lib/review/topbuilder.rb', line 444
def inline_idx(str)
"#{str}◆→索引項目:#{str}←◆"
end
|
#inline_img(id) ⇒ Object
323
324
325
326
327
328
329
330
|
# File 'lib/review/topbuilder.rb', line 323
def inline_img(id)
chapter, id = (id)
if get_chap(chapter).nil?
"#{I18n.t("image")}#{I18n.t("format_number_without_chapter", [chapter.image(id).number])}"
else
"#{I18n.t("image")}#{I18n.t("format_number", [get_chap(chapter), chapter.image(id).number])}"
end
end
|
#inline_keytop(str) ⇒ Object
497
498
499
|
# File 'lib/review/topbuilder.rb', line 497
def inline_keytop(str)
"#{str}◆→キートップ#{str}←◆"
end
|
#inline_labelref(idref) ⇒ Object
Also known as:
inline_ref
766
767
768
|
# File 'lib/review/topbuilder.rb', line 766
def inline_labelref(idref)
%Q(「◆→#{idref}←◆」)
end
|
#inline_list(id) ⇒ Object
235
236
237
238
239
240
241
242
243
|
# File 'lib/review/topbuilder.rb', line 235
def inline_list(id)
chapter, id = (id)
if get_chap(chapter).nil?
%Q[#{I18n.t("list")}#{I18n.t("format_number_without_chapter", [@chapter.list(id).number])}]
else
%Q[#{I18n.t("list")}#{I18n.t("format_number", [get_chap(chapter), @chapter.list(id).number])}]
end
end
|
#inline_m(str) ⇒ Object
509
510
511
|
# File 'lib/review/topbuilder.rb', line 509
def inline_m(str)
%Q[◆→TeX式ここから←◆#{str}◆→TeX式ここまで←◆]
end
|
#inline_maru(str) ⇒ Object
440
441
442
|
# File 'lib/review/topbuilder.rb', line 440
def inline_maru(str)
"#{str}◆→丸数字#{str}←◆"
end
|
772
773
774
|
# File 'lib/review/topbuilder.rb', line 772
def (idref)
%Q(●ページ◆→#{idref}←◆)
end
|
#inline_raw(str) ⇒ Object
432
433
434
|
# File 'lib/review/topbuilder.rb', line 432
def inline_raw(str)
%Q[#{super(str).gsub("\\n", "\n")}]
end
|
#inline_sub(str) ⇒ Object
428
429
430
|
# File 'lib/review/topbuilder.rb', line 428
def inline_sub(str)
"#{str}◆→DTP連絡:「#{str}」は下付き←◆"
end
|
#inline_sup(str) ⇒ Object
424
425
426
|
# File 'lib/review/topbuilder.rb', line 424
def inline_sup(str)
"#{str}◆→DTP連絡:「#{str}」は上付き←◆"
end
|
#inline_table(id) ⇒ Object
314
315
316
317
318
319
320
321
|
# File 'lib/review/topbuilder.rb', line 314
def inline_table(id)
chapter, id = (id)
if get_chap(chapter).nil?
"#{I18n.t("table")}#{I18n.t("format_number_without_chapter", [chapter.table(id).number])}"
else
"#{I18n.t("table")}#{I18n.t("format_number", [get_chap(chapter), chapter.table(id).number])}"
end
end
|
#inline_tt(str) ⇒ Object
466
467
468
|
# File 'lib/review/topbuilder.rb', line 466
def inline_tt(str)
"△#{str}☆"
end
|
#inline_ttb(str) ⇒ Object
Also known as:
inline_ttbold
470
471
472
|
# File 'lib/review/topbuilder.rb', line 470
def inline_ttb(str)
"★#{str}☆◆→等幅フォント太字←◆"
end
|
#inline_tti(str) ⇒ Object
476
477
478
|
# File 'lib/review/topbuilder.rb', line 476
def inline_tti(str)
"▲#{str}☆◆→等幅フォントイタ←◆"
end
|
#inline_ttibold(str) ⇒ Object
762
763
764
|
# File 'lib/review/topbuilder.rb', line 762
def inline_ttibold(str)
"▲#{str}☆◆→等幅フォント太字イタ←◆"
end
|
#inline_u(str) ⇒ Object
480
481
482
|
# File 'lib/review/topbuilder.rb', line 480
def inline_u(str)
"@#{str}@◆→@〜@部分に下線←◆"
end
|
#inline_uchar(str) ⇒ Object
505
506
507
|
# File 'lib/review/topbuilder.rb', line 505
def inline_uchar(str)
[str.to_i(16)].pack("U")
end
|
#insideout_begin(level, label, caption) ⇒ Object
575
576
577
|
# File 'lib/review/topbuilder.rb', line 575
def insideout_begin(level, label, caption)
common_column_begin("insideout", caption)
end
|
#insideout_end(level) ⇒ Object
579
580
581
|
# File 'lib/review/topbuilder.rb', line 579
def insideout_end(level)
common_column_end("insideout")
end
|
#insn(lines, caption = nil) ⇒ Object
Also known as:
box
675
676
677
|
# File 'lib/review/topbuilder.rb', line 675
def insn(lines, caption = nil)
base_block "insn", lines, caption
end
|
#label(id) ⇒ Object
695
696
697
698
|
# File 'lib/review/topbuilder.rb', line 695
def label(id)
""
end
|
#link(lines, caption = nil) ⇒ Object
647
648
649
|
# File 'lib/review/topbuilder.rb', line 647
def link(lines, caption = nil)
base_parablock "link", lines, caption
end
|
#list_body(id, lines, lang) ⇒ Object
256
257
258
259
260
261
262
|
# File 'lib/review/topbuilder.rb', line 256
def list_body(id, lines, lang)
lines.each do |line|
puts detab(line)
end
puts "◆→終了:#{@titles["list"]}←◆"
blank
end
|
245
246
247
248
249
250
251
252
253
254
|
# File 'lib/review/topbuilder.rb', line 245
def (id, caption, lang)
blank
puts "◆→開始:#{@titles["list"]}←◆"
if get_chap.nil?
puts %Q[#{I18n.t("list")}#{I18n.t("format_number_without_chapter", [@chapter.list(id).number])}#{I18n.t("caption_prefix_idgxml")}#{compile_inline(caption)}]
else
puts %Q[#{I18n.t("list")}#{I18n.t("format_number", [get_chap, @chapter.list(id).number])}#{I18n.t("caption_prefix_idgxml")}#{compile_inline(caption)}]
end
blank
end
|
#listnum_body(lines, lang) ⇒ Object
298
299
300
301
302
303
304
|
# File 'lib/review/topbuilder.rb', line 298
def listnum_body(lines, lang)
lines.each_with_index do |line, i|
puts (i + 1).to_s.rjust(2) + ": #{line}"
end
puts "◆→終了:#{@titles["list"]}←◆"
blank
end
|
#memo(lines, caption = nil) ⇒ Object
611
612
613
|
# File 'lib/review/topbuilder.rb', line 611
def memo(lines, caption = nil)
base_parablock "memo", lines, caption
end
|
135
136
137
|
# File 'lib/review/topbuilder.rb', line 135
def messages
error_messages() + warning_messages()
end
|
#nofunc_text(str) ⇒ Object
783
784
785
|
# File 'lib/review/topbuilder.rb', line 783
def nofunc_text(str)
str
end
|
513
514
515
|
# File 'lib/review/topbuilder.rb', line 513
def noindent
puts "◆→DTP連絡:次の1行インデントなし←◆"
end
|
#nonum_begin(level, label, caption) ⇒ Object
517
518
519
|
# File 'lib/review/topbuilder.rb', line 517
def nonum_begin(level, label, caption)
puts "■H#{level}■#{compile_inline(caption)}"
end
|
#nonum_end(level) ⇒ Object
521
522
|
# File 'lib/review/topbuilder.rb', line 521
def nonum_end(level)
end
|
#note(lines, caption = nil) ⇒ Object
607
608
609
|
# File 'lib/review/topbuilder.rb', line 607
def note(lines, caption = nil)
base_parablock "note", lines, caption
end
|
#notice(lines, caption = nil) ⇒ Object
651
652
653
|
# File 'lib/review/topbuilder.rb', line 651
def notice(lines, caption = nil)
base_parablock "notice", lines, caption
end
|
190
191
192
193
|
# File 'lib/review/topbuilder.rb', line 190
def ol_begin
blank
@olitem = 0
end
|
199
200
201
202
|
# File 'lib/review/topbuilder.rb', line 199
def ol_end
blank
@olitem = nil
end
|
#ol_item(lines, num) ⇒ Object
195
196
197
|
# File 'lib/review/topbuilder.rb', line 195
def ol_item(lines, num)
puts "#{num}\t#{lines.join}"
end
|
#paragraph(lines) ⇒ Object
222
223
224
|
# File 'lib/review/topbuilder.rb', line 222
def paragraph(lines)
puts lines.join
end
|
#planning(lines, caption = nil) ⇒ Object
623
624
625
|
# File 'lib/review/topbuilder.rb', line 623
def planning(lines, caption = nil)
base_parablock "planning", lines, caption
end
|
#point(lines, caption = nil) ⇒ Object
655
656
657
|
# File 'lib/review/topbuilder.rb', line 655
def point(lines, caption = nil)
base_parablock "point", lines, caption
end
|
#post_paragraph ⇒ Object
45
46
47
|
# File 'lib/review/topbuilder.rb', line 45
def post_paragraph
''
end
|
#practice(lines) ⇒ Object
667
668
669
|
# File 'lib/review/topbuilder.rb', line 667
def practice(lines)
base_parablock "practice", lines, nil
end
|
#pre_paragraph ⇒ Object
41
42
43
|
# File 'lib/review/topbuilder.rb', line 41
def pre_paragraph
''
end
|
#quote(lines) ⇒ Object
310
311
312
|
# File 'lib/review/topbuilder.rb', line 310
def quote(lines)
base_parablock "quote", lines, nil
end
|
#read(lines) ⇒ Object
Also known as:
lead
226
227
228
229
230
231
|
# File 'lib/review/topbuilder.rb', line 226
def read(lines)
puts "◆→開始:#{@titles["lead"]}←◆"
puts split_paragraph(lines).join("\n")
puts "◆→終了:#{@titles["lead"]}←◆"
blank
end
|
#ref_begin(level, label, caption) ⇒ Object
583
584
585
|
# File 'lib/review/topbuilder.rb', line 583
def ref_begin(level, label, caption)
common_column_begin("ref", caption)
end
|
#ref_end(level) ⇒ Object
587
588
589
|
# File 'lib/review/topbuilder.rb', line 587
def ref_end(level)
common_column_end("ref")
end
|
#reference(lines) ⇒ Object
663
664
665
|
# File 'lib/review/topbuilder.rb', line 663
def reference(lines)
base_parablock "reference", lines, nil
end
|
123
124
125
|
# File 'lib/review/topbuilder.rb', line 123
def result
@output.string
end
|
#security(lines, caption = nil) ⇒ Object
635
636
637
|
# File 'lib/review/topbuilder.rb', line 635
def security(lines, caption = nil)
base_parablock "security", lines, caption
end
|
#shoot(lines, caption = nil) ⇒ Object
659
660
661
|
# File 'lib/review/topbuilder.rb', line 659
def shoot(lines, caption = nil)
base_parablock "shoot", lines, caption
end
|
#source(lines, caption = nil, lang = nil) ⇒ Object
758
759
760
|
# File 'lib/review/topbuilder.rb', line 758
def source(lines, caption = nil, lang = nil)
base_block "source", lines, caption
end
|
#sup_begin(level, label, caption) ⇒ Object
591
592
593
|
# File 'lib/review/topbuilder.rb', line 591
def sup_begin(level, label, caption)
common_column_begin("sup", caption)
end
|
#sup_end(level) ⇒ Object
595
596
597
|
# File 'lib/review/topbuilder.rb', line 595
def sup_end(level)
common_column_end("sup")
end
|
#table_begin(ncols) ⇒ Object
370
371
|
# File 'lib/review/topbuilder.rb', line 370
def table_begin(ncols)
end
|
#table_end ⇒ Object
385
386
387
388
|
# File 'lib/review/topbuilder.rb', line 385
def table_end
puts "◆→終了:#{@titles["table"]}←◆"
blank
end
|
359
360
361
362
363
364
365
366
367
368
|
# File 'lib/review/topbuilder.rb', line 359
def (id, caption)
blank
puts "◆→開始:#{@titles["table"]}←◆"
if get_chap.nil?
puts "#{I18n.t("table")}#{I18n.t("format_number_without_chapter", [@chapter.table(id).number])}#{I18n.t("caption_prefix_idgxml")}#{compile_inline(caption)}"
else
puts "#{I18n.t("table")}#{I18n.t("format_number", [get_chap, @chapter.table(id).number])}#{I18n.t("caption_prefix_idgxml")}#{compile_inline(caption)}"
end
blank
end
|
381
382
383
|
# File 'lib/review/topbuilder.rb', line 381
def td(str)
str
end
|
#term(lines) ⇒ Object
643
644
645
|
# File 'lib/review/topbuilder.rb', line 643
def term(lines)
base_parablock "term", lines, nil
end
|
#texequation(lines) ⇒ Object
352
353
354
355
356
357
|
# File 'lib/review/topbuilder.rb', line 352
def texequation(lines)
puts "◆→開始:#{@titles["texequation"]}←◆"
puts "#{lines.join("\n")}"
puts "◆→終了:#{@titles["texequation"]}←◆"
blank
end
|
#text(str) ⇒ Object
731
732
733
|
# File 'lib/review/topbuilder.rb', line 731
def text(str)
str
end
|
377
378
379
|
# File 'lib/review/topbuilder.rb', line 377
def th(str)
"★#{str}☆"
end
|
#tip(lines, caption = nil) ⇒ Object
615
616
617
|
# File 'lib/review/topbuilder.rb', line 615
def tip(lines, caption = nil)
base_parablock "tip", lines, caption
end
|
373
374
375
|
# File 'lib/review/topbuilder.rb', line 373
def tr(rows)
puts rows.join("\t")
end
|
#tsize(id) ⇒ Object
700
701
702
703
|
# File 'lib/review/topbuilder.rb', line 700
def tsize(id)
""
end
|
178
179
180
|
# File 'lib/review/topbuilder.rb', line 178
def ul_begin
blank
end
|
186
187
188
|
# File 'lib/review/topbuilder.rb', line 186
def ul_end
blank
end
|
#ul_item(lines) ⇒ Object
182
183
184
|
# File 'lib/review/topbuilder.rb', line 182
def ul_item(lines)
puts "●\t#{lines.join}"
end
|
#warn(msg) ⇒ Object
127
128
129
|
# File 'lib/review/topbuilder.rb', line 127
def warn(msg)
$stderr.puts "#{@location.filename}:#{@location.lineno}: warning: #{msg}"
end
|
#world_begin(level, label, caption) ⇒ Object
551
552
553
|
# File 'lib/review/topbuilder.rb', line 551
def world_begin(level, label, caption)
common_column_begin("world", caption)
end
|
#world_end(level) ⇒ Object
555
556
557
|
# File 'lib/review/topbuilder.rb', line 555
def world_end(level)
common_column_end("world")
end
|
#xcolumn_begin(level, label, caption) ⇒ Object
543
544
545
|
# File 'lib/review/topbuilder.rb', line 543
def xcolumn_begin(level, label, caption)
common_column_begin("xcolumn", caption)
end
|
#xcolumn_end(level) ⇒ Object
547
548
549
|
# File 'lib/review/topbuilder.rb', line 547
def xcolumn_end(level)
common_column_end("xcolumn")
end
|