class PnoteClient::Documents::Hml::Equation

Attributes

script[R]

Public Class Methods

from_tag(eq_tag) click to toggle source

Textable Element

# File lib/pnote_client/documents/hml/equation.rb, line 10
def self.from_tag(eq_tag)
  script = eq_tag.xpath("SCRIPT")[0].content 
  return self.new(script)
end
new(script) click to toggle source
# File lib/pnote_client/documents/hml/equation.rb, line 17
def initialize(script)
  @script = script
  @script_validator = HwpScriptToLatex::Validator.new
  @script_converter = ::HwpScriptToLatex::Converter.new
end

Public Instance Methods

content() click to toggle source
# File lib/pnote_client/documents/hml/equation.rb, line 23
def content
  if @script_converter
    return @script_converter.convert(@script, math_mode: true, display_mode: true)
  else
    return @script
  end
end
textable?() click to toggle source
# File lib/pnote_client/documents/hml/equation.rb, line 31
def textable?
  return true
end
validate() click to toggle source
# File lib/pnote_client/documents/hml/equation.rb, line 35
def validate
  return @script_validator.validate(@script)
end