Sha256: bf859cc641437ed7dffc44c3c251a9b101ea737bc25f4702bb453eac6a4b729c

Contents?: true

Size: 1.69 KB

Versions: 45

Compression:

Stored size: 1.69 KB

Contents

require "metanorma/processor"

module Metanorma
  module Iec
    class Processor < Metanorma::Processor
      def initialize # rubocop:disable Lint/MissingSuper
        @short = :iec
        @input_format = :asciidoc
        @asciidoctor_backend = :iec
      end

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

      def fonts_manifest
        {
          "Arial" => nil,
          "Times New Roman" => nil,
          "STIX Two Math" => nil,
          "Source Han Sans" => nil,
          "Source Han Sans Normal" => nil,
          "Courier New" => nil,
        }
      end

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

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

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
metanorma-iec-2.3.2 lib/metanorma/iec/processor.rb
metanorma-iec-2.3.1 lib/metanorma/iec/processor.rb
metanorma-iec-2.3.0 lib/metanorma/iec/processor.rb
metanorma-iec-2.2.14 lib/metanorma/iec/processor.rb
metanorma-iec-2.2.13 lib/metanorma/iec/processor.rb
metanorma-iec-2.2.12 lib/metanorma/iec/processor.rb
metanorma-iec-2.2.11 lib/metanorma/iec/processor.rb
metanorma-iec-2.2.10 lib/metanorma/iec/processor.rb
metanorma-iec-2.2.9 lib/metanorma/iec/processor.rb
metanorma-iec-2.2.8 lib/metanorma/iec/processor.rb
metanorma-iec-2.2.7 lib/metanorma/iec/processor.rb
metanorma-iec-2.2.6 lib/metanorma/iec/processor.rb
metanorma-iec-2.2.5 lib/metanorma/iec/processor.rb
metanorma-iec-2.2.4 lib/metanorma/iec/processor.rb
metanorma-iec-2.2.3 lib/metanorma/iec/processor.rb
metanorma-iec-2.2.2 lib/metanorma/iec/processor.rb
metanorma-iec-2.2.1 lib/metanorma/iec/processor.rb
metanorma-iec-2.2.0 lib/metanorma/iec/processor.rb
metanorma-iec-2.1.13 lib/metanorma/iec/processor.rb
metanorma-iec-2.1.12 lib/metanorma/iec/processor.rb