Class: Metanorma::Itu::Processor

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

Instance Method Summary collapse

Constructor Details

#initializeProcessor

Returns a new instance of Processor.



6
7
8
9
10
# File 'lib/metanorma/itu/processor.rb', line 6

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

Instance Method Details

#fonts_manifestObject



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

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

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



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/metanorma/itu/processor.rb', line 35

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

#output_formatsObject



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

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

#versionObject



31
32
33
# File 'lib/metanorma/itu/processor.rb', line 31

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