Class: ReVIEW::TOPBuilder

Inherits:
Builder show all
Includes:
TextUtils
Defined in:
lib/review/topbuilder.rb

Direct Known Subclasses

TEXTBuilder

Constant Summary

Constants inherited from Builder

Builder::CAPTION_TITLES

Instance Method Summary collapse

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_column_chap, #inline_hd, #inline_href, #inline_imgref, #inline_include, #inline_kw, #inline_ruby, #inline_tcy, #inline_title, #list, #listnum, #parse_metric, #raw, #result_metric, #table, #target_name, #ul_item_begin, #ul_item_end

Constructor Details

This class inherits a constructor from ReVIEW::Builder

Instance Method Details

#base_block(type, lines, caption = nil) ⇒ Object



261
262
263
264
265
266
267
268
# File 'lib/review/topbuilder.rb', line 261

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



270
271
272
273
274
275
276
277
# File 'lib/review/topbuilder.rb', line 270

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



624
625
626
# File 'lib/review/topbuilder.rb', line 624

def best(lines, caption = nil)
  base_parablock "best", lines, caption
end

#bpo(lines) ⇒ Object



710
711
712
# File 'lib/review/topbuilder.rb', line 710

def bpo(lines)
  base_block "bpo", lines, nil
end

#caution(lines, caption = nil) ⇒ Object



636
637
638
# File 'lib/review/topbuilder.rb', line 636

def caution(lines, caption = nil)
  base_parablock "caution", lines, caption
end

#centering(lines) ⇒ Object



600
601
602
# File 'lib/review/topbuilder.rb', line 600

def centering(lines)
  base_parablock "centering", lines, nil
end

#circle_begin(level, label, caption) ⇒ Object



777
778
779
# File 'lib/review/topbuilder.rb', line 777

def circle_begin(level, label, caption)
  puts "・\t#{caption}"
end

#circle_end(level) ⇒ Object



781
782
# File 'lib/review/topbuilder.rb', line 781

def circle_end(level)
end

#cmd(lines, caption = nil) ⇒ Object



303
304
305
# File 'lib/review/topbuilder.rb', line 303

def cmd(lines, caption = nil)
  base_block "cmd", lines, caption
end

#column_begin(level, label, caption) ⇒ Object



532
533
534
# File 'lib/review/topbuilder.rb', line 532

def column_begin(level, label, caption)
  common_column_begin("column", caption)
end

#column_end(level) ⇒ Object



536
537
538
# File 'lib/review/topbuilder.rb', line 536

def column_end(level)
  common_column_end("column")
end

#comment(lines, comment = nil) ⇒ Object



387
388
389
390
391
392
# File 'lib/review/topbuilder.rb', line 387

def comment(lines, comment = nil)
  lines ||= []
  lines.unshift comment unless comment.blank?
  str = lines.join("")
  puts "◆→DTP連絡:#{str}←◆"
end

#common_column_begin(type, caption) ⇒ Object



521
522
523
524
525
# File 'lib/review/topbuilder.rb', line 521

def common_column_begin(type, caption)
  blank
  puts "◆→開始:#{@titles[type]}←◆"
  puts %Q[#{compile_inline(caption)}]
end

#common_column_end(type) ⇒ Object



527
528
529
530
# File 'lib/review/topbuilder.rb', line 527

def common_column_end(type)
  puts %Q[◆→終了:#{@titles[type]}←◆]
  blank
end

#compile_href(url, label) ⇒ Object



413
414
415
416
417
418
419
# File 'lib/review/topbuilder.rb', line 413

def compile_href(url, label)
  if label.nil?
    %Q[#{url}]
  else
    %Q[#{label}(△#{url}☆)]
  end
end

#compile_kw(word, alt) ⇒ Object



406
407
408
409
410
411
# File 'lib/review/topbuilder.rb', line 406

def compile_kw(word, alt)
  if alt
  then "#{word}☆(#{alt.strip}"
  else "#{word}"
  end
end

#compile_ruby(base, ruby) ⇒ Object



402
403
404
# File 'lib/review/topbuilder.rb', line 402

def compile_ruby(base, ruby)
  "#{base}◆→DTP連絡:「#{base}」に「#{ruby}」とルビ←◆"
end

#dd(lines) ⇒ Object



209
210
211
212
213
# File 'lib/review/topbuilder.rb', line 209

def dd(lines)
  split_paragraph(lines).each do |paragraph|
    puts "\t#{paragraph.gsub(/\n/, '')}"
  end
end

#dl_beginObject



201
202
203
# File 'lib/review/topbuilder.rb', line 201

def dl_begin
  blank
end

#dl_endObject



215
216
217
# File 'lib/review/topbuilder.rb', line 215

def dl_end
  blank
end

#dt(line) ⇒ Object



205
206
207
# File 'lib/review/topbuilder.rb', line 205

def dt(line)
  puts "#{line}"
end

#dtp(str) ⇒ Object



706
707
708
# File 'lib/review/topbuilder.rb', line 706

def dtp(str)
  # FIXME
end

#edition_begin(level, label, caption) ⇒ Object



564
565
566
# File 'lib/review/topbuilder.rb', line 564

def edition_begin(level, label, caption)
  common_column_begin("edition", caption)
end

#edition_end(level) ⇒ Object



568
569
570
# File 'lib/review/topbuilder.rb', line 568

def edition_end(level)
  common_column_end("edition")
end

#emlist(lines, caption = nil, lang = nil) ⇒ Object



279
280
281
# File 'lib/review/topbuilder.rb', line 279

def emlist(lines, caption = nil, lang = nil)
  base_block "emlist", lines, caption
end

#emlistnum(lines, caption = nil, lang = nil) ⇒ Object



283
284
285
286
287
288
289
290
291
292
293
# File 'lib/review/topbuilder.rb', line 283

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



128
129
130
# File 'lib/review/topbuilder.rb', line 128

def error(msg)
  $stderr.puts "#{@location.filename}:#{@location.lineno}: error: #{msg}"
end

#expert(lines) ⇒ Object



668
669
670
# File 'lib/review/topbuilder.rb', line 668

def expert(lines)
  base_parablock "expert", lines, nil
end

#extnameObject



45
46
47
# File 'lib/review/topbuilder.rb', line 45

def extname
  '.txt'
end

#flushright(lines) ⇒ Object



596
597
598
# File 'lib/review/topbuilder.rb', line 596

def flushright(lines)
  base_parablock "flushright", lines, nil
end

#footnote(id, str) ⇒ Object



394
395
396
# File 'lib/review/topbuilder.rb', line 394

def footnote(id, str)
  puts "【注#{@chapter.footnote(id).number}#{compile_inline(str)}"
end

#headline(level, label, caption) ⇒ Object



136
137
138
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
# File 'lib/review/topbuilder.rb', line 136

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



556
557
558
# File 'lib/review/topbuilder.rb', line 556

def hood_begin(level, label, caption)
  common_column_begin("hood", caption)
end

#hood_end(level) ⇒ Object



560
561
562
# File 'lib/review/topbuilder.rb', line 560

def hood_end(level)
  common_column_end("hood")
end

#image(lines, id, caption, metric = nil) ⇒ Object



329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/review/topbuilder.rb', line 329

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



628
629
630
# File 'lib/review/topbuilder.rb', line 628

def important(lines, caption = nil)
  base_parablock "important", lines, caption
end

#indepimage(id, caption = nil, metric = nil) ⇒ Object Also known as: numberlessimage



682
683
684
685
686
687
688
689
690
691
692
# File 'lib/review/topbuilder.rb', line 682

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



616
617
618
# File 'lib/review/topbuilder.rb', line 616

def info(lines, caption = nil)
  base_parablock "info", lines, caption
end

#inline_ami(str) ⇒ Object



449
450
451
# File 'lib/review/topbuilder.rb', line 449

def inline_ami(str)
  "#{str}◆→DTP連絡:「#{str}」に網カケ←◆"
end

#inline_b(str) ⇒ Object Also known as: inline_strong



457
458
459
# File 'lib/review/topbuilder.rb', line 457

def inline_b(str)
  "#{str}"
end

#inline_balloon(str) ⇒ Object



498
499
500
# File 'lib/review/topbuilder.rb', line 498

def inline_balloon(str)
  %Q(\t←#{str.gsub(/@maru\[(\d+)\]/, inline_maru('\1'))})
end

#inline_bou(str) ⇒ Object



490
491
492
# File 'lib/review/topbuilder.rb', line 490

def inline_bou(str)
  "#{str}◆→DTP連絡:「#{str}」に傍点←◆"
end

#inline_br(str) ⇒ Object



728
729
730
# File 'lib/review/topbuilder.rb', line 728

def inline_br(str)
  %Q(\n)
end

#inline_chap(id) ⇒ Object



736
737
738
739
740
# File 'lib/review/topbuilder.rb', line 736

def inline_chap(id)
  #"「第#{super}章 #{inline_title(id)}」"
  # "第#{super}章"
  super
end

#inline_chapref(id) ⇒ Object



742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
# File 'lib/review/topbuilder.rb', line 742

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



724
725
726
# File 'lib/review/topbuilder.rb', line 724

def inline_code(str)
  %Q[#{str}]
end

#inline_del(str) ⇒ Object



719
720
721
722
# File 'lib/review/topbuilder.rb', line 719

def inline_del(str)
  # FIXME
  ""
end

#inline_dtp(str) ⇒ Object



714
715
716
717
# File 'lib/review/topbuilder.rb', line 714

def inline_dtp(str)
  # FIXME
  ""
end

#inline_fn(id) ⇒ Object



398
399
400
# File 'lib/review/topbuilder.rb', line 398

def inline_fn(id)
  "【注#{@chapter.footnote(id).number}"
end

#inline_hidx(str) ⇒ Object



445
446
447
# File 'lib/review/topbuilder.rb', line 445

def inline_hidx(str)
  "◆→索引項目:#{str}←◆"
end

#inline_hint(str) ⇒ Object



433
434
435
# File 'lib/review/topbuilder.rb', line 433

def inline_hint(str)
  "◆→ヒントスタイルここから←◆#{str}◆→ヒントスタイルここまで←◆"
end

#inline_i(str) ⇒ Object



453
454
455
# File 'lib/review/topbuilder.rb', line 453

def inline_i(str)
  "#{str}"
end

#inline_icon(id) ⇒ Object



481
482
483
484
485
486
487
488
# File 'lib/review/topbuilder.rb', line 481

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



441
442
443
# File 'lib/review/topbuilder.rb', line 441

def inline_idx(str)
  "#{str}◆→索引項目:#{str}←◆"
end

#inline_img(id) ⇒ Object



320
321
322
323
324
325
326
327
# File 'lib/review/topbuilder.rb', line 320

def inline_img(id)
  chapter, id = extract_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



494
495
496
# File 'lib/review/topbuilder.rb', line 494

def inline_keytop(str)
  "#{str}◆→キートップ#{str}←◆"
end

#inline_labelref(idref) ⇒ Object Also known as: inline_ref



767
768
769
# File 'lib/review/topbuilder.rb', line 767

def inline_labelref(idref)
  %Q(「◆→#{idref}←◆」) # 節、項を参照
end

#inline_list(id) ⇒ Object



232
233
234
235
236
237
238
239
240
# File 'lib/review/topbuilder.rb', line 232

def inline_list(id)
  chapter, id = extract_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



506
507
508
# File 'lib/review/topbuilder.rb', line 506

def inline_m(str)
  %Q[◆→TeX式ここから←◆#{str}◆→TeX式ここまで←◆]
end

#inline_maru(str) ⇒ Object



437
438
439
# File 'lib/review/topbuilder.rb', line 437

def inline_maru(str)
  "#{str}◆→丸数字#{str}←◆"
end

#inline_pageref(idref) ⇒ Object



773
774
775
# File 'lib/review/topbuilder.rb', line 773

def inline_pageref(idref)
  %Q(●ページ◆→#{idref}←◆) # ページ番号を参照
end

#inline_raw(str) ⇒ Object



429
430
431
# File 'lib/review/topbuilder.rb', line 429

def inline_raw(str)
  %Q[#{super(str).gsub("\\n", "\n")}]
end

#inline_sub(str) ⇒ Object



425
426
427
# File 'lib/review/topbuilder.rb', line 425

def inline_sub(str)
  "#{str}◆→DTP連絡:「#{str}」は下付き←◆"
end

#inline_sup(str) ⇒ Object



421
422
423
# File 'lib/review/topbuilder.rb', line 421

def inline_sup(str)
  "#{str}◆→DTP連絡:「#{str}」は上付き←◆"
end

#inline_table(id) ⇒ Object



311
312
313
314
315
316
317
318
# File 'lib/review/topbuilder.rb', line 311

def inline_table(id)
  chapter, id = extract_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



463
464
465
# File 'lib/review/topbuilder.rb', line 463

def inline_tt(str)
  "#{str}"
end

#inline_ttb(str) ⇒ Object Also known as: inline_ttbold



467
468
469
# File 'lib/review/topbuilder.rb', line 467

def inline_ttb(str)
  "#{str}☆◆→等幅フォント太字←◆"
end

#inline_tti(str) ⇒ Object



473
474
475
# File 'lib/review/topbuilder.rb', line 473

def inline_tti(str)
  "#{str}☆◆→等幅フォントイタ←◆"
end

#inline_ttibold(str) ⇒ Object



763
764
765
# File 'lib/review/topbuilder.rb', line 763

def inline_ttibold(str)
  "#{str}☆◆→等幅フォント太字イタ←◆"
end

#inline_u(str) ⇒ Object



477
478
479
# File 'lib/review/topbuilder.rb', line 477

def inline_u(str)
  "#{str}@◆→@〜@部分に下線←◆"
end

#inline_uchar(str) ⇒ Object



502
503
504
# File 'lib/review/topbuilder.rb', line 502

def inline_uchar(str)
  [str.to_i(16)].pack("U")
end

#insideout_begin(level, label, caption) ⇒ Object



572
573
574
# File 'lib/review/topbuilder.rb', line 572

def insideout_begin(level, label, caption)
  common_column_begin("insideout", caption)
end

#insideout_end(level) ⇒ Object



576
577
578
# File 'lib/review/topbuilder.rb', line 576

def insideout_end(level)
  common_column_end("insideout")
end

#insn(lines, caption = nil) ⇒ Object Also known as: box



672
673
674
# File 'lib/review/topbuilder.rb', line 672

def insn(lines, caption = nil)
  base_block "insn", lines, caption
end

#label(id) ⇒ Object



696
697
698
699
# File 'lib/review/topbuilder.rb', line 696

def label(id)
  # FIXME
  ""
end


644
645
646
# File 'lib/review/topbuilder.rb', line 644

def link(lines, caption = nil)
  base_parablock "link", lines, caption
end

#list_body(id, lines, lang) ⇒ Object



253
254
255
256
257
258
259
# File 'lib/review/topbuilder.rb', line 253

def list_body(id, lines, lang)
  lines.each do |line|
    puts detab(line)
  end
  puts "◆→終了:#{@titles["list"]}←◆"
  blank
end

#list_header(id, caption, lang) ⇒ Object



242
243
244
245
246
247
248
249
250
251
# File 'lib/review/topbuilder.rb', line 242

def list_header(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



295
296
297
298
299
300
301
# File 'lib/review/topbuilder.rb', line 295

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



608
609
610
# File 'lib/review/topbuilder.rb', line 608

def memo(lines, caption = nil)
  base_parablock "memo", lines, caption
end

#messagesObject



132
133
134
# File 'lib/review/topbuilder.rb', line 132

def messages
  error_messages() + warning_messages()
end

#nofunc_text(str) ⇒ Object



784
785
786
# File 'lib/review/topbuilder.rb', line 784

def nofunc_text(str)
  str
end

#noindentObject



510
511
512
# File 'lib/review/topbuilder.rb', line 510

def noindent
  puts "◆→DTP連絡:次の1行インデントなし←◆"
end

#nonum_begin(level, label, caption) ⇒ Object



514
515
516
# File 'lib/review/topbuilder.rb', line 514

def nonum_begin(level, label, caption)
  puts "■H#{level}#{compile_inline(caption)}"
end

#nonum_end(level) ⇒ Object



518
519
# File 'lib/review/topbuilder.rb', line 518

def nonum_end(level)
end

#note(lines, caption = nil) ⇒ Object



604
605
606
# File 'lib/review/topbuilder.rb', line 604

def note(lines, caption = nil)
  base_parablock "note", lines, caption
end

#notice(lines, caption = nil) ⇒ Object



648
649
650
# File 'lib/review/topbuilder.rb', line 648

def notice(lines, caption = nil)
  base_parablock "notice", lines, caption
end

#ol_beginObject



187
188
189
190
# File 'lib/review/topbuilder.rb', line 187

def ol_begin
  blank
  @olitem = 0
end

#ol_endObject



196
197
198
199
# File 'lib/review/topbuilder.rb', line 196

def ol_end
  blank
  @olitem = nil
end

#ol_item(lines, num) ⇒ Object



192
193
194
# File 'lib/review/topbuilder.rb', line 192

def ol_item(lines, num)
  puts "#{num}\t#{lines.join}"
end

#paragraph(lines) ⇒ Object



219
220
221
# File 'lib/review/topbuilder.rb', line 219

def paragraph(lines)
  puts lines.join
end

#planning(lines, caption = nil) ⇒ Object



620
621
622
# File 'lib/review/topbuilder.rb', line 620

def planning(lines, caption = nil)
  base_parablock "planning", lines, caption
end

#point(lines, caption = nil) ⇒ Object



652
653
654
# File 'lib/review/topbuilder.rb', line 652

def point(lines, caption = nil)
  base_parablock "point", lines, caption
end

#post_paragraphObject



41
42
43
# File 'lib/review/topbuilder.rb', line 41

def post_paragraph
  ''
end

#practice(lines) ⇒ Object



664
665
666
# File 'lib/review/topbuilder.rb', line 664

def practice(lines)
  base_parablock "practice", lines, nil
end

#pre_paragraphObject



37
38
39
# File 'lib/review/topbuilder.rb', line 37

def pre_paragraph
  ''
end

#quote(lines) ⇒ Object



307
308
309
# File 'lib/review/topbuilder.rb', line 307

def quote(lines)
  base_parablock "quote", lines, nil
end

#read(lines) ⇒ Object Also known as: lead



223
224
225
226
227
228
# File 'lib/review/topbuilder.rb', line 223

def read(lines)
  puts "◆→開始:#{@titles["lead"]}←◆"
  puts split_paragraph(lines).join("\n")
  puts "◆→終了:#{@titles["lead"]}←◆"
  blank
end

#ref_begin(level, label, caption) ⇒ Object



580
581
582
# File 'lib/review/topbuilder.rb', line 580

def ref_begin(level, label, caption)
  common_column_begin("ref", caption)
end

#ref_end(level) ⇒ Object



584
585
586
# File 'lib/review/topbuilder.rb', line 584

def ref_end(level)
  common_column_end("ref")
end

#reference(lines) ⇒ Object



660
661
662
# File 'lib/review/topbuilder.rb', line 660

def reference(lines)
  base_parablock "reference", lines, nil
end

#resultObject



120
121
122
# File 'lib/review/topbuilder.rb', line 120

def result
  @output.string
end

#security(lines, caption = nil) ⇒ Object



632
633
634
# File 'lib/review/topbuilder.rb', line 632

def security(lines, caption = nil)
  base_parablock "security", lines, caption
end

#shoot(lines, caption = nil) ⇒ Object



656
657
658
# File 'lib/review/topbuilder.rb', line 656

def shoot(lines, caption = nil)
  base_parablock "shoot", lines, caption
end

#source(lines, caption = nil, lang = nil) ⇒ Object



759
760
761
# File 'lib/review/topbuilder.rb', line 759

def source(lines, caption = nil, lang = nil)
  base_block "source", lines, caption
end

#sup_begin(level, label, caption) ⇒ Object



588
589
590
# File 'lib/review/topbuilder.rb', line 588

def sup_begin(level, label, caption)
  common_column_begin("sup", caption)
end

#sup_end(level) ⇒ Object



592
593
594
# File 'lib/review/topbuilder.rb', line 592

def sup_end(level)
  common_column_end("sup")
end

#table_begin(ncols) ⇒ Object



367
368
# File 'lib/review/topbuilder.rb', line 367

def table_begin(ncols)
end

#table_endObject



382
383
384
385
# File 'lib/review/topbuilder.rb', line 382

def table_end
  puts "◆→終了:#{@titles["table"]}←◆"
  blank
end

#table_header(id, caption) ⇒ Object



356
357
358
359
360
361
362
363
364
365
# File 'lib/review/topbuilder.rb', line 356

def table_header(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

#td(str) ⇒ Object



378
379
380
# File 'lib/review/topbuilder.rb', line 378

def td(str)
  str
end

#term(lines) ⇒ Object



640
641
642
# File 'lib/review/topbuilder.rb', line 640

def term(lines)
  base_parablock "term", lines, nil
end

#texequation(lines) ⇒ Object



349
350
351
352
353
354
# File 'lib/review/topbuilder.rb', line 349

def texequation(lines)
  puts "◆→開始:#{@titles["texequation"]}←◆"
  puts "#{lines.join("\n")}"
  puts "◆→終了:#{@titles["texequation"]}←◆"
  blank
end

#text(str) ⇒ Object



732
733
734
# File 'lib/review/topbuilder.rb', line 732

def text(str)
  str
end

#th(str) ⇒ Object



374
375
376
# File 'lib/review/topbuilder.rb', line 374

def th(str)
  "#{str}"
end

#tip(lines, caption = nil) ⇒ Object



612
613
614
# File 'lib/review/topbuilder.rb', line 612

def tip(lines, caption = nil)
  base_parablock "tip", lines, caption
end

#tr(rows) ⇒ Object



370
371
372
# File 'lib/review/topbuilder.rb', line 370

def tr(rows)
  puts rows.join("\t")
end

#tsize(id) ⇒ Object



701
702
703
704
# File 'lib/review/topbuilder.rb', line 701

def tsize(id)
  # FIXME
  ""
end

#ul_beginObject



175
176
177
# File 'lib/review/topbuilder.rb', line 175

def ul_begin
  blank
end

#ul_endObject



183
184
185
# File 'lib/review/topbuilder.rb', line 183

def ul_end
  blank
end

#ul_item(lines) ⇒ Object



179
180
181
# File 'lib/review/topbuilder.rb', line 179

def ul_item(lines)
  puts "●\t#{lines.join}"
end

#warn(msg) ⇒ Object



124
125
126
# File 'lib/review/topbuilder.rb', line 124

def warn(msg)
  $stderr.puts "#{@location.filename}:#{@location.lineno}: warning: #{msg}"
end

#warning(lines, caption = nil) ⇒ Object



676
677
678
# File 'lib/review/topbuilder.rb', line 676

def warning(lines, caption = nil)
  base_parablock "warning", lines, caption
end

#world_begin(level, label, caption) ⇒ Object



548
549
550
# File 'lib/review/topbuilder.rb', line 548

def world_begin(level, label, caption)
  common_column_begin("world", caption)
end

#world_end(level) ⇒ Object



552
553
554
# File 'lib/review/topbuilder.rb', line 552

def world_end(level)
  common_column_end("world")
end

#xcolumn_begin(level, label, caption) ⇒ Object



540
541
542
# File 'lib/review/topbuilder.rb', line 540

def xcolumn_begin(level, label, caption)
  common_column_begin("xcolumn", caption)
end

#xcolumn_end(level) ⇒ Object



544
545
546
# File 'lib/review/topbuilder.rb', line 544

def xcolumn_end(level)
  common_column_end("xcolumn")
end