class Metanorma::Csd::Processor

Public Class Methods

new() click to toggle source
# File lib/metanorma/csd/processor.rb, line 7
def initialize
  @short = :csd
  @input_format = :asciidoc
  @asciidoctor_backend = :csd
end

Public Instance Methods

input_to_isodoc(file) click to toggle source
# File lib/metanorma/csd/processor.rb, line 24
def input_to_isodoc(file)
  Metanorma::Input::Asciidoc.new.process(file, @asciidoctor_backend)
end
output(isodoc_node, outname, format, options={}) click to toggle source
Calls superclass method
# File lib/metanorma/csd/processor.rb, line 28
def output(isodoc_node, outname, format, options={})
  case format
  when :html
    IsoDoc::Csd::HtmlConvert.new(options).convert(outname, isodoc_node)
  when :pdf
    #require 'tempfile'
    # Tempfile.open("#{outname}.html") do |tmp|
    outname_html = outname + ".html"
    IsoDoc::Csd::HtmlConvert.new(options).convert(outname_html, isodoc_node)
    puts outname_html
    system "cat #{outname_html}"
    Metanorma::Output::Pdf.new.convert(outname_html, outname)
  else
    super
  end
end
output_formats() click to toggle source
Calls superclass method
# File lib/metanorma/csd/processor.rb, line 13
def output_formats
  super.merge(
    html: "html",
    pdf: "pdf"
  )
end
version() click to toggle source
# File lib/metanorma/csd/processor.rb, line 20
def version
  "Asciidoctor::Csd #{Asciidoctor::Csd::VERSION}"
end