Class: Metanorma::Standoc::Processor
- Inherits:
-
Processor
- Object
- Processor
- Metanorma::Standoc::Processor
- Defined in:
- lib/metanorma/standoc/processor.rb
Instance Method Summary collapse
-
#initialize ⇒ Processor
constructor
A new instance of Processor.
- #input_to_isodoc(file, filename) ⇒ Object
- #output(isodoc_node, outname, format, options = {}) ⇒ Object
- #output_formats ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize ⇒ Processor
Returns a new instance of Processor.
7 8 9 10 11 |
# File 'lib/metanorma/standoc/processor.rb', line 7 def initialize @short = :standoc @input_format = :asciidoc @asciidoctor_backend = :standoc end |
Instance Method Details
#input_to_isodoc(file, filename) ⇒ Object
24 25 26 |
# File 'lib/metanorma/standoc/processor.rb', line 24 def input_to_isodoc(file, filename) Metanorma::Input::Asciidoc.new.process(file, filename, @asciidoctor_backend) end |
#output(isodoc_node, outname, format, options = {}) ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/metanorma/standoc/processor.rb', line 28 def output(isodoc_node, outname, format, ={}) case format when :html IsoDoc::HtmlConvert.new().convert(outname, isodoc_node) when :doc IsoDoc::WordConvert.new().convert(outname, isodoc_node) else super end end |
#output_formats ⇒ Object
13 14 15 16 17 18 |
# File 'lib/metanorma/standoc/processor.rb', line 13 def output_formats super.merge( html: "html", doc: "doc" ) end |