Class: Metanorma::BIPM::Processor

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

Instance Method Summary collapse

Instance Method Details

#configurationObject



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

def configuration
  Metanorma::BIPM.configuration
end

#fonts_manifestObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/metanorma/bipm/processor.rb', line 17

def fonts_manifest
  {
    "Arial" => nil,
    "Times New Roman" => nil,
    "Work Sans" => nil,
    "Work Sans Black" => nil,
    "Work Sans ExtraBold" => nil,
    "Work Sans ExtraLight" => nil,
    "Work Sans Light" => nil,
    "Work Sans Medium" => nil,
    "Work Sans SemiBold" => nil,
    "Work Sans Thin" => nil,
    "STIX Two Math" => nil,
    "Source Han Sans" => nil,
    "Source Han Sans Normal" => nil,
    "TeXGyreChorus" => nil,
  }
end

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



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

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

#output_formatsObject



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

def output_formats
  super.merge(
    html: "html",
    pdf: "pdf",
  ).tap { |hs| hs.delete(:doc) }
end

#versionObject



36
37
38
# File 'lib/metanorma/bipm/processor.rb', line 36

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