Sha256: 71cf008884bc13f17d75fafe91cb7cf07bb97c98b4c4c33de16c05420003f46e

Contents?: true

Size: 1.08 KB

Versions: 40

Compression:

Stored size: 1.08 KB

Contents

# Registry of all Metanorma types and entry points
#

module Metanorma
  class Processor
    attr_reader :short, :input_format, :asciidoctor_backend

    def initialize
      raise "This is an abstract class!"
    end

    def output_formats
      {
        xml: "xml",
        presentation: "presentation.xml",
        rxl: "rxl",
      }
    end

    def input_to_isodoc(file, filename, options = {})
      Metanorma::Input::Asciidoc.new.process(file, filename, @asciidoctor_backend, options)
    end

    # def input_to_isodoc(file, filename)
    #   raise "This is an abstract class!"
    # end

    def use_presentation_xml(ext)
      case ext
      when :html, :doc, :pdf then true
      else
        false
      end
    end

    def output(isodoc_node, _inname, outname, _format, _options = {})
      File.open(outname, "w:UTF-8") { |f| f.write(isodoc_node) }
    end

    def extract_options(file)
      Metanorma::Input::Asciidoc.new.extract_options(file)
    end

    def extract_metanorma_options(file)
      Metanorma::Input::Asciidoc.new.extract_metanorma_options(file)
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
metanorma-1.6.4 lib/metanorma/processor.rb
metanorma-1.6.3 lib/metanorma/processor.rb
metanorma-1.6.2 lib/metanorma/processor.rb
metanorma-1.6.1 lib/metanorma/processor.rb
metanorma-1.6.0 lib/metanorma/processor.rb
metanorma-1.5.12 lib/metanorma/processor.rb
metanorma-1.5.11 lib/metanorma/processor.rb
metanorma-1.5.10 lib/metanorma/processor.rb
metanorma-1.5.9 lib/metanorma/processor.rb
metanorma-1.5.8 lib/metanorma/processor.rb
metanorma-1.5.7 lib/metanorma/processor.rb
metanorma-1.5.6 lib/metanorma/processor.rb
metanorma-1.5.5 lib/metanorma/processor.rb
metanorma-1.5.4 lib/metanorma/processor.rb
metanorma-1.5.3 lib/metanorma/processor.rb
metanorma-1.5.2 lib/metanorma/processor.rb
metanorma-1.5.1 lib/metanorma/processor.rb
metanorma-1.5.0 lib/metanorma/processor.rb
metanorma-1.4.14 lib/metanorma/processor.rb
metanorma-1.4.13 lib/metanorma/processor.rb