Class: ReVIEW::PLAINTEXTBuilder
Constant Summary
Constants inherited
from Builder
Builder::CAPTION_TITLES
Instance Attribute Summary
Attributes inherited from Builder
#doc_status
Instance Method Summary
collapse
-
#base_block(_type, lines, caption = nil) ⇒ Object
-
#base_parablock(_type, lines, caption = nil) ⇒ Object
-
#best(lines, caption = nil) ⇒ Object
-
#bibpaper(lines, id, caption) ⇒ Object
-
#bibpaper_bibpaper(_id, _caption, lines) ⇒ Object
-
#bibpaper_header(id, caption) ⇒ 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
-
#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
-
#imgtable(_lines, id, caption = nil, _metric = nil) ⇒ Object
-
#important(lines, caption = nil) ⇒ Object
-
#indepimage(_lines, _id, caption = nil, _metric = nil) ⇒ Object
(also: #numberlessimage)
-
#info(lines, caption = nil) ⇒ Object
-
#inline_balloon(str) ⇒ Object
-
#inline_bib(id) ⇒ Object
-
#inline_br(_str) ⇒ Object
-
#inline_chap(id) ⇒ Object
-
#inline_chapref(id) ⇒ Object
-
#inline_comment(_str) ⇒ Object
-
#inline_del(_str) ⇒ Object
-
#inline_dtp(_str) ⇒ Object
-
#inline_fn(id) ⇒ Object
-
#inline_hd_chap(chap, id) ⇒ Object
-
#inline_hidx(_str) ⇒ Object
-
#inline_icon(_id) ⇒ Object
-
#inline_labelref(_idref) ⇒ Object
(also: #inline_ref)
-
#inline_pageref(_idref) ⇒ Object
-
#inline_raw(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(lines, id, caption, lang = nil) ⇒ Object
-
#list_body(_id, lines, _lang) ⇒ Object
-
#list_header(id, caption, _lang) ⇒ Object
-
#listnum(lines, id, caption, lang = nil) ⇒ Object
-
#listnum_body(lines, _lang) ⇒ Object
-
#memo(lines, caption = nil) ⇒ Object
-
#nodisp_begin(level, label, caption) ⇒ Object
-
#nodisp_end(level) ⇒ Object
-
#nofunc_text(str) ⇒ Object
(also: #th, #td, #inline_sup, #inline_sub, #inline_hint, #inline_maru, #inline_idx, #inline_ami, #inline_i, #inline_em, #inline_b, #inline_strong, #inline_tt, #inline_code, #inline_ttb, #inline_ttbold, #inline_tti, #inline_ttibold, #inline_u, #inline_bou, #inline_keytop, #inline_m)
-
#noindent ⇒ Object
-
#nonum_begin(_level, _label, caption) ⇒ Object
-
#nonum_end(_level) ⇒ Object
-
#note(lines, caption = nil) ⇒ Object
-
#notice(lines, caption = nil) ⇒ Object
-
#notoc_begin(_level, _label, caption) ⇒ Object
-
#notoc_end(level) ⇒ Object
-
#ol_begin ⇒ Object
-
#ol_end ⇒ Object
-
#ol_item(lines, num) ⇒ Object
-
#olnum(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(lines, id = nil, caption = nil, noblank = nil) ⇒ Object
-
#table_begin(_ncols) ⇒ Object
-
#table_end ⇒ Object
-
#table_header(id, caption) ⇒ Object
-
#term(lines) ⇒ Object
-
#texequation(lines, id = nil, caption = '') ⇒ Object
-
#texequation_header(id, caption) ⇒ Object
-
#text(str) ⇒ Object
-
#tip(lines, caption = nil) ⇒ Object
-
#tr(rows) ⇒ Object
-
#ul_begin ⇒ Object
-
#ul_end ⇒ Object
-
#ul_item(lines) ⇒ Object
-
#warning(lines, caption = nil) ⇒ 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
#add_space?, #defer_math_image, #detab, #join_lines_to_paragraph, #split_paragraph
Methods inherited from Builder
#bind, #blankline, #captionblock, #compile_inline, #detab, #embed, #emtable, #error, #escape, #extract_chapter_id, #firstlinenum, #get_chap, #graph, #graph_aafigure, #graph_blockdiag, #graph_gnuplot, #graph_graphviz, #graph_plantuml, #handle_metric, #highlight?, #image_ext, #initialize, #inline_column, #inline_column_chap, #inline_embed, #inline_eq, #inline_hd, #inline_href, #inline_img, #inline_imgref, #inline_include, #inline_kw, #inline_list, #inline_ruby, #inline_table, #inline_tcy, #inline_title, #inline_w, #inline_wb, #line_num, #load_words, #over_secnolevel?, #parse_metric, #parse_table_rows, #raw, #result_metric, #system_graph, #table_row_separator_regexp, #table_rows, #target_name, #tsize, #ul_item_begin, #ul_item_end, #warn
Instance Method Details
#base_block(_type, lines, caption = nil) ⇒ Object
166
167
168
169
170
171
|
# File 'lib/review/plaintextbuilder.rb', line 166
def base_block(_type, lines, caption = nil)
blank
puts compile_inline(caption) if caption.present?
puts lines.join("\n")
blank
end
|
#base_parablock(_type, lines, caption = nil) ⇒ Object
173
174
175
176
177
178
|
# File 'lib/review/plaintextbuilder.rb', line 173
def base_parablock(_type, lines, caption = nil)
blank
puts compile_inline(caption) if caption.present?
puts split_paragraph(lines).join("\n")
blank
end
|
#best(lines, caption = nil) ⇒ Object
493
494
495
|
# File 'lib/review/plaintextbuilder.rb', line 493
def best(lines, caption = nil)
base_parablock('best', lines, caption)
end
|
#bibpaper(lines, id, caption) ⇒ Object
338
339
340
341
|
# File 'lib/review/plaintextbuilder.rb', line 338
def bibpaper(lines, id, caption)
(id, caption)
bibpaper_bibpaper(id, caption, lines) unless lines.empty?
end
|
#bibpaper_bibpaper(_id, _caption, lines) ⇒ Object
348
349
350
|
# File 'lib/review/plaintextbuilder.rb', line 348
def bibpaper_bibpaper(_id, _caption, lines)
puts split_paragraph(lines).join("\n")
end
|
343
344
345
346
|
# File 'lib/review/plaintextbuilder.rb', line 343
def (id, caption)
print @chapter.bibpaper(id).number
puts " #{compile_inline(caption)}"
end
|
#bpo(lines) ⇒ Object
566
567
568
|
# File 'lib/review/plaintextbuilder.rb', line 566
def bpo(lines)
base_block('bpo', lines, nil)
end
|
#caution(lines, caption = nil) ⇒ Object
505
506
507
|
# File 'lib/review/plaintextbuilder.rb', line 505
def caution(lines, caption = nil)
base_parablock('caution', lines, caption)
end
|
#centering(lines) ⇒ Object
469
470
471
|
# File 'lib/review/plaintextbuilder.rb', line 469
def centering(lines)
base_parablock('centering', lines, nil)
end
|
#circle_begin(_level, _label, caption) ⇒ Object
630
631
632
|
# File 'lib/review/plaintextbuilder.rb', line 630
def circle_begin(_level, _label, caption)
puts "・#{caption}"
end
|
#circle_end(level) ⇒ Object
634
635
|
# File 'lib/review/plaintextbuilder.rb', line 634
def circle_end(level)
end
|
#cmd(lines, caption = nil) ⇒ Object
211
212
213
|
# File 'lib/review/plaintextbuilder.rb', line 211
def cmd(lines, caption = nil)
base_block('cmd', lines, caption)
end
|
#column_begin(_level, _label, caption) ⇒ Object
401
402
403
|
# File 'lib/review/plaintextbuilder.rb', line 401
def column_begin(_level, _label, caption)
common_column_begin('column', caption)
end
|
#column_end(_level) ⇒ Object
405
406
407
|
# File 'lib/review/plaintextbuilder.rb', line 405
def column_end(_level)
common_column_end('column')
end
|
281
282
|
# File 'lib/review/plaintextbuilder.rb', line 281
def (lines, = nil)
end
|
#common_column_begin(_type, caption) ⇒ Object
392
393
394
395
|
# File 'lib/review/plaintextbuilder.rb', line 392
def common_column_begin(_type, caption)
blank
puts compile_inline(caption)
end
|
#common_column_end(_type) ⇒ Object
397
398
399
|
# File 'lib/review/plaintextbuilder.rb', line 397
def common_column_end(_type)
blank
end
|
#compile_href(url, label) ⇒ Object
306
307
308
309
310
311
312
|
# File 'lib/review/plaintextbuilder.rb', line 306
def compile_href(url, label)
if label
"#{label}(#{url})"
else
url
end
end
|
#compile_kw(word, alt) ⇒ Object
298
299
300
301
302
303
304
|
# File 'lib/review/plaintextbuilder.rb', line 298
def compile_kw(word, alt)
if alt
"#{word}(#{alt.strip})"
else
word
end
end
|
#compile_ruby(base, _ruby) ⇒ Object
294
295
296
|
# File 'lib/review/plaintextbuilder.rb', line 294
def compile_ruby(base, _ruby)
base
end
|
#dd(lines) ⇒ Object
119
120
121
122
123
|
# File 'lib/review/plaintextbuilder.rb', line 119
def dd(lines)
split_paragraph(lines).each do |paragraph|
puts paragraph.gsub(/\n/, '')
end
end
|
111
112
113
|
# File 'lib/review/plaintextbuilder.rb', line 111
def dl_begin
blank
end
|
125
126
127
|
# File 'lib/review/plaintextbuilder.rb', line 125
def dl_end
blank
end
|
115
116
117
|
# File 'lib/review/plaintextbuilder.rb', line 115
def dt(line)
puts line
end
|
563
564
|
# File 'lib/review/plaintextbuilder.rb', line 563
def dtp(str)
end
|
#edition_begin(_level, _label, caption) ⇒ Object
433
434
435
|
# File 'lib/review/plaintextbuilder.rb', line 433
def edition_begin(_level, _label, caption)
common_column_begin('edition', caption)
end
|
#edition_end(_level) ⇒ Object
437
438
439
|
# File 'lib/review/plaintextbuilder.rb', line 437
def edition_end(_level)
common_column_end('edition')
end
|
#emlist(lines, caption = nil, _lang = nil) ⇒ Object
180
181
182
|
# File 'lib/review/plaintextbuilder.rb', line 180
def emlist(lines, caption = nil, _lang = nil)
base_block('emlist', lines, caption)
end
|
#emlistnum(lines, caption = nil, _lang = nil) ⇒ Object
184
185
186
187
188
189
190
191
|
# File 'lib/review/plaintextbuilder.rb', line 184
def emlistnum(lines, caption = nil, _lang = nil)
blank
puts compile_inline(caption) if caption.present?
lines.each_with_index do |line, i|
puts((i + 1).to_s.rjust(2) + ": #{line}")
end
blank
end
|
#expert(lines) ⇒ Object
537
538
539
|
# File 'lib/review/plaintextbuilder.rb', line 537
def expert(lines)
base_parablock('expert', lines, nil)
end
|
40
41
42
|
# File 'lib/review/plaintextbuilder.rb', line 40
def extname
'.txt'
end
|
#flushright(lines) ⇒ Object
465
466
467
|
# File 'lib/review/plaintextbuilder.rb', line 465
def flushright(lines)
base_parablock('flushright', lines, nil)
end
|
284
285
286
|
# File 'lib/review/plaintextbuilder.rb', line 284
def (id, str)
puts "注#{@chapter.(id).number} #{compile_inline(str)}"
end
|
#headline(level, _label, caption) ⇒ Object
80
81
82
83
|
# File 'lib/review/plaintextbuilder.rb', line 80
def headline(level, _label, caption)
prefix, _anchor = headline_prefix(level)
puts %Q(#{prefix}#{compile_inline(caption)})
end
|
#hood_begin(_level, _label, caption) ⇒ Object
425
426
427
|
# File 'lib/review/plaintextbuilder.rb', line 425
def hood_begin(_level, _label, caption)
common_column_begin('hood', caption)
end
|
#hood_end(_level) ⇒ Object
429
430
431
|
# File 'lib/review/plaintextbuilder.rb', line 429
def hood_end(_level)
common_column_end('hood')
end
|
#image(_lines, id, caption, _metric = nil) ⇒ Object
219
220
221
222
223
224
225
226
227
|
# File 'lib/review/plaintextbuilder.rb', line 219
def image(_lines, id, caption, _metric = nil)
blank
if get_chap
puts "#{I18n.t('image')}#{I18n.t('format_number', [get_chap, @chapter.image(id).number])}#{I18n.t('caption_prefix_idgxml')}#{compile_inline(caption)}"
else
puts "#{I18n.t('image')}#{I18n.t('format_number_without_chapter', [@chapter.image(id).number])}#{I18n.t('caption_prefix_idgxml')}#{compile_inline(caption)}"
end
blank
end
|
#imgtable(_lines, id, caption = nil, _metric = nil) ⇒ Object
267
268
269
270
271
|
# File 'lib/review/plaintextbuilder.rb', line 267
def imgtable(_lines, id, caption = nil, _metric = nil)
blank
(id, caption) if caption.present?
blank
end
|
#important(lines, caption = nil) ⇒ Object
497
498
499
|
# File 'lib/review/plaintextbuilder.rb', line 497
def important(lines, caption = nil)
base_parablock('important', lines, caption)
end
|
#indepimage(_lines, _id, caption = nil, _metric = nil) ⇒ Object
Also known as:
numberlessimage
551
552
553
554
555
|
# File 'lib/review/plaintextbuilder.rb', line 551
def indepimage(_lines, _id, caption = nil, _metric = nil)
blank
puts "図 #{compile_inline(caption)}" if caption.present?
blank
end
|
#info(lines, caption = nil) ⇒ Object
485
486
487
|
# File 'lib/review/plaintextbuilder.rb', line 485
def info(lines, caption = nil)
base_parablock('info', lines, caption)
end
|
#inline_balloon(str) ⇒ Object
326
327
328
|
# File 'lib/review/plaintextbuilder.rb', line 326
def inline_balloon(str)
%Q(←#{str.gsub(/@maru\[(\d+)\]/, inline_maru('\1'))})
end
|
#inline_bib(id) ⇒ Object
352
353
354
355
356
|
# File 'lib/review/plaintextbuilder.rb', line 352
def inline_bib(id)
%Q(#{@chapter.bibpaper(id).number} )
rescue KeyError
error "unknown bib: #{id}"
end
|
#inline_br(_str) ⇒ Object
578
579
580
|
# File 'lib/review/plaintextbuilder.rb', line 578
def inline_br(_str)
"\n"
end
|
#inline_chap(id) ⇒ Object
586
587
588
589
590
|
# File 'lib/review/plaintextbuilder.rb', line 586
def inline_chap(id)
super
end
|
#inline_chapref(id) ⇒ Object
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
|
# File 'lib/review/plaintextbuilder.rb', line 592
def inline_chapref(id)
if @book.config.check_version('2', exception: false)
chs = ['', '「', '」']
if @book.config['chapref']
chs2 = @book.config['chapref'].split(',')
if chs2.size != 3
error '--chapsplitter must have exactly 3 parameters with comma.'
end
chs = chs2
end
"#{chs[0]}#{@book.chapter_index.number(id)}#{chs[1]}#{@book.chapter_index.title(id)}#{chs[2]}"
else
title = super
if @book.config['chapterlink']
%Q(<link href="#{id}">#{title}</link>)
else
title
end
end
rescue KeyError
error "unknown chapter: #{id}"
end
|
334
335
336
|
# File 'lib/review/plaintextbuilder.rb', line 334
def (_str)
''
end
|
#inline_del(_str) ⇒ Object
574
575
576
|
# File 'lib/review/plaintextbuilder.rb', line 574
def inline_del(_str)
''
end
|
#inline_dtp(_str) ⇒ Object
570
571
572
|
# File 'lib/review/plaintextbuilder.rb', line 570
def inline_dtp(_str)
''
end
|
#inline_fn(id) ⇒ Object
288
289
290
291
292
|
# File 'lib/review/plaintextbuilder.rb', line 288
def inline_fn(id)
" 注#{@chapter.(id).number} "
rescue KeyError
error "unknown footnote: #{id}"
end
|
#inline_hd_chap(chap, id) ⇒ Object
358
359
360
361
362
363
364
365
366
367
|
# File 'lib/review/plaintextbuilder.rb', line 358
def inline_hd_chap(chap, id)
n = chap.headline_index.number(id)
if n.present? && chap.number && over_secnolevel?(n)
I18n.t('hd_quote', [n, compile_inline(chap.headline(id).caption)])
else
I18n.t('hd_quote_without_number', compile_inline(chap.headline(id).caption))
end
rescue KeyError
error "unknown headline: #{id}"
end
|
#inline_hidx(_str) ⇒ Object
318
319
320
|
# File 'lib/review/plaintextbuilder.rb', line 318
def inline_hidx(_str)
''
end
|
#inline_icon(_id) ⇒ Object
322
323
324
|
# File 'lib/review/plaintextbuilder.rb', line 322
def inline_icon(_id)
''
end
|
#inline_labelref(_idref) ⇒ Object
Also known as:
inline_ref
620
621
622
|
# File 'lib/review/plaintextbuilder.rb', line 620
def inline_labelref(_idref)
'●'
end
|
626
627
628
|
# File 'lib/review/plaintextbuilder.rb', line 626
def (_idref)
'●ページ' end
|
#inline_raw(str) ⇒ Object
314
315
316
|
# File 'lib/review/plaintextbuilder.rb', line 314
def inline_raw(str)
super(str).gsub('\\n', "\n")
end
|
#inline_uchar(str) ⇒ Object
330
331
332
|
# File 'lib/review/plaintextbuilder.rb', line 330
def inline_uchar(str)
[str.to_i(16)].pack('U')
end
|
#insideout_begin(_level, _label, caption) ⇒ Object
441
442
443
|
# File 'lib/review/plaintextbuilder.rb', line 441
def insideout_begin(_level, _label, caption)
common_column_begin('insideout', caption)
end
|
#insideout_end(_level) ⇒ Object
445
446
447
|
# File 'lib/review/plaintextbuilder.rb', line 445
def insideout_end(_level)
common_column_end('insideout')
end
|
#insn(lines, caption = nil) ⇒ Object
Also known as:
box
541
542
543
|
# File 'lib/review/plaintextbuilder.rb', line 541
def insn(lines, caption = nil)
base_block('insn', lines, caption)
end
|
#label(_id) ⇒ Object
559
560
561
|
# File 'lib/review/plaintextbuilder.rb', line 559
def label(_id)
''
end
|
#link(lines, caption = nil) ⇒ Object
513
514
515
|
# File 'lib/review/plaintextbuilder.rb', line 513
def link(lines, caption = nil)
base_parablock('link', lines, caption)
end
|
#list(lines, id, caption, lang = nil) ⇒ Object
140
141
142
143
144
145
146
147
148
149
150
|
# File 'lib/review/plaintextbuilder.rb', line 140
def list(lines, id, caption, lang = nil)
blank
begin
(id, caption, lang)
rescue KeyError
error "no such list: #{id}"
end
blank
list_body(id, lines, lang)
blank
end
|
#list_body(_id, lines, _lang) ⇒ Object
160
161
162
163
164
|
# File 'lib/review/plaintextbuilder.rb', line 160
def list_body(_id, lines, _lang)
lines.each do |line|
puts detab(line)
end
end
|
152
153
154
155
156
157
158
|
# File 'lib/review/plaintextbuilder.rb', line 152
def (id, caption, _lang)
if get_chap
puts %Q(#{I18n.t('list')}#{I18n.t('format_number', [get_chap, @chapter.list(id).number])}#{I18n.t('caption_prefix_idgxml')}#{compile_inline(caption)})
else
puts %Q(#{I18n.t('list')}#{I18n.t('format_number_without_chapter', [@chapter.list(id).number])}#{I18n.t('caption_prefix_idgxml')}#{compile_inline(caption)})
end
end
|
#listnum(lines, id, caption, lang = nil) ⇒ Object
193
194
195
196
197
198
199
200
201
202
203
|
# File 'lib/review/plaintextbuilder.rb', line 193
def listnum(lines, id, caption, lang = nil)
blank
begin
(id, caption, lang)
rescue KeyError
error "no such list: #{id}"
end
blank
listnum_body(lines, lang)
blank
end
|
#listnum_body(lines, _lang) ⇒ Object
205
206
207
208
209
|
# File 'lib/review/plaintextbuilder.rb', line 205
def listnum_body(lines, _lang)
lines.each_with_index do |line, i|
puts((i + 1).to_s.rjust(2) + ": #{line}")
end
end
|
#memo(lines, caption = nil) ⇒ Object
477
478
479
|
# File 'lib/review/plaintextbuilder.rb', line 477
def memo(lines, caption = nil)
base_parablock('memo', lines, caption)
end
|
#nodisp_begin(level, label, caption) ⇒ Object
386
387
|
# File 'lib/review/plaintextbuilder.rb', line 386
def nodisp_begin(level, label, caption)
end
|
#nodisp_end(level) ⇒ Object
389
390
|
# File 'lib/review/plaintextbuilder.rb', line 389
def nodisp_end(level)
end
|
#nofunc_text(str) ⇒ Object
Also known as:
th, td, inline_sup, inline_sub, inline_hint, inline_maru, inline_idx, inline_ami, inline_i, inline_em, inline_b, inline_strong, inline_tt, inline_code, inline_ttb, inline_ttbold, inline_tti, inline_ttibold, inline_u, inline_bou, inline_keytop, inline_m
637
638
639
|
# File 'lib/review/plaintextbuilder.rb', line 637
def nofunc_text(str)
str
end
|
369
370
|
# File 'lib/review/plaintextbuilder.rb', line 369
def noindent
end
|
#nonum_begin(_level, _label, caption) ⇒ Object
372
373
374
|
# File 'lib/review/plaintextbuilder.rb', line 372
def nonum_begin(_level, _label, caption)
puts compile_inline(caption)
end
|
#nonum_end(_level) ⇒ Object
376
377
|
# File 'lib/review/plaintextbuilder.rb', line 376
def nonum_end(_level)
end
|
#note(lines, caption = nil) ⇒ Object
473
474
475
|
# File 'lib/review/plaintextbuilder.rb', line 473
def note(lines, caption = nil)
base_parablock('note', lines, caption)
end
|
#notice(lines, caption = nil) ⇒ Object
517
518
519
|
# File 'lib/review/plaintextbuilder.rb', line 517
def notice(lines, caption = nil)
base_parablock('notice', lines, caption)
end
|
#notoc_begin(_level, _label, caption) ⇒ Object
379
380
381
|
# File 'lib/review/plaintextbuilder.rb', line 379
def notoc_begin(_level, _label, caption)
puts compile_inline(caption)
end
|
#notoc_end(level) ⇒ Object
383
384
|
# File 'lib/review/plaintextbuilder.rb', line 383
def notoc_end(level)
end
|
97
98
99
100
|
# File 'lib/review/plaintextbuilder.rb', line 97
def ol_begin
blank
@olitem = 0
end
|
106
107
108
109
|
# File 'lib/review/plaintextbuilder.rb', line 106
def ol_end
blank
@olitem = nil
end
|
#ol_item(lines, num) ⇒ Object
102
103
104
|
# File 'lib/review/plaintextbuilder.rb', line 102
def ol_item(lines, num)
puts "#{num} #{join_lines_to_paragraph(lines)}"
end
|
#olnum(num) ⇒ Object
54
55
56
|
# File 'lib/review/plaintextbuilder.rb', line 54
def olnum(num)
@ol_num = num.to_i
end
|
#paragraph(lines) ⇒ Object
129
130
131
|
# File 'lib/review/plaintextbuilder.rb', line 129
def paragraph(lines)
puts join_lines_to_paragraph(lines)
end
|
#planning(lines, caption = nil) ⇒ Object
489
490
491
|
# File 'lib/review/plaintextbuilder.rb', line 489
def planning(lines, caption = nil)
base_parablock('planning', lines, caption)
end
|
#point(lines, caption = nil) ⇒ Object
521
522
523
|
# File 'lib/review/plaintextbuilder.rb', line 521
def point(lines, caption = nil)
base_parablock('point', lines, caption)
end
|
#post_paragraph ⇒ Object
36
37
38
|
# File 'lib/review/plaintextbuilder.rb', line 36
def post_paragraph
''
end
|
#practice(lines) ⇒ Object
533
534
535
|
# File 'lib/review/plaintextbuilder.rb', line 533
def practice(lines)
base_parablock('practice', lines, nil)
end
|
#pre_paragraph ⇒ Object
32
33
34
|
# File 'lib/review/plaintextbuilder.rb', line 32
def pre_paragraph
''
end
|
#quote(lines) ⇒ Object
215
216
217
|
# File 'lib/review/plaintextbuilder.rb', line 215
def quote(lines)
base_parablock('quote', lines, nil)
end
|
#read(lines) ⇒ Object
Also known as:
lead
133
134
135
136
|
# File 'lib/review/plaintextbuilder.rb', line 133
def read(lines)
puts split_paragraph(lines).join("\n")
blank
end
|
#ref_begin(_level, _label, caption) ⇒ Object
449
450
451
|
# File 'lib/review/plaintextbuilder.rb', line 449
def ref_begin(_level, _label, caption)
common_column_begin('ref', caption)
end
|
#ref_end(_level) ⇒ Object
453
454
455
|
# File 'lib/review/plaintextbuilder.rb', line 453
def ref_end(_level)
common_column_end('ref')
end
|
#reference(lines) ⇒ Object
529
530
531
|
# File 'lib/review/plaintextbuilder.rb', line 529
def reference(lines)
base_parablock('reference', lines, nil)
end
|
76
77
78
|
# File 'lib/review/plaintextbuilder.rb', line 76
def result
@output.string
end
|
#security(lines, caption = nil) ⇒ Object
501
502
503
|
# File 'lib/review/plaintextbuilder.rb', line 501
def security(lines, caption = nil)
base_parablock('security', lines, caption)
end
|
#shoot(lines, caption = nil) ⇒ Object
525
526
527
|
# File 'lib/review/plaintextbuilder.rb', line 525
def shoot(lines, caption = nil)
base_parablock('shoot', lines, caption)
end
|
#source(lines, caption = nil, _lang = nil) ⇒ Object
616
617
618
|
# File 'lib/review/plaintextbuilder.rb', line 616
def source(lines, caption = nil, _lang = nil)
base_block('source', lines, caption)
end
|
#sup_begin(_level, _label, caption) ⇒ Object
457
458
459
|
# File 'lib/review/plaintextbuilder.rb', line 457
def sup_begin(_level, _label, caption)
common_column_begin('sup', caption)
end
|
#sup_end(_level) ⇒ Object
461
462
463
|
# File 'lib/review/plaintextbuilder.rb', line 461
def sup_end(_level)
common_column_end('sup')
end
|
#table(lines, id = nil, caption = nil, noblank = nil) ⇒ Object
246
247
248
249
250
251
|
# File 'lib/review/plaintextbuilder.rb', line 246
def table(lines, id = nil, caption = nil, noblank = nil)
unless noblank
blank
end
super(lines, id, caption)
end
|
#table_begin(_ncols) ⇒ Object
264
265
|
# File 'lib/review/plaintextbuilder.rb', line 264
def table_begin(_ncols)
end
|
#table_end ⇒ Object
277
278
279
|
# File 'lib/review/plaintextbuilder.rb', line 277
def table_end
blank
end
|
253
254
255
256
257
258
259
260
261
262
|
# File 'lib/review/plaintextbuilder.rb', line 253
def (id, caption)
if id.nil?
puts compile_inline(caption)
elsif get_chap
puts "#{I18n.t('table')}#{I18n.t('format_number', [get_chap, @chapter.table(id).number])}#{I18n.t('caption_prefix_idgxml')}#{compile_inline(caption)}"
else
puts "#{I18n.t('table')}#{I18n.t('format_number_without_chapter', [@chapter.table(id).number])}#{I18n.t('caption_prefix_idgxml')}#{compile_inline(caption)}"
end
blank
end
|
#term(lines) ⇒ Object
509
510
511
|
# File 'lib/review/plaintextbuilder.rb', line 509
def term(lines)
base_parablock('term', lines, nil)
end
|
#texequation(lines, id = nil, caption = '') ⇒ Object
229
230
231
232
233
234
|
# File 'lib/review/plaintextbuilder.rb', line 229
def texequation(lines, id = nil, caption = '')
blank
(id, caption)
puts lines.join("\n")
blank
end
|
236
237
238
239
240
241
242
243
244
|
# File 'lib/review/plaintextbuilder.rb', line 236
def (id, caption)
if id
if get_chap
puts "#{I18n.t('equation')}#{I18n.t('format_number', [get_chap, @chapter.equation(id).number])}#{I18n.t('caption_prefix_idgxml')}#{compile_inline(caption)}"
else
puts "#{I18n.t('equation')}#{I18n.t('format_number_without_chapter', [@chapter.equation(id).number])}#{I18n.t('caption_prefix_idgxml')}#{compile_inline(caption)}"
end
end
end
|
#text(str) ⇒ Object
582
583
584
|
# File 'lib/review/plaintextbuilder.rb', line 582
def text(str)
str
end
|
#tip(lines, caption = nil) ⇒ Object
481
482
483
|
# File 'lib/review/plaintextbuilder.rb', line 481
def tip(lines, caption = nil)
base_parablock('tip', lines, caption)
end
|
273
274
275
|
# File 'lib/review/plaintextbuilder.rb', line 273
def tr(rows)
puts rows.join("\t")
end
|
85
86
87
|
# File 'lib/review/plaintextbuilder.rb', line 85
def ul_begin
blank
end
|
93
94
95
|
# File 'lib/review/plaintextbuilder.rb', line 93
def ul_end
blank
end
|
#ul_item(lines) ⇒ Object
89
90
91
|
# File 'lib/review/plaintextbuilder.rb', line 89
def ul_item(lines)
puts join_lines_to_paragraph(lines)
end
|
#warning(lines, caption = nil) ⇒ Object
545
546
547
|
# File 'lib/review/plaintextbuilder.rb', line 545
def warning(lines, caption = nil)
base_parablock('warning', lines, caption)
end
|
#world_begin(_level, _label, caption) ⇒ Object
417
418
419
|
# File 'lib/review/plaintextbuilder.rb', line 417
def world_begin(_level, _label, caption)
common_column_begin('world', caption)
end
|
#world_end(_level) ⇒ Object
421
422
423
|
# File 'lib/review/plaintextbuilder.rb', line 421
def world_end(_level)
common_column_end('world')
end
|
#xcolumn_begin(_level, _label, caption) ⇒ Object
409
410
411
|
# File 'lib/review/plaintextbuilder.rb', line 409
def xcolumn_begin(_level, _label, caption)
common_column_begin('xcolumn', caption)
end
|
#xcolumn_end(_level) ⇒ Object
413
414
415
|
# File 'lib/review/plaintextbuilder.rb', line 413
def xcolumn_end(_level)
common_column_end('xcolumn')
end
|