Class: Metanorma::NIST::Processor

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeProcessor



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

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

Class Method Details

.fonts_usedObject



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

def self.fonts_used
  {
    html: ["Times New Roman", "Arial", "Courier New"],
    doc: ["Times New Roman", "Arial", "Courier New"],
    pdf: ["Times New Roman", "Arial", "Courier New"],
  }
end

Instance Method Details

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



32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/metanorma/nist/processor.rb', line 32

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

#output_formatsObject



20
21
22
23
24
25
26
# File 'lib/metanorma/nist/processor.rb', line 20

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

#versionObject



28
29
30
# File 'lib/metanorma/nist/processor.rb', line 28

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