Class: Metanorma::Cc::Processor

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

Instance Method Summary collapse

Constructor Details

#initializeProcessor

Returns a new instance of Processor.



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

def initialize
  @short = [:csd, :cc]
  @input_format = :asciidoc
  @asciidoctor_backend = :cc
end

Instance Method Details

#configurationObject



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

def configuration
  Metanorma::Cc.configuration
end

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



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

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

#output_formatsObject



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

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

#versionObject



24
25
26
# File 'lib/metanorma/cc/processor.rb', line 24

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