Sha256: 72ae84fb518839d71c0f7d738a4dc829af38dd0da0238d8e4125763061c6c7b0

Contents?: true

Size: 1.45 KB

Versions: 14

Compression:

Stored size: 1.45 KB

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 fonts_manifest
        {
          "Arial" => nil,
          "Courier" => nil,
          "Courier New" => nil,
          "Times New Roman" => nil,
          "Source Han Sans" => nil,
          "STIX Two Math" => nil,
        }
      end

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

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
metanorma-itu-1.3.8 lib/metanorma/itu/processor.rb
metanorma-itu-1.3.7 lib/metanorma/itu/processor.rb
metanorma-itu-1.3.6 lib/metanorma/itu/processor.rb
metanorma-itu-1.3.5 lib/metanorma/itu/processor.rb
metanorma-itu-1.3.4 lib/metanorma/itu/processor.rb
metanorma-itu-1.3.3 lib/metanorma/itu/processor.rb
metanorma-itu-1.3.2 lib/metanorma/itu/processor.rb
metanorma-itu-1.3.1 lib/metanorma/itu/processor.rb
metanorma-itu-1.3.0 lib/metanorma/itu/processor.rb
metanorma-itu-1.2.16 lib/metanorma/itu/processor.rb
metanorma-itu-1.2.15 lib/metanorma/itu/processor.rb
metanorma-itu-1.2.14 lib/metanorma/itu/processor.rb
metanorma-itu-1.2.13 lib/metanorma/itu/processor.rb
metanorma-itu-1.2.12 lib/metanorma/itu/processor.rb