Class: Ulysses::Exporter

Inherits:
Object
  • Object
show all
Defined in:
lib/ulysses/exporter.rb

Instance Method Summary collapse

Constructor Details

#initialize(sheet_xml) ⇒ Exporter

Returns a new instance of Exporter.



4
5
6
7
8
9
# File 'lib/ulysses/exporter.rb', line 4

def initialize(sheet_xml)
  @xml   = Nokogiri::XML sheet_xml
  @coder = HTMLEntities.new
  @annotations = []
  @footnotes   = []
end

Instance Method Details

#to_htmlObject



11
12
13
14
15
16
17
18
# File 'lib/ulysses/exporter.rb', line 11

def to_html
  tree = xml_to_tree @xml.xpath('/sheet/string[@xml:space="preserve"]')
  html = tree_to_html tree
  html = parse_prefix_tags(html)
  html = append_footnotes(html)
  html = append_annotations(html)
  Kramdown::Document.new(html).to_html
end