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-0.2.4 lib/metanorma/itu/processor.rb
metanorma-itu-0.2.3 lib/metanorma/itu/processor.rb
metanorma-itu-0.2.1 lib/metanorma/itu/processor.rb
metanorma-itu-0.2.0 lib/metanorma/itu/processor.rb
metanorma-itu-0.1.4 lib/metanorma/itu/processor.rb
metanorma-itu-0.1.3 lib/metanorma/itu/processor.rb
metanorma-itu-0.1.2 lib/metanorma/itu/processor.rb
metanorma-itu-0.1.1 lib/metanorma/itu/processor.rb
metanorma-itu-0.1.0 lib/metanorma/itu/processor.rb