class Opmac2html::ParBuilder
Paragraph builder
Constants
- ELEM
- ELEM_WITH_ATT
- LINK_SUBS
Public Class Methods
new()
click to toggle source
# File lib/opmac2html/par_builder.rb, line 10 def initialize @par = [] end
Public Instance Methods
add_code(code)
click to toggle source
# File lib/opmac2html/par_builder.rb, line 18 def add_code(code) @par << ELEM.call('code', code) end
add_em(text)
click to toggle source
# File lib/opmac2html/par_builder.rb, line 26 def add_em(text) @par << ELEM.call('em', text) end
add_link(address, text = nil)
click to toggle source
# File lib/opmac2html/par_builder.rb, line 34 def add_link(address, text = nil) address.gsub!(/\\[%#]/) { |c| LINK_SUBS[c] } @par << ELEM_WITH_ATT.call('a', 'href', address, text ? text : address) end
add_quote(quote)
click to toggle source
# File lib/opmac2html/par_builder.rb, line 22 def add_quote(quote) @par << "„#{quote}“" end
add_strong(text)
click to toggle source
# File lib/opmac2html/par_builder.rb, line 30 def add_strong(text) @par << ELEM.call('strong', text) end
add_verbatim(text)
click to toggle source
# File lib/opmac2html/par_builder.rb, line 39 def add_verbatim(text) @par << ELEM.call('pre', text) end
add_word(word)
click to toggle source
# File lib/opmac2html/par_builder.rb, line 14 def add_word(word) @par << word end
to_s()
click to toggle source
# File lib/opmac2html/par_builder.rb, line 43 def to_s @par.join end