Class: Ulysses::Exporter
- Inherits:
-
Object
- Object
- Ulysses::Exporter
- Defined in:
- lib/ulysses/exporter.rb
Instance Method Summary collapse
-
#initialize(sheet_xml) ⇒ Exporter
constructor
A new instance of Exporter.
- #to_html ⇒ Object
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_html ⇒ Object
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 = (html) html = append_footnotes(html) html = append_annotations(html) Kramdown::Document.new(html).to_html end |