Sha256: 08038cc879d1fe341abcbe0630a1d4d34d5cd19f03028f27eb8c1ea5c957baa2

Contents?: true

Size: 1018 Bytes

Versions: 29

Compression:

Stored size: 1018 Bytes

Contents

require "metanorma/processor"

module Metanorma
  module ITU
    class Processor < Metanorma::Processor

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

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

      def version
        "Metanorma::ITU #{Metanorma::ITU::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::ITU::HtmlConvert.new(options).convert(outname, isodoc_node)
        when :doc
          IsoDoc::ITU::WordConvert.new(options).convert(outname, isodoc_node)
        when :pdf
          IsoDoc::ITU::PdfConvert.new(options).convert(outname, isodoc_node)
        else
          super
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
metanorma-itu-1.0.13 lib/metanorma/itu/processor.rb
metanorma-itu-1.0.12 lib/metanorma/itu/processor.rb
metanorma-itu-1.0.11 lib/metanorma/itu/processor.rb
metanorma-itu-1.0.10 lib/metanorma/itu/processor.rb
metanorma-itu-1.0.9 lib/metanorma/itu/processor.rb
metanorma-itu-1.0.8 lib/metanorma/itu/processor.rb
metanorma-itu-1.0.7 lib/metanorma/itu/processor.rb
metanorma-itu-1.0.6 lib/metanorma/itu/processor.rb
metanorma-itu-1.0.5 lib/metanorma/itu/processor.rb
metanorma-itu-1.0.4 lib/metanorma/itu/processor.rb
metanorma-itu-1.0.3 lib/metanorma/itu/processor.rb
metanorma-itu-1.0.2 lib/metanorma/itu/processor.rb
metanorma-itu-1.0.1 lib/metanorma/itu/processor.rb
metanorma-itu-1.0.0 lib/metanorma/itu/processor.rb
metanorma-itu-0.2.10 lib/metanorma/itu/processor.rb
metanorma-itu-0.2.9 lib/metanorma/itu/processor.rb
metanorma-itu-0.2.8 lib/metanorma/itu/processor.rb
metanorma-itu-0.2.7 lib/metanorma/itu/processor.rb
metanorma-itu-0.2.6 lib/metanorma/itu/processor.rb
metanorma-itu-0.2.5 lib/metanorma/itu/processor.rb