Class: Metanorma::M3AAWG::Processor

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

Instance Method Summary collapse

Constructor Details

#initializeProcessor

rubocop:disable Lint/MissingSuper



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

def initialize # rubocop:disable Lint/MissingSuper
  @short = %i[m3d m3aawg]
  @input_format = :asciidoc
  @asciidoctor_backend = :m3aawg
end

Instance Method Details

#configurationObject



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

def configuration
  Metanorma::Ribose.configuration
end

#fonts_manifestObject



24
25
26
27
28
29
30
31
32
33
# File 'lib/metanorma/m3aawg/processor.rb', line 24

def fonts_manifest
  {
    "Arial" => nil,
    "Cambria Math" => nil,
    "Courier New" => nil,
    "EB Garamond 12" => nil,
    "Overpass" => nil,
    "Space Mono" => nil,
  }
end

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



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/metanorma/m3aawg/processor.rb', line 39

def output(isodoc_node, inname, outname, format, options = {})
  case format
  when :html
    IsoDoc::M3AAWG::HtmlConvert.new(options)
      .convert(inname, isodoc_node, nil, outname)
  when :doc
    IsoDoc::M3AAWG::WordConvert.new(options)
      .convert(inname, isodoc_node, nil, outname)
  when :pdf
    IsoDoc::M3AAWG::PdfConvert.new(options)
      .convert(inname, isodoc_node, nil, outname)
  when :presentation
    IsoDoc::M3AAWG::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/m3aawg/processor.rb', line 16

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

#versionObject



35
36
37
# File 'lib/metanorma/m3aawg/processor.rb', line 35

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