Class: Metanorma::Csa::Processor

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

Instance Method Summary collapse

Constructor Details

#initializeProcessor

Returns a new instance of Processor.



9
10
11
12
13
# File 'lib/metanorma/csa/processor.rb', line 9

def initialize
  @short = :csa
  @input_format = :asciidoc
  @asciidoctor_backend = :csa
end

Instance Method Details

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



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/metanorma/csa/processor.rb', line 27

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

#output_formatsObject



15
16
17
18
19
20
21
# File 'lib/metanorma/csa/processor.rb', line 15

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

#versionObject



23
24
25
# File 'lib/metanorma/csa/processor.rb', line 23

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