Sha256: 28a13043776f8ff55154ccd48cf5c55c02f444f96f626db595cbed65d4eea4a4

Contents?: true

Size: 1.1 KB

Versions: 26

Compression:

Stored size: 1.1 KB

Contents

# Registry of all Metanorma types and entry points
#

module Metanorma
  class Processor

    attr_reader :short
    attr_reader :input_format
    attr_reader :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

26 entries across 26 versions & 2 rubygems

Version Path
metanorma-1.3.7 lib/metanorma/processor.rb
metanorma-1.3.6 lib/metanorma/processor.rb
metanorma-1.3.5 lib/metanorma/processor.rb
metanorma-1.3.4 lib/metanorma/processor.rb
metanorma-1.3.3 lib/metanorma/processor.rb
metanorma-1.3.2 lib/metanorma/processor.rb
metanorma-1.3.1 lib/metanorma/processor.rb
metanorma-1.3.0 lib/metanorma/processor.rb
metanorma-1.2.8 lib/metanorma/processor.rb
metanorma-1.2.7 lib/metanorma/processor.rb
metanorma-1.2.6 lib/metanorma/processor.rb
metanorma-1.2.6pre lib/metanorma/processor.rb
metanorma-1.2.5 lib/metanorma/processor.rb
metanorma-1.2.4 lib/metanorma/processor.rb
metanorma-1.2.3 lib/metanorma/processor.rb
metanorma-1.2.2 lib/metanorma/processor.rb
metanorma-1.2.1 lib/metanorma/processor.rb
metanorma-1.2.0 lib/metanorma/processor.rb
metanorma-1.1.7 lib/metanorma/processor.rb
metanorma-1.1.6 lib/metanorma/processor.rb