Sha256: 54b7a42485b8941f555bee8ad4ea46e0f8ca75f50f2abefa240a5ab4796b1c77

Contents?: true

Size: 1018 Bytes

Versions: 31

Compression:

Stored size: 1018 Bytes

Contents

require "metanorma/processor"

module Metanorma
  module Ogc
    class Processor < Metanorma::Processor

      def initialize
        @short = :ogc
        @input_format = :asciidoc
        @asciidoctor_backend = :ogc
      end

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

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

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

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

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
metanorma-ogc-1.0.4 lib/metanorma/ogc/processor.rb
metanorma-ogc-1.0.3 lib/metanorma/ogc/processor.rb
metanorma-ogc-1.0.2 lib/metanorma/ogc/processor.rb
metanorma-ogc-1.0.1 lib/metanorma/ogc/processor.rb
metanorma-ogc-1.0.0 lib/metanorma/ogc/processor.rb
metanorma-ogc-0.2.13 lib/metanorma/ogc/processor.rb
metanorma-ogc-0.2.12 lib/metanorma/ogc/processor.rb
metanorma-ogc-0.2.11 lib/metanorma/ogc/processor.rb
metanorma-ogc-0.2.10 lib/metanorma/ogc/processor.rb
metanorma-ogc-0.2.9 lib/metanorma/ogc/processor.rb
metanorma-ogc-0.2.8 lib/metanorma/ogc/processor.rb
metanorma-ogc-0.2.7 lib/metanorma/ogc/processor.rb
metanorma-ogc-0.2.6 lib/metanorma/ogc/processor.rb
metanorma-ogc-0.2.5 lib/metanorma/ogc/processor.rb
metanorma-ogc-0.2.4 lib/metanorma/ogc/processor.rb
metanorma-ogc-0.2.3 lib/metanorma/ogc/processor.rb
metanorma-ogc-0.2.2 lib/metanorma/ogc/processor.rb
metanorma-ogc-0.2.1 lib/metanorma/ogc/processor.rb
metanorma-ogc-0.2.0 lib/metanorma/ogc/processor.rb
metanorma-ogc-0.1.4 lib/metanorma/ogc/processor.rb