Class: ReVIEW::TOPBuilder
Constant Summary
Constants inherited
from Builder
Builder::CAPTION_TITLES
Instance Attribute Summary
Attributes inherited from Builder
#ast, #output
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
-
#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
Methods inherited from Builder
#bibpaper, #bind, #captionblock, #detab, #extract_chapter_id, #get_chap, #graph, #handle_metric, #image_ext, #include, #initialize, #inline_column, #inline_href, #inline_include, #inline_kw, #inline_ruby, #inline_title, #list, #listnum, #node_inline_hd, #node_inline_img, #node_inline_imgref, #parse_metric, #print, #puts, #raw, #result, #result_metric, #table, #target_name, #ul_item_begin, #ul_item_end
Instance Method Details
#base_block(type, lines, caption = nil) ⇒ Object
249
250
251
252
253
254
255
256
257
258
|
# File 'lib/review/topbuilder.rb', line 249
def base_block(type, lines, caption = nil)
buf = ""
buf << "\n"
buf << "◆→開始:#{@titles[type]}←◆\n"
buf << "■#{caption}\n" unless caption.nil?
buf << lines.join("")
buf << "◆→終了:#{@titles[type]}←◆\n"
buf << "\n"
buf
end
|
#base_parablock(type, lines, caption = nil) ⇒ Object
260
261
262
263
264
265
266
267
268
|
# File 'lib/review/topbuilder.rb', line 260
def base_parablock(type, lines, caption = nil)
buf = ""
buf << "◆→開始:#{@titles[type]}←◆\n"
buf << "■#{caption}\n" unless caption.nil?
buf << lines.join("")
buf << "◆→終了:#{@titles[type]}←◆\n"
buf << "\n"
buf
end
|
#best(lines, caption = nil) ⇒ Object
632
633
634
|
# File 'lib/review/topbuilder.rb', line 632
def best(lines, caption = nil)
base_parablock "best", lines, caption
end
|
#bpo(lines) ⇒ Object
716
717
718
|
# File 'lib/review/topbuilder.rb', line 716
def bpo(lines)
base_block "bpo", lines, nil
end
|
#caution(lines, caption = nil) ⇒ Object
644
645
646
|
# File 'lib/review/topbuilder.rb', line 644
def caution(lines, caption = nil)
base_parablock "caution", lines, caption
end
|
#centering(lines) ⇒ Object
608
609
610
|
# File 'lib/review/topbuilder.rb', line 608
def centering(lines)
base_parablock "centering", lines, nil
end
|
#circle_begin(level, label, caption) ⇒ Object
783
784
785
|
# File 'lib/review/topbuilder.rb', line 783
def circle_begin(level, label, caption)
"・\t#{caption}\n"
end
|
#circle_end(level) ⇒ Object
787
788
|
# File 'lib/review/topbuilder.rb', line 787
def circle_end(level)
end
|
#cmd(lines, caption = nil) ⇒ Object
297
298
299
|
# File 'lib/review/topbuilder.rb', line 297
def cmd(lines, caption = nil)
base_block "cmd", lines, caption
end
|
#column_begin(level, label, caption) ⇒ Object
540
541
542
|
# File 'lib/review/topbuilder.rb', line 540
def column_begin(level, label, caption)
common_column_begin("column", caption)
end
|
#column_end(level) ⇒ Object
544
545
546
|
# File 'lib/review/topbuilder.rb', line 544
def column_end(level)
common_column_end("column")
end
|
392
393
394
395
396
397
|
# File 'lib/review/topbuilder.rb', line 392
def (lines, = nil)
lines ||= []
lines.unshift unless .blank?
str = lines.join("")
"◆→DTP連絡:#{str}←◆\n"
end
|
#common_column_begin(type, caption) ⇒ Object
526
527
528
529
530
531
|
# File 'lib/review/topbuilder.rb', line 526
def common_column_begin(type, caption)
buf = ""
buf << "◆→開始:#{@titles[type]}←◆\n"
buf << %Q[■#{caption}\n]
buf
end
|
#common_column_end(type) ⇒ Object
533
534
535
536
537
538
|
# File 'lib/review/topbuilder.rb', line 533
def common_column_end(type)
buf = ""
buf << %Q[◆→終了:#{@titles[type]}←◆\n]
buf << "\n"
buf
end
|
#compile_href(url, label) ⇒ Object
418
419
420
421
422
423
424
|
# File 'lib/review/topbuilder.rb', line 418
def compile_href(url, label)
if label.nil?
%Q[△#{url}☆]
else
%Q[#{label}(△#{url}☆)]
end
end
|
#compile_kw(word, alt) ⇒ Object
411
412
413
414
415
416
|
# File 'lib/review/topbuilder.rb', line 411
def compile_kw(word, alt)
if alt
then "★#{word}☆(#{alt.strip})"
else "★#{word}☆"
end
end
|
#compile_ruby(base, ruby) ⇒ Object
407
408
409
|
# File 'lib/review/topbuilder.rb', line 407
def compile_ruby(base, ruby)
"#{base}◆→DTP連絡:「#{base}」に「#{ruby}」とルビ←◆"
end
|
#dd(lines) ⇒ Object
190
191
192
193
194
195
196
|
# File 'lib/review/topbuilder.rb', line 190
def dd(lines)
buf = ""
lines.each do |paragraph|
buf << "\t#{paragraph.gsub(/\n/, '')}\n"
end
buf
end
|
182
183
184
|
# File 'lib/review/topbuilder.rb', line 182
def dl_begin
"\n"
end
|
198
199
200
|
# File 'lib/review/topbuilder.rb', line 198
def dl_end
"\n"
end
|
186
187
188
|
# File 'lib/review/topbuilder.rb', line 186
def dt(line)
"★#{line}☆\n"
end
|
712
713
714
|
# File 'lib/review/topbuilder.rb', line 712
def dtp(str)
end
|
#edition_begin(level, label, caption) ⇒ Object
572
573
574
|
# File 'lib/review/topbuilder.rb', line 572
def edition_begin(level, label, caption)
common_column_begin("edition", caption)
end
|
#edition_end(level) ⇒ Object
576
577
578
|
# File 'lib/review/topbuilder.rb', line 576
def edition_end(level)
common_column_end("edition")
end
|
#emlist(lines, caption = nil, lang = nil) ⇒ Object
270
271
272
|
# File 'lib/review/topbuilder.rb', line 270
def emlist(lines, caption = nil, lang = nil)
base_block "emlist", lines, caption
end
|
#emlistnum(lines, caption = nil, lang = nil) ⇒ Object
274
275
276
277
278
279
280
281
282
283
284
285
|
# File 'lib/review/topbuilder.rb', line 274
def emlistnum(lines, caption = nil, lang = nil)
buf = ""
buf << "◆→開始:#{@titles["emlist"]}←◆\n"
buf << "■#{caption}\n" unless caption.nil?
_lines = []
lines.each_with_index do |line, i|
buf << (i + 1).to_s.rjust(2) + ": #{line}\n"
end
buf << "◆→終了:#{@titles["emlist"]}←◆\n"
buf << "\n"
buf
end
|
#error(msg) ⇒ Object
108
109
110
|
# File 'lib/review/topbuilder.rb', line 108
def error(msg)
$stderr.puts "#{@location.filename}:#{@location.lineno}: error: #{msg}"
end
|
#expert(lines) ⇒ Object
676
677
678
|
# File 'lib/review/topbuilder.rb', line 676
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
604
605
606
|
# File 'lib/review/topbuilder.rb', line 604
def flushright(lines)
base_parablock "flushright", lines, nil
end
|
399
400
401
|
# File 'lib/review/topbuilder.rb', line 399
def (id, str)
"【注#{@chapter.(id).number}】#{str}\n"
end
|
#headline(level, label, caption) ⇒ Object
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
# File 'lib/review/topbuilder.rb', line 116
def headline(level, label, caption)
buf = ""
prefix = ""
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"])
buf << "■H#{level}■#{prefix}#{caption}\n"
buf
end
|
#hood_begin(level, label, caption) ⇒ Object
564
565
566
|
# File 'lib/review/topbuilder.rb', line 564
def hood_begin(level, label, caption)
common_column_begin("hood", caption)
end
|
#hood_end(level) ⇒ Object
568
569
570
|
# File 'lib/review/topbuilder.rb', line 568
def hood_end(level)
common_column_end("hood")
end
|
#image(lines, id, caption, metric = nil) ⇒ Object
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
|
# File 'lib/review/topbuilder.rb', line 323
def image(lines, id, caption, metric=nil)
buf = ""
buf << "◆→開始:#{@titles["image"]}←◆\n"
if get_chap.nil?
buf << "#{I18n.t("image")}#{I18n.t("format_number_without_chapter", [@chapter.image(id).number])}#{I18n.t("caption_prefix_idgxml")}#{caption}\n"
else
buf << "#{I18n.t("image")}#{I18n.t("format_number", [get_chap, @chapter.image(id).number])}#{I18n.t("caption_prefix_idgxml")}#{caption}\n"
end
buf << "\n"
if @chapter.image(id).bound?
buf << "◆→#{@chapter.image(id).path}←◆\n"
else
lines.each do |line|
buf << line << "\n"
end
end
buf << "◆→終了:#{@titles["image"]}←◆\n"
buf << "\n"
buf
end
|
#important(lines, caption = nil) ⇒ Object
636
637
638
|
# File 'lib/review/topbuilder.rb', line 636
def important(lines, caption = nil)
base_parablock "important", lines, caption
end
|
#indepimage(id, caption = nil, metric = nil) ⇒ Object
Also known as:
numberlessimage
686
687
688
689
690
691
692
693
694
695
696
697
698
|
# File 'lib/review/topbuilder.rb', line 686
def indepimage(id, caption=nil, metric=nil)
buf = ""
buf << "\n"
begin
buf << "◆→画像 #{@chapter.image(id).path.sub(/\A\.\//, "")} #{metric.join(" ")}←◆\n"
rescue
warn "no such image: #{id}"
buf << "◆→画像 #{id}←◆\n"
end
buf << "図 #{caption}\n" if caption.present?
buf << "\n"
buf
end
|
#info(lines, caption = nil) ⇒ Object
624
625
626
|
# File 'lib/review/topbuilder.rb', line 624
def info(lines, caption = nil)
base_parablock "info", lines, caption
end
|
#inline_ami(str) ⇒ Object
454
455
456
|
# File 'lib/review/topbuilder.rb', line 454
def inline_ami(str)
"#{str}◆→DTP連絡:「#{str}」に網カケ←◆"
end
|
#inline_b(str) ⇒ Object
Also known as:
inline_strong
462
463
464
|
# File 'lib/review/topbuilder.rb', line 462
def inline_b(str)
"★#{str}☆"
end
|
#inline_balloon(str) ⇒ Object
503
504
505
|
# File 'lib/review/topbuilder.rb', line 503
def inline_balloon(str)
%Q(\t←#{str.gsub(/@maru\[(\d+)\]/, inline_maru('\1'))})
end
|
#inline_bou(str) ⇒ Object
495
496
497
|
# File 'lib/review/topbuilder.rb', line 495
def inline_bou(str)
"#{str}◆→DTP連絡:「#{str}」に傍点←◆"
end
|
#inline_br(str) ⇒ Object
734
735
736
|
# File 'lib/review/topbuilder.rb', line 734
def inline_br(str)
%Q(\n)
end
|
#inline_chap(id) ⇒ Object
742
743
744
745
746
|
# File 'lib/review/topbuilder.rb', line 742
def inline_chap(id)
super
end
|
#inline_chapref(id) ⇒ Object
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
|
# File 'lib/review/topbuilder.rb', line 748
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
730
731
732
|
# File 'lib/review/topbuilder.rb', line 730
def inline_code(str)
%Q[△#{str}☆]
end
|
#inline_del(str) ⇒ Object
725
726
727
728
|
# File 'lib/review/topbuilder.rb', line 725
def inline_del(str)
""
end
|
#inline_dtp(str) ⇒ Object
720
721
722
723
|
# File 'lib/review/topbuilder.rb', line 720
def inline_dtp(str)
""
end
|
#inline_fn(id) ⇒ Object
403
404
405
|
# File 'lib/review/topbuilder.rb', line 403
def inline_fn(id)
"【注#{@chapter.(id).number}】"
end
|
#inline_hidx(str) ⇒ Object
450
451
452
|
# File 'lib/review/topbuilder.rb', line 450
def inline_hidx(str)
"◆→索引項目:#{str}←◆"
end
|
#inline_hint(str) ⇒ Object
438
439
440
|
# File 'lib/review/topbuilder.rb', line 438
def inline_hint(str)
"◆→ヒントスタイルここから←◆#{str}◆→ヒントスタイルここまで←◆"
end
|
#inline_i(str) ⇒ Object
458
459
460
|
# File 'lib/review/topbuilder.rb', line 458
def inline_i(str)
"▲#{str}☆"
end
|
#inline_icon(id) ⇒ Object
486
487
488
489
490
491
492
493
|
# File 'lib/review/topbuilder.rb', line 486
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
446
447
448
|
# File 'lib/review/topbuilder.rb', line 446
def inline_idx(str)
"#{str}◆→索引項目:#{str}←◆"
end
|
#inline_img(id) ⇒ Object
314
315
316
317
318
319
320
321
|
# File 'lib/review/topbuilder.rb', line 314
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
499
500
501
|
# File 'lib/review/topbuilder.rb', line 499
def inline_keytop(str)
"#{str}◆→キートップ#{str}←◆"
end
|
#inline_labelref(idref) ⇒ Object
Also known as:
inline_ref
773
774
775
|
# File 'lib/review/topbuilder.rb', line 773
def inline_labelref(idref)
%Q(「◆→#{idref}←◆」) end
|
#inline_list(id) ⇒ Object
217
218
219
220
221
222
223
224
|
# File 'lib/review/topbuilder.rb', line 217
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
511
512
513
|
# File 'lib/review/topbuilder.rb', line 511
def inline_m(str)
%Q[◆→TeX式ここから←◆#{str}◆→TeX式ここまで←◆]
end
|
#inline_maru(str) ⇒ Object
442
443
444
|
# File 'lib/review/topbuilder.rb', line 442
def inline_maru(str)
"#{str}◆→丸数字#{str}←◆"
end
|
779
780
781
|
# File 'lib/review/topbuilder.rb', line 779
def (idref)
%Q(●ページ◆→#{idref}←◆) end
|
#inline_raw(str) ⇒ Object
434
435
436
|
# File 'lib/review/topbuilder.rb', line 434
def inline_raw(str)
%Q[#{super(str).gsub("\\n", "\n")}]
end
|
#inline_sub(str) ⇒ Object
430
431
432
|
# File 'lib/review/topbuilder.rb', line 430
def inline_sub(str)
"#{str}◆→DTP連絡:「#{str}」は下付き←◆"
end
|
#inline_sup(str) ⇒ Object
426
427
428
|
# File 'lib/review/topbuilder.rb', line 426
def inline_sup(str)
"#{str}◆→DTP連絡:「#{str}」は上付き←◆"
end
|
#inline_table(id) ⇒ Object
305
306
307
308
309
310
311
312
|
# File 'lib/review/topbuilder.rb', line 305
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
468
469
470
|
# File 'lib/review/topbuilder.rb', line 468
def inline_tt(str)
"△#{str}☆"
end
|
#inline_ttb(str) ⇒ Object
Also known as:
inline_ttbold
472
473
474
|
# File 'lib/review/topbuilder.rb', line 472
def inline_ttb(str)
"★#{str}☆◆→等幅フォント太字←◆"
end
|
#inline_tti(str) ⇒ Object
478
479
480
|
# File 'lib/review/topbuilder.rb', line 478
def inline_tti(str)
"▲#{str}☆◆→等幅フォントイタ←◆"
end
|
#inline_ttibold(str) ⇒ Object
769
770
771
|
# File 'lib/review/topbuilder.rb', line 769
def inline_ttibold(str)
"▲#{str}☆◆→等幅フォント太字イタ←◆"
end
|
#inline_u(str) ⇒ Object
482
483
484
|
# File 'lib/review/topbuilder.rb', line 482
def inline_u(str)
"@#{str}@◆→@〜@部分に下線←◆"
end
|
#inline_uchar(str) ⇒ Object
507
508
509
|
# File 'lib/review/topbuilder.rb', line 507
def inline_uchar(str)
[str.to_i(16)].pack("U")
end
|
#insideout_begin(level, label, caption) ⇒ Object
580
581
582
|
# File 'lib/review/topbuilder.rb', line 580
def insideout_begin(level, label, caption)
common_column_begin("insideout", caption)
end
|
#insideout_end(level) ⇒ Object
584
585
586
|
# File 'lib/review/topbuilder.rb', line 584
def insideout_end(level)
common_column_end("insideout")
end
|
#insn(lines, caption = nil) ⇒ Object
Also known as:
box
680
681
682
|
# File 'lib/review/topbuilder.rb', line 680
def insn(lines, caption = nil)
base_block "insn", lines, caption
end
|
#label(id) ⇒ Object
702
703
704
705
|
# File 'lib/review/topbuilder.rb', line 702
def label(id)
""
end
|
#link(lines, caption = nil) ⇒ Object
652
653
654
|
# File 'lib/review/topbuilder.rb', line 652
def link(lines, caption = nil)
base_parablock "link", lines, caption
end
|
#list_body(id, lines, lang) ⇒ Object
239
240
241
242
243
244
245
246
247
|
# File 'lib/review/topbuilder.rb', line 239
def list_body(id, lines, lang)
buf = ""
lines.each do |line|
buf << detab(line) << "\n"
end
buf << "◆→終了:#{@titles["list"]}←◆\n"
buf << "\n"
buf
end
|
226
227
228
229
230
231
232
233
234
235
236
237
|
# File 'lib/review/topbuilder.rb', line 226
def (id, caption, lang)
buf = ""
buf << "◆→開始:#{@titles["list"]}←◆\n"
if get_chap.nil?
buf << %Q[#{I18n.t("list")}#{I18n.t("format_number_without_chapter", [@chapter.list(id).number])}#{I18n.t("caption_prefix_idgxml")}#{caption}] << "\n"
else
buf << %Q[#{I18n.t("list")}#{I18n.t("format_number", [get_chap, @chapter.list(id).number])}#{I18n.t("caption_prefix_idgxml")}#{caption}] << "\n"
end
buf << "\n"
buf
end
|
#listnum_body(lines, lang) ⇒ Object
287
288
289
290
291
292
293
294
295
|
# File 'lib/review/topbuilder.rb', line 287
def listnum_body(lines, lang)
buf = ""
lines.each_with_index do |line, i|
buf << (i + 1).to_s.rjust(2) + ": #{line}\n"
end
buf << "◆→終了:#{@titles["list"]}←◆\n"
buf << "\n"
buf
end
|
#memo(lines, caption = nil) ⇒ Object
616
617
618
|
# File 'lib/review/topbuilder.rb', line 616
def memo(lines, caption = nil)
base_parablock "memo", lines, caption
end
|
112
113
114
|
# File 'lib/review/topbuilder.rb', line 112
def messages
error_messages() + warning_messages()
end
|
#nofunc_text(str) ⇒ Object
790
791
792
|
# File 'lib/review/topbuilder.rb', line 790
def nofunc_text(str)
str
end
|
515
516
517
|
# File 'lib/review/topbuilder.rb', line 515
def noindent
"◆→DTP連絡:次の1行インデントなし←◆\n"
end
|
#nonum_begin(level, label, caption) ⇒ Object
519
520
521
|
# File 'lib/review/topbuilder.rb', line 519
def nonum_begin(level, label, caption)
"■H#{level}■#{caption}\n"
end
|
#nonum_end(level) ⇒ Object
523
524
|
# File 'lib/review/topbuilder.rb', line 523
def nonum_end(level)
end
|
#note(lines, caption = nil) ⇒ Object
612
613
614
|
# File 'lib/review/topbuilder.rb', line 612
def note(lines, caption = nil)
base_parablock "note", lines, caption
end
|
#notice(lines, caption = nil) ⇒ Object
656
657
658
|
# File 'lib/review/topbuilder.rb', line 656
def notice(lines, caption = nil)
base_parablock "notice", lines, caption
end
|
168
169
170
171
|
# File 'lib/review/topbuilder.rb', line 168
def ol_begin
@olitem = 0
"\n"
end
|
177
178
179
180
|
# File 'lib/review/topbuilder.rb', line 177
def ol_end
@olitem = nil
"\n"
end
|
#ol_item(lines, num) ⇒ Object
173
174
175
|
# File 'lib/review/topbuilder.rb', line 173
def ol_item(lines, num)
"#{num}\t#{lines.join}\n"
end
|
#paragraph(lines) ⇒ Object
202
203
204
|
# File 'lib/review/topbuilder.rb', line 202
def paragraph(lines)
lines.join+"\n"
end
|
#planning(lines, caption = nil) ⇒ Object
628
629
630
|
# File 'lib/review/topbuilder.rb', line 628
def planning(lines, caption = nil)
base_parablock "planning", lines, caption
end
|
#point(lines, caption = nil) ⇒ Object
660
661
662
|
# File 'lib/review/topbuilder.rb', line 660
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
672
673
674
|
# File 'lib/review/topbuilder.rb', line 672
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
301
302
303
|
# File 'lib/review/topbuilder.rb', line 301
def quote(lines)
base_parablock "quote", lines, nil
end
|
#read(lines) ⇒ Object
Also known as:
lead
206
207
208
209
210
211
212
213
|
# File 'lib/review/topbuilder.rb', line 206
def read(lines)
buf = ""
buf << "◆→開始:#{@titles["lead"]}←◆\n"
buf << lines.join("\n") << "\n"
buf << "◆→終了:#{@titles["lead"]}←◆\n"
buf << "\n"
buf
end
|
#ref_begin(level, label, caption) ⇒ Object
588
589
590
|
# File 'lib/review/topbuilder.rb', line 588
def ref_begin(level, label, caption)
common_column_begin("ref", caption)
end
|
#ref_end(level) ⇒ Object
592
593
594
|
# File 'lib/review/topbuilder.rb', line 592
def ref_end(level)
common_column_end("ref")
end
|
#reference(lines) ⇒ Object
668
669
670
|
# File 'lib/review/topbuilder.rb', line 668
def reference(lines)
base_parablock "reference", lines, nil
end
|
#security(lines, caption = nil) ⇒ Object
640
641
642
|
# File 'lib/review/topbuilder.rb', line 640
def security(lines, caption = nil)
base_parablock "security", lines, caption
end
|
#shoot(lines, caption = nil) ⇒ Object
664
665
666
|
# File 'lib/review/topbuilder.rb', line 664
def shoot(lines, caption = nil)
base_parablock "shoot", lines, caption
end
|
#source(lines, caption = nil, lang = nil) ⇒ Object
765
766
767
|
# File 'lib/review/topbuilder.rb', line 765
def source(lines, caption = nil, lang = nil)
base_block "source", lines, caption
end
|
#sup_begin(level, label, caption) ⇒ Object
596
597
598
|
# File 'lib/review/topbuilder.rb', line 596
def sup_begin(level, label, caption)
common_column_begin("sup", caption)
end
|
#sup_end(level) ⇒ Object
600
601
602
|
# File 'lib/review/topbuilder.rb', line 600
def sup_end(level)
common_column_end("sup")
end
|
#table_begin(ncols) ⇒ Object
367
368
369
|
# File 'lib/review/topbuilder.rb', line 367
def table_begin(ncols)
""
end
|
#table_end ⇒ Object
385
386
387
388
389
390
|
# File 'lib/review/topbuilder.rb', line 385
def table_end
buf = ""
buf << "◆→終了:#{@titles["table"]}←◆\n"
buf << "\n"
buf
end
|
354
355
356
357
358
359
360
361
362
363
364
365
|
# File 'lib/review/topbuilder.rb', line 354
def (id, caption)
buf = ""
buf << "\n"
buf << "◆→開始:#{@titles["table"]}←◆\n"
if get_chap.nil?
buf << "#{I18n.t("table")}#{I18n.t("format_number_without_chapter", [@chapter.table(id).number])}#{I18n.t("caption_prefix_idgxml")}#{caption}\n"
else
buf << "#{I18n.t("table")}#{I18n.t("format_number", [get_chap, @chapter.table(id).number])}#{I18n.t("caption_prefix_idgxml")}#{caption}\n"
end
buf << "\n"
buf
end
|
381
382
383
|
# File 'lib/review/topbuilder.rb', line 381
def td(str)
str
end
|
#term(lines) ⇒ Object
648
649
650
|
# File 'lib/review/topbuilder.rb', line 648
def term(lines)
base_parablock "term", lines, nil
end
|
#texequation(lines) ⇒ Object
345
346
347
348
349
350
351
352
|
# File 'lib/review/topbuilder.rb', line 345
def texequation(lines)
buf = ""
buf << "◆→開始:#{@titles["texequation"]}←◆\n"
buf << "#{lines.join("\n")}\n"
buf << "◆→終了:#{@titles["texequation"]}←◆\n"
buf << "\n"
buf
end
|
#text(str) ⇒ Object
738
739
740
|
# File 'lib/review/topbuilder.rb', line 738
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
620
621
622
|
# File 'lib/review/topbuilder.rb', line 620
def tip(lines, caption = nil)
base_parablock "tip", lines, caption
end
|
371
372
373
374
375
|
# File 'lib/review/topbuilder.rb', line 371
def tr(rows)
buf = ""
buf << rows.join("\t") << "\n"
buf
end
|
#tsize(id) ⇒ Object
707
708
709
710
|
# File 'lib/review/topbuilder.rb', line 707
def tsize(id)
""
end
|
156
157
158
|
# File 'lib/review/topbuilder.rb', line 156
def ul_begin
"\n"
end
|
164
165
166
|
# File 'lib/review/topbuilder.rb', line 164
def ul_end
"\n"
end
|
#ul_item(lines) ⇒ Object
160
161
162
|
# File 'lib/review/topbuilder.rb', line 160
def ul_item(lines)
"●\t#{lines.join}\n"
end
|
#warn(msg) ⇒ Object
104
105
106
|
# File 'lib/review/topbuilder.rb', line 104
def warn(msg)
$stderr.puts "#{@location.filename}:#{@location.lineno}: warning: #{msg}"
end
|
#world_begin(level, label, caption) ⇒ Object
556
557
558
|
# File 'lib/review/topbuilder.rb', line 556
def world_begin(level, label, caption)
common_column_begin("world", caption)
end
|
#world_end(level) ⇒ Object
560
561
562
|
# File 'lib/review/topbuilder.rb', line 560
def world_end(level)
common_column_end("world")
end
|
#xcolumn_begin(level, label, caption) ⇒ Object
548
549
550
|
# File 'lib/review/topbuilder.rb', line 548
def xcolumn_begin(level, label, caption)
common_column_begin("xcolumn", caption)
end
|
#xcolumn_end(level) ⇒ Object
552
553
554
|
# File 'lib/review/topbuilder.rb', line 552
def xcolumn_end(level)
common_column_end("xcolumn")
end
|