Sha256: b4b526066579cd136e64ed8d4bf34972a57d14e11732dba3c7a1402fbc923c20

Contents?: true

Size: 1.03 KB

Versions: 6

Compression:

Stored size: 1.03 KB

Contents

require "metanorma/processor"

module Metanorma
  module Gb
    class Processor < Metanorma::Processor

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

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

      def version
        "Asciidoctor::Gb #{Asciidoctor::Gb::VERSION}"
      end

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

      def output(isodoc_node, outname, format, options={})
        case format
        when :html
          IsoDoc::Gb::HtmlConvert.new(options).convert(outname, isodoc_node)
        when :compliant_html
          IsoDoc::Gb::HtmlConvert.new(options.merge(compliant: true)).convert(outname, isodoc_node)
        when :doc
          IsoDoc::Gb::WordConvert.new(options).convert(outname, isodoc_node)
        else
          super
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
metanorma-gb-1.0.1 lib/metanorma/gb/processor.rb
metanorma-gb-1.0.0 lib/metanorma/gb/processor.rb
asciidoctor-gb-0.3.7 lib/metanorma/gb/processor.rb
asciidoctor-gb-0.3.5 lib/metanorma/gb/processor.rb
asciidoctor-gb-0.3.4 lib/metanorma/gb/processor.rb
asciidoctor-gb-0.3.3 lib/metanorma/gb/processor.rb