class Zenithal::ZoticaParser

Public Class Methods

new(source) click to toggle source
Calls superclass method
# File source/zotica/parser.rb, line 464
def initialize(source)
  super(source)
  @inner_parser = Zenithal::ZoticaSingleParser.new(source)
end

Public Instance Methods

load_font(path) click to toggle source
# File source/zotica/parser.rb, line 469
def load_font(path)
  @inner_parser.load_font(path)
end
raw_macro_name=(name) click to toggle source
# File source/zotica/parser.rb, line 512
def raw_macro_name=(name)
  warn("This method is now obsolete. Use 'register_raw_macro' instead.", uplevel: 1)
  register_raw_macro(name)
end
register_math_macro(name, &block) click to toggle source
# File source/zotica/parser.rb, line 473
def register_math_macro(name, &block)
  outer_self = self
  register_plugin(name) do |attributes|
    parser = @inner_parser.clone
    parser.version = outer_self.instance_variable_get("@version")
    parser.update(@source)
    parser.setup(attributes, block)
    next parser
  end
  @inner_parser.register_plugin(name) do |attributes|
    parser = @inner_parser.clone
    parser.version = outer_self.instance_variable_get("@version")
    parser.update(@source)
    parser.setup(attributes, block)
    next parser
  end
end
register_raw_macro(name) click to toggle source
# File source/zotica/parser.rb, line 502
def register_raw_macro(name)
  outer_self = self
  @inner_parser.register_plugin(name) do |_|
    raw_parser = outer_self.clone
    raw_parser.exact = false
    raw_parser.whole = false
    next raw_parser
  end
end
register_resource_macro(name) click to toggle source
# File source/zotica/parser.rb, line 517
def register_resource_macro(name)
  register_macro(name) do |attributes, children_list|
    style_string = Zenithal::ZoticaBuilder.create_style_string(attributes["font-url"])
    script_string = Zenithal::ZoticaBuilder.create_script_string
    nodes = REXML::Nodes[]
    nodes << REXML::Element.build("style") do |element|
      element << REXML::Text.new(style_string, true, nil, true)
    end
    nodes << REXML::Element.build("script") do |element|
      element << REXML::CData.new(script_string)
    end
    next nodes
  end
end
register_simple_math_macro(name) click to toggle source
# File source/zotica/parser.rb, line 491
def register_simple_math_macro(name)
  register_math_macro(name) do |attributes, children_list|
    next [children_list.first]
  end
end
resource_macro_name=(name) click to toggle source
# File source/zotica/parser.rb, line 532
def resource_macro_name=(name)
  warn("This method is now obsolete. Use 'register_resource_macro' instead.", uplevel: 1)
  register_resource_macro(name)
end
simple_math_macro_name=(name) click to toggle source
# File source/zotica/parser.rb, line 497
def simple_math_macro_name=(name)
  warn("This method is now obsolete. Use 'register_simple_math_macro' instead.", uplevel: 1)
  register_simple_math_macro(name)
end