Class: Metanorma::Ribose::Processor

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

Instance Method Summary collapse

Instance Method Details

#configurationObject



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

def configuration
  Metanorma::Ribose.configuration
end

#fonts_manifestObject



18
19
20
21
22
23
24
25
# File 'lib/metanorma/ribose/processor.rb', line 18

def fonts_manifest
  {
    "Source Sans Pro" => nil,
    "STIX Two Math" => nil,
    "Source Serif Pro" => nil,
    "Source Code Pro" => nil,
  }
end

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



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/metanorma/ribose/processor.rb', line 31

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

#output_formatsObject



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

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

#versionObject



27
28
29
# File 'lib/metanorma/ribose/processor.rb', line 27

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