Class: Metanorma::Iso::Processor

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

Instance Method Summary collapse

Constructor Details

#initializeProcessor

rubocop:disable Lint/MissingSuper



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

def initialize # rubocop:disable Lint/MissingSuper
  @short = :iso
  @input_format = :asciidoc
  @asciidoctor_backend = :iso
end

Instance Method Details

#fonts_manifestObject



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/metanorma/iso/processor.rb', line 28

def fonts_manifest
  {
    "Cambria" => nil,
    "Cambria Math" => nil,
    "Times New Roman" => nil,
    "Source Han Sans" => nil,
    "Source Han Sans Normal" => nil,
    "Courier New" => nil,
    "Inter" => nil,
  }
end

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



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/metanorma/iso/processor.rb', line 46

def output(isodoc_node, inname, outname, format, options={})
  options_preprocess(options)
  case format
  when :html
    IsoDoc::Iso::HtmlConvert.new(options)
      .convert(inname, isodoc_node, nil, outname)
  when :html_alt
    IsoDoc::Iso::HtmlConvert.new(options.merge(alt: true))
      .convert(inname, isodoc_node, nil, outname)
  when :doc
    IsoDoc::Iso::WordConvert.new(options)
      .convert(inname, isodoc_node, nil, outname)
  when :pdf
    IsoDoc::Iso::PdfConvert.new(options)
      .convert(inname, isodoc_node, nil, outname)
  when :sts
    IsoDoc::Iso::StsConvert.new(options)
      .convert(inname, isodoc_node, nil, outname)
  when :isosts
    IsoDoc::Iso::IsoStsConvert.new(options)
      .convert(inname, isodoc_node, nil, outname)
  when :presentation
    IsoDoc::Iso::PresentationXMLConvert.new(options)
      .convert(inname, isodoc_node, nil, outname)
  else
    super
  end
end

#output_formatsObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/metanorma/iso/processor.rb', line 13

def output_formats
  super.merge(
    html: "html",
    html_alt: "alt.html",
    doc: "doc",
    pdf: "pdf",
    sts: "sts.xml",
    isosts: "iso.sts.xml",
  )
end

#use_presentation_xml(ext) ⇒ Object



40
41
42
43
44
# File 'lib/metanorma/iso/processor.rb', line 40

def use_presentation_xml(ext)
  return true if [:html_alt, :sts, :isosts].include?(ext)

  super
end

#versionObject



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

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