class Metanorma::Sample::Processor

Public Class Methods

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

Public Instance Methods

input_to_isodoc(file) click to toggle source
# File lib/metanorma/sample/processor.rb, line 25
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/sample/processor.rb, line 29
      def output(isodoc_node, outname, format, options={})
        case format
        when :html
          IsoDoc::Sample::HtmlConvert.new(options).convert(outname, isodoc_node)
        when :doc
          IsoDoc::Sample::WordConvert.new(options).convert(outname, isodoc_node)
        when :pdf
          IsoDoc::Sample::PdfConvert.new(options).convert(outname, isodoc_node)
=begin
          require 'tempfile'
          outname_html = outname + ".html"
          IsoDoc::Sample::HtmlConvert.new(options).convert(outname_html, isodoc_node)
          puts outname_html
          system "cat #{outname_html}"
          Metanorma::Output::Pdf.new.convert(outname_html, outname)
=end
        else
          super
        end
      end
output_formats() click to toggle source
Calls superclass method
# File lib/metanorma/sample/processor.rb, line 13
def output_formats
  super.merge(
    html: "html",
    doc: "doc",
    pdf: "pdf"
  )
end
version() click to toggle source
# File lib/metanorma/sample/processor.rb, line 21
def version
  "Asciidoctor::Sample #{Asciidoctor::Sample::VERSION}"
end