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, #caption_top?, #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
172
173
174
175
176
177
178
179
180
181
182
|
# File 'lib/review/plaintextbuilder.rb', line 172
def base_block(_type, lines, caption = nil)
blank
if caption_top?('list') && caption.present?
puts compile_inline(caption)
end
puts lines.join("\n")
if !caption_top?('list') && caption.present?
puts compile_inline(caption)
end
blank
end
|
#base_parablock(_type, lines, caption = nil) ⇒ Object
184
185
186
187
188
189
|
# File 'lib/review/plaintextbuilder.rb', line 184
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
523
524
525
|
# File 'lib/review/plaintextbuilder.rb', line 523
def best(lines, caption = nil)
base_parablock('best', lines, caption)
end
|
#bibpaper(lines, id, caption) ⇒ Object
368
369
370
371
|
# File 'lib/review/plaintextbuilder.rb', line 368
def bibpaper(lines, id, caption)
(id, caption)
bibpaper_bibpaper(id, caption, lines) unless lines.empty?
end
|
#bibpaper_bibpaper(_id, _caption, lines) ⇒ Object
378
379
380
|
# File 'lib/review/plaintextbuilder.rb', line 378
def bibpaper_bibpaper(_id, _caption, lines)
puts split_paragraph(lines).join("\n")
end
|
373
374
375
376
|
# File 'lib/review/plaintextbuilder.rb', line 373
def (id, caption)
print @chapter.bibpaper(id).number
puts " #{compile_inline(caption)}"
end
|
#bpo(lines) ⇒ Object
596
597
598
|
# File 'lib/review/plaintextbuilder.rb', line 596
def bpo(lines)
base_block('bpo', lines, nil)
end
|
#caution(lines, caption = nil) ⇒ Object
535
536
537
|
# File 'lib/review/plaintextbuilder.rb', line 535
def caution(lines, caption = nil)
base_parablock('caution', lines, caption)
end
|
#centering(lines) ⇒ Object
499
500
501
|
# File 'lib/review/plaintextbuilder.rb', line 499
def centering(lines)
base_parablock('centering', lines, nil)
end
|
#circle_begin(_level, _label, caption) ⇒ Object
660
661
662
|
# File 'lib/review/plaintextbuilder.rb', line 660
def circle_begin(_level, _label, caption)
puts "・#{caption}"
end
|
#circle_end(level) ⇒ Object
664
665
|
# File 'lib/review/plaintextbuilder.rb', line 664
def circle_end(level)
end
|
#cmd(lines, caption = nil) ⇒ Object
233
234
235
|
# File 'lib/review/plaintextbuilder.rb', line 233
def cmd(lines, caption = nil)
base_block('cmd', lines, caption)
end
|
#column_begin(_level, _label, caption) ⇒ Object
431
432
433
|
# File 'lib/review/plaintextbuilder.rb', line 431
def column_begin(_level, _label, caption)
common_column_begin('column', caption)
end
|
#column_end(_level) ⇒ Object
435
436
437
|
# File 'lib/review/plaintextbuilder.rb', line 435
def column_end(_level)
common_column_end('column')
end
|
311
312
|
# File 'lib/review/plaintextbuilder.rb', line 311
def (lines, = nil)
end
|
#common_column_begin(_type, caption) ⇒ Object
422
423
424
425
|
# File 'lib/review/plaintextbuilder.rb', line 422
def common_column_begin(_type, caption)
blank
puts compile_inline(caption)
end
|
#common_column_end(_type) ⇒ Object
427
428
429
|
# File 'lib/review/plaintextbuilder.rb', line 427
def common_column_end(_type)
blank
end
|
#compile_href(url, label) ⇒ Object
336
337
338
339
340
341
342
|
# File 'lib/review/plaintextbuilder.rb', line 336
def compile_href(url, label)
if label
"#{label}(#{url})"
else
url
end
end
|
#compile_kw(word, alt) ⇒ Object
328
329
330
331
332
333
334
|
# File 'lib/review/plaintextbuilder.rb', line 328
def compile_kw(word, alt)
if alt
"#{word}(#{alt.strip})"
else
word
end
end
|
#compile_ruby(base, _ruby) ⇒ Object
324
325
326
|
# File 'lib/review/plaintextbuilder.rb', line 324
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
|
593
594
|
# File 'lib/review/plaintextbuilder.rb', line 593
def dtp(str)
end
|
#edition_begin(_level, _label, caption) ⇒ Object
463
464
465
|
# File 'lib/review/plaintextbuilder.rb', line 463
def edition_begin(_level, _label, caption)
common_column_begin('edition', caption)
end
|
#edition_end(_level) ⇒ Object
467
468
469
|
# File 'lib/review/plaintextbuilder.rb', line 467
def edition_end(_level)
common_column_end('edition')
end
|
#emlist(lines, caption = nil, _lang = nil) ⇒ Object
191
192
193
|
# File 'lib/review/plaintextbuilder.rb', line 191
def emlist(lines, caption = nil, _lang = nil)
base_block('emlist', lines, caption)
end
|
#emlistnum(lines, caption = nil, _lang = nil) ⇒ Object
195
196
197
198
199
200
201
202
203
204
205
206
207
|
# File 'lib/review/plaintextbuilder.rb', line 195
def emlistnum(lines, caption = nil, _lang = nil)
blank
if caption_top?('list')
puts compile_inline(caption) if caption.present?
end
lines.each_with_index do |line, i|
puts((i + 1).to_s.rjust(2) + ": #{line}")
end
unless caption_top?('list')
puts compile_inline(caption) if caption.present?
end
blank
end
|
#expert(lines) ⇒ Object
567
568
569
|
# File 'lib/review/plaintextbuilder.rb', line 567
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
495
496
497
|
# File 'lib/review/plaintextbuilder.rb', line 495
def flushright(lines)
base_parablock('flushright', lines, nil)
end
|
314
315
316
|
# File 'lib/review/plaintextbuilder.rb', line 314
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
455
456
457
|
# File 'lib/review/plaintextbuilder.rb', line 455
def hood_begin(_level, _label, caption)
common_column_begin('hood', caption)
end
|
#hood_end(_level) ⇒ Object
459
460
461
|
# File 'lib/review/plaintextbuilder.rb', line 459
def hood_end(_level)
common_column_end('hood')
end
|
#image(_lines, id, caption, _metric = nil) ⇒ Object
241
242
243
244
245
246
247
248
249
|
# File 'lib/review/plaintextbuilder.rb', line 241
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
297
298
299
300
301
|
# File 'lib/review/plaintextbuilder.rb', line 297
def imgtable(_lines, id, caption = nil, _metric = nil)
blank
(id, caption) if caption.present?
blank
end
|
#important(lines, caption = nil) ⇒ Object
527
528
529
|
# File 'lib/review/plaintextbuilder.rb', line 527
def important(lines, caption = nil)
base_parablock('important', lines, caption)
end
|
#indepimage(_lines, _id, caption = nil, _metric = nil) ⇒ Object
Also known as:
numberlessimage
581
582
583
584
585
|
# File 'lib/review/plaintextbuilder.rb', line 581
def indepimage(_lines, _id, caption = nil, _metric = nil)
blank
puts "図 #{compile_inline(caption)}" if caption.present?
blank
end
|
#info(lines, caption = nil) ⇒ Object
515
516
517
|
# File 'lib/review/plaintextbuilder.rb', line 515
def info(lines, caption = nil)
base_parablock('info', lines, caption)
end
|
#inline_balloon(str) ⇒ Object
356
357
358
|
# File 'lib/review/plaintextbuilder.rb', line 356
def inline_balloon(str)
%Q(←#{str.gsub(/@maru\[(\d+)\]/, inline_maru('\1'))})
end
|
#inline_bib(id) ⇒ Object
382
383
384
385
386
|
# File 'lib/review/plaintextbuilder.rb', line 382
def inline_bib(id)
%Q(#{@chapter.bibpaper(id).number} )
rescue KeyError
error "unknown bib: #{id}"
end
|
#inline_br(_str) ⇒ Object
608
609
610
|
# File 'lib/review/plaintextbuilder.rb', line 608
def inline_br(_str)
"\n"
end
|
#inline_chap(id) ⇒ Object
616
617
618
619
620
|
# File 'lib/review/plaintextbuilder.rb', line 616
def inline_chap(id)
super
end
|
#inline_chapref(id) ⇒ Object
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
|
# File 'lib/review/plaintextbuilder.rb', line 622
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
|
364
365
366
|
# File 'lib/review/plaintextbuilder.rb', line 364
def (_str)
''
end
|
#inline_del(_str) ⇒ Object
604
605
606
|
# File 'lib/review/plaintextbuilder.rb', line 604
def inline_del(_str)
''
end
|
#inline_dtp(_str) ⇒ Object
600
601
602
|
# File 'lib/review/plaintextbuilder.rb', line 600
def inline_dtp(_str)
''
end
|
#inline_fn(id) ⇒ Object
318
319
320
321
322
|
# File 'lib/review/plaintextbuilder.rb', line 318
def inline_fn(id)
" 注#{@chapter.(id).number} "
rescue KeyError
error "unknown footnote: #{id}"
end
|
#inline_hd_chap(chap, id) ⇒ Object
388
389
390
391
392
393
394
395
396
397
|
# File 'lib/review/plaintextbuilder.rb', line 388
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
348
349
350
|
# File 'lib/review/plaintextbuilder.rb', line 348
def inline_hidx(_str)
''
end
|
#inline_icon(_id) ⇒ Object
352
353
354
|
# File 'lib/review/plaintextbuilder.rb', line 352
def inline_icon(_id)
''
end
|
#inline_labelref(_idref) ⇒ Object
Also known as:
inline_ref
650
651
652
|
# File 'lib/review/plaintextbuilder.rb', line 650
def inline_labelref(_idref)
'●'
end
|
656
657
658
|
# File 'lib/review/plaintextbuilder.rb', line 656
def (_idref)
'●ページ' end
|
#inline_raw(str) ⇒ Object
344
345
346
|
# File 'lib/review/plaintextbuilder.rb', line 344
def inline_raw(str)
super(str).gsub('\\n', "\n")
end
|
#inline_uchar(str) ⇒ Object
360
361
362
|
# File 'lib/review/plaintextbuilder.rb', line 360
def inline_uchar(str)
[str.to_i(16)].pack('U')
end
|
#insideout_begin(_level, _label, caption) ⇒ Object
471
472
473
|
# File 'lib/review/plaintextbuilder.rb', line 471
def insideout_begin(_level, _label, caption)
common_column_begin('insideout', caption)
end
|
#insideout_end(_level) ⇒ Object
475
476
477
|
# File 'lib/review/plaintextbuilder.rb', line 475
def insideout_end(_level)
common_column_end('insideout')
end
|
#insn(lines, caption = nil) ⇒ Object
Also known as:
box
571
572
573
|
# File 'lib/review/plaintextbuilder.rb', line 571
def insn(lines, caption = nil)
base_block('insn', lines, caption)
end
|
#label(_id) ⇒ Object
589
590
591
|
# File 'lib/review/plaintextbuilder.rb', line 589
def label(_id)
''
end
|
#link(lines, caption = nil) ⇒ Object
543
544
545
|
# File 'lib/review/plaintextbuilder.rb', line 543
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
151
152
153
154
155
156
|
# File 'lib/review/plaintextbuilder.rb', line 140
def list(lines, id, caption, lang = nil)
blank
begin
if caption_top?('list')
(id, caption, lang)
blank
end
list_body(id, lines, lang)
unless caption_top?('list')
blank
(id, caption, lang)
end
rescue KeyError
error "no such list: #{id}"
end
blank
end
|
#list_body(_id, lines, _lang) ⇒ Object
166
167
168
169
170
|
# File 'lib/review/plaintextbuilder.rb', line 166
def list_body(_id, lines, _lang)
lines.each do |line|
puts detab(line)
end
end
|
158
159
160
161
162
163
164
|
# File 'lib/review/plaintextbuilder.rb', line 158
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
|
# File 'lib/review/plaintextbuilder.rb', line 209
def listnum(lines, id, caption, lang = nil)
blank
begin
if caption_top?('list')
(id, caption, lang)
blank
end
listnum_body(lines, lang)
unless caption_top?('list')
blank
(id, caption, lang)
end
rescue KeyError
error "no such list: #{id}"
end
blank
end
|
#listnum_body(lines, _lang) ⇒ Object
227
228
229
230
231
|
# File 'lib/review/plaintextbuilder.rb', line 227
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
507
508
509
|
# File 'lib/review/plaintextbuilder.rb', line 507
def memo(lines, caption = nil)
base_parablock('memo', lines, caption)
end
|
#nodisp_begin(level, label, caption) ⇒ Object
416
417
|
# File 'lib/review/plaintextbuilder.rb', line 416
def nodisp_begin(level, label, caption)
end
|
#nodisp_end(level) ⇒ Object
419
420
|
# File 'lib/review/plaintextbuilder.rb', line 419
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
667
668
669
|
# File 'lib/review/plaintextbuilder.rb', line 667
def nofunc_text(str)
str
end
|
399
400
|
# File 'lib/review/plaintextbuilder.rb', line 399
def noindent
end
|
#nonum_begin(_level, _label, caption) ⇒ Object
402
403
404
|
# File 'lib/review/plaintextbuilder.rb', line 402
def nonum_begin(_level, _label, caption)
puts compile_inline(caption)
end
|
#nonum_end(_level) ⇒ Object
406
407
|
# File 'lib/review/plaintextbuilder.rb', line 406
def nonum_end(_level)
end
|
#note(lines, caption = nil) ⇒ Object
503
504
505
|
# File 'lib/review/plaintextbuilder.rb', line 503
def note(lines, caption = nil)
base_parablock('note', lines, caption)
end
|
#notice(lines, caption = nil) ⇒ Object
547
548
549
|
# File 'lib/review/plaintextbuilder.rb', line 547
def notice(lines, caption = nil)
base_parablock('notice', lines, caption)
end
|
#notoc_begin(_level, _label, caption) ⇒ Object
409
410
411
|
# File 'lib/review/plaintextbuilder.rb', line 409
def notoc_begin(_level, _label, caption)
puts compile_inline(caption)
end
|
#notoc_end(level) ⇒ Object
413
414
|
# File 'lib/review/plaintextbuilder.rb', line 413
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
519
520
521
|
# File 'lib/review/plaintextbuilder.rb', line 519
def planning(lines, caption = nil)
base_parablock('planning', lines, caption)
end
|
#point(lines, caption = nil) ⇒ Object
551
552
553
|
# File 'lib/review/plaintextbuilder.rb', line 551
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
563
564
565
|
# File 'lib/review/plaintextbuilder.rb', line 563
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
237
238
239
|
# File 'lib/review/plaintextbuilder.rb', line 237
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
479
480
481
|
# File 'lib/review/plaintextbuilder.rb', line 479
def ref_begin(_level, _label, caption)
common_column_begin('ref', caption)
end
|
#ref_end(_level) ⇒ Object
483
484
485
|
# File 'lib/review/plaintextbuilder.rb', line 483
def ref_end(_level)
common_column_end('ref')
end
|
#reference(lines) ⇒ Object
559
560
561
|
# File 'lib/review/plaintextbuilder.rb', line 559
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
531
532
533
|
# File 'lib/review/plaintextbuilder.rb', line 531
def security(lines, caption = nil)
base_parablock('security', lines, caption)
end
|
#shoot(lines, caption = nil) ⇒ Object
555
556
557
|
# File 'lib/review/plaintextbuilder.rb', line 555
def shoot(lines, caption = nil)
base_parablock('shoot', lines, caption)
end
|
#source(lines, caption = nil, _lang = nil) ⇒ Object
646
647
648
|
# File 'lib/review/plaintextbuilder.rb', line 646
def source(lines, caption = nil, _lang = nil)
base_block('source', lines, caption)
end
|
#sup_begin(_level, _label, caption) ⇒ Object
487
488
489
|
# File 'lib/review/plaintextbuilder.rb', line 487
def sup_begin(_level, _label, caption)
common_column_begin('sup', caption)
end
|
#sup_end(_level) ⇒ Object
491
492
493
|
# File 'lib/review/plaintextbuilder.rb', line 491
def sup_end(_level)
common_column_end('sup')
end
|
#table(lines, id = nil, caption = nil, noblank = nil) ⇒ Object
269
270
271
272
273
274
|
# File 'lib/review/plaintextbuilder.rb', line 269
def table(lines, id = nil, caption = nil, noblank = nil)
unless noblank
blank
end
super(lines, id, caption)
end
|
#table_begin(_ncols) ⇒ Object
294
295
|
# File 'lib/review/plaintextbuilder.rb', line 294
def table_begin(_ncols)
end
|
#table_end ⇒ Object
307
308
309
|
# File 'lib/review/plaintextbuilder.rb', line 307
def table_end
blank
end
|
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
|
# File 'lib/review/plaintextbuilder.rb', line 276
def (id, caption)
unless caption_top?('table')
blank
end
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
if caption_top?('table')
blank
end
end
|
#term(lines) ⇒ Object
539
540
541
|
# File 'lib/review/plaintextbuilder.rb', line 539
def term(lines)
base_parablock('term', lines, nil)
end
|
#texequation(lines, id = nil, caption = '') ⇒ Object
251
252
253
254
255
256
257
|
# File 'lib/review/plaintextbuilder.rb', line 251
def texequation(lines, id = nil, caption = '')
blank
(id, caption) if caption_top?('equation')
puts lines.join("\n")
(id, caption) unless caption_top?('equation')
blank
end
|
259
260
261
262
263
264
265
266
267
|
# File 'lib/review/plaintextbuilder.rb', line 259
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
612
613
614
|
# File 'lib/review/plaintextbuilder.rb', line 612
def text(str)
str
end
|
#tip(lines, caption = nil) ⇒ Object
511
512
513
|
# File 'lib/review/plaintextbuilder.rb', line 511
def tip(lines, caption = nil)
base_parablock('tip', lines, caption)
end
|
303
304
305
|
# File 'lib/review/plaintextbuilder.rb', line 303
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
|
#warning(lines, caption = nil) ⇒ Object
575
576
577
|
# File 'lib/review/plaintextbuilder.rb', line 575
def warning(lines, caption = nil)
base_parablock('warning', lines, caption)
end
|
#world_begin(_level, _label, caption) ⇒ Object
447
448
449
|
# File 'lib/review/plaintextbuilder.rb', line 447
def world_begin(_level, _label, caption)
common_column_begin('world', caption)
end
|
#world_end(_level) ⇒ Object
451
452
453
|
# File 'lib/review/plaintextbuilder.rb', line 451
def world_end(_level)
common_column_end('world')
end
|
#xcolumn_begin(_level, _label, caption) ⇒ Object
439
440
441
|
# File 'lib/review/plaintextbuilder.rb', line 439
def xcolumn_begin(_level, _label, caption)
common_column_begin('xcolumn', caption)
end
|
#xcolumn_end(_level) ⇒ Object
443
444
445
|
# File 'lib/review/plaintextbuilder.rb', line 443
def xcolumn_end(_level)
common_column_end('xcolumn')
end
|