Class: Xmindoc::Core
- Inherits:
-
Object
- Object
- Xmindoc::Core
- Defined in:
- lib/xmindoc.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#convert ⇒ Object
Convert and process XML with Pandoc at once.
-
#html_to_pandoc ⇒ Object
Export with Pandoc: HTML -> Markdown, Org, …
-
#initialize(option) ⇒ Core
constructor
A new instance of Core.
-
#xml_to_html ⇒ Object
Parse and transform: XML -> HTML.
Constructor Details
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
16 17 18 |
# File 'lib/xmindoc.rb', line 16 def result @result end |
Instance Method Details
#convert ⇒ Object
Convert and process XML with Pandoc at once
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/xmindoc.rb', line 40 def convert() xml_to_html() html_to_pandoc() if @option[:file_output] == "" # Without -o option puts @result else # Using option: -o filename File.open(@option[:file_output],"w") do |f| f.write(@result) end end return @result end |
#html_to_pandoc ⇒ Object
Export with Pandoc: HTML -> Markdown, Org, …
33 34 35 36 37 |
# File 'lib/xmindoc.rb', line 33 def html_to_pandoc() @exporter.export() @result = @exporter.result return @result end |
#xml_to_html ⇒ Object
Parse and transform: XML -> HTML
26 27 28 29 30 |
# File 'lib/xmindoc.rb', line 26 def xml_to_html() @parser.parse() @exporter.html = @parser.html_output return @exporter.html end |