Class: Metanorma::Iec::Processor

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

Instance Method Summary collapse

Constructor Details

#initializeProcessor

Returns a new instance of Processor.



7
8
9
10
11
# File 'lib/metanorma/iec/processor.rb', line 7

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

Instance Method Details

#fonts_manifestObject



21
22
23
24
25
26
27
28
29
30
# File 'lib/metanorma/iec/processor.rb', line 21

def fonts_manifest
  {
    "Arial" => nil,
    "Times New Roman" => nil,
    "STIX Two Math" => nil,
    "Source Han Sans" => nil,
    "Courier" => nil,
    "Courier New" => nil,
  }
end

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



36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/metanorma/iec/processor.rb', line 36

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

#output_formatsObject



13
14
15
16
17
18
19
# File 'lib/metanorma/iec/processor.rb', line 13

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

#versionObject



32
33
34
# File 'lib/metanorma/iec/processor.rb', line 32

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