Sha256: be5eaa32e295cf3627fe6770c80724c0111e409ae6a61b2f92260aba958f45f6

Contents?: true

Size: 1.5 KB

Versions: 23

Compression:

Stored size: 1.5 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 New" => nil,
          "Times New Roman" => nil,
          "Source Han Sans" => nil,
          "Source Han Sans Normal" => nil,
          "STIX Two Math" => nil,
        }
      end

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

      def output(isodoc_node, inname, outname, format, options={})
        options_preprocess(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

23 entries across 23 versions & 1 rubygems

Version Path
metanorma-itu-2.3.5 lib/metanorma/itu/processor.rb
metanorma-itu-2.3.4 lib/metanorma/itu/processor.rb
metanorma-itu-2.3.3 lib/metanorma/itu/processor.rb