Sha256: 5a559519584737a9748978eda269f7ad3719bf88f9982c1754a8151b77a9da94

Contents?: true

Size: 1.04 KB

Versions: 16

Compression:

Stored size: 1.04 KB

Contents

require "metanorma/processor"

module Metanorma
  module Iso
    class Processor < Metanorma::Processor

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

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

      def version
        "Asciidoctor::ISO #{Asciidoctor::ISO::VERSION}/IsoDoc #{IsoDoc::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::Iso::HtmlConvert.new(options).convert(outname, isodoc_node)
        when :html_alt
          IsoDoc::Iso::HtmlConvert.new(options.merge(alt: true)).convert(outname, isodoc_node)
        when :doc
          IsoDoc::Iso::WordConvert.new(options).convert(outname, isodoc_node)
        else
          super
        end
      end

    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
metanorma-iso-1.0.5 lib/metanorma/iso/processor.rb
metanorma-iso-1.0.4 lib/metanorma/iso/processor.rb
metanorma-iso-1.0.3 lib/metanorma/iso/processor.rb
metanorma-iso-1.0.2 lib/metanorma/iso/processor.rb
metanorma-iso-1.0.1 lib/metanorma/iso/processor.rb
metanorma-iso-1.0.0 lib/metanorma/iso/processor.rb
asciidoctor-iso-0.10.4 lib/metanorma/iso/processor.rb
asciidoctor-iso-0.10.3 lib/metanorma/iso/processor.rb
asciidoctor-iso-0.10.2 lib/metanorma/iso/processor.rb
asciidoctor-iso-0.10.1 lib/metanorma/iso/processor.rb
asciidoctor-iso-0.10.0 lib/metanorma/iso/processor.rb
asciidoctor-iso-0.9.9 lib/metanorma/iso/processor.rb
asciidoctor-iso-0.9.7 lib/metanorma/iso/processor.rb
asciidoctor-iso-0.9.6 lib/metanorma/iso/processor.rb
asciidoctor-iso-0.9.5 lib/metanorma/iso/processor.rb
asciidoctor-iso-0.9.3 lib/metanorma/iso/processor.rb