Class: Metanorma::Rsd::Processor

Inherits:
Generic::Processor
  • Object
show all
Defined in:
lib/metanorma/rsd/processor.rb

Instance Method Summary collapse

Instance Method Details

#configurationObject


6
7
8
# File 'lib/metanorma/rsd/processor.rb', line 6

def configuration
  Metanorma::Rsd.configuration
end

#input_to_isodoc(file, filename) ⇒ Object


22
23
24
# File 'lib/metanorma/rsd/processor.rb', line 22

def input_to_isodoc(file, filename)
  Metanorma::Input::Asciidoc.new.process(file, filename, @asciidoctor_backend)
end

#output(isodoc_node, outname, format, options = {}) ⇒ Object


26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/metanorma/rsd/processor.rb', line 26

def output(isodoc_node, outname, format, options={})
  case format
  when :html
    IsoDoc::Rsd::HtmlConvert.new(options).convert(outname, isodoc_node)
  when :doc
    IsoDoc::Rsd::WordConvert.new(options).convert(outname, isodoc_node)
  when :pdf
    IsoDoc::Rsd::PdfConvert.new(options).convert(outname, isodoc_node)
  else
    super
  end
end

#output_formatsObject


10
11
12
13
14
15
16
# File 'lib/metanorma/rsd/processor.rb', line 10

def output_formats
  super.merge(
    html: "html",
    doc: "doc",
    pdf: "pdf"
  )
end

#versionObject


18
19
20
# File 'lib/metanorma/rsd/processor.rb', line 18

def version
  "Metanorma::Rsd #{Metanorma::Rsd::VERSION}"
end