Class: AsciiMath::HTMLBuilder
- Inherits:
-
MarkupBuilder
- Object
- MarkupBuilder
- AsciiMath::HTMLBuilder
- Defined in:
- lib/asciimath/html.rb
Instance Method Summary collapse
- #append_expression(expression, attrs = {}) ⇒ Object
-
#initialize(opts = {}) ⇒ HTMLBuilder
constructor
A new instance of HTMLBuilder.
- #to_s ⇒ Object
Methods inherited from MarkupBuilder
add_default_display_symbols, default_display_symbol_table
Constructor Details
#initialize(opts = {}) ⇒ HTMLBuilder
Returns a new instance of HTMLBuilder.
6 7 8 9 10 11 12 |
# File 'lib/asciimath/html.rb', line 6 def initialize(opts = {}) super(opts[:symbol_table] || ::AsciiMath::MarkupBuilder.default_display_symbol_table(fix_phi: opts.fetch(:fix_phi, true))) @prefix = opts[:prefifx] || '' @inline = opts[:inline] @escape_non_ascii = opts.fetch(:escape_non_ascii, true) @html = '' end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &block) ⇒ Object (private)
208 209 210 |
# File 'lib/asciimath/html.rb', line 208 def method_missing(meth, *args, &block) tag(meth, *args, &block) end |
Instance Method Details
#append_expression(expression, attrs = {}) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/asciimath/html.rb', line 18 def append_expression(expression, attrs = {}) if @inline inline('', attrs) do append(expression, :row => :omit) end else block('', attrs) do append(expression, :row => :omit) end end end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/asciimath/html.rb', line 14 def to_s @html end |