Sha256: 4ed332db4e48cbb0f38c53b6adc20a4696dc10192d2e6252678392e5ab0d4d93

Contents?: true

Size: 1.81 KB

Versions: 15

Compression:

Stored size: 1.81 KB

Contents

require "metanorma/processor"

module Metanorma
  module Iso
    def self.fonts_used
      {
        html: ["Cambria", "Times New Roman", "Cambria Math", "HanSans", "Courier New"],
        html_alt: ["Cambria", "Times New Roman", "Cambria Math", "HanSans", "Courier New"],
        doc: ["Cambria", "Times New Roman", "Cambria Math", "HanSans", "Courier New"],
        pdf: ["Cambria", "Times New Roman", "Cambria Math", "HanSans", "Courier New"],
      }
    end

    class Processor < Metanorma::Processor

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

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

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

      def use_presentation_xml(ext)
        return true if ext == :html_alt
        super
      end

      def output(isodoc_node, inname, outname, format, options={})
        case format
        when :html
          IsoDoc::Iso::HtmlConvert.new(options).convert(inname, isodoc_node, nil, outname)
        when :html_alt
          IsoDoc::Iso::HtmlConvert.new(options.merge(alt: true)).convert(inname, isodoc_node, nil, outname)
        when :doc
          IsoDoc::Iso::WordConvert.new(options).convert(inname, isodoc_node, nil, outname)
        when :pdf
          IsoDoc::Iso::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::Iso::PresentationXMLConvert.new(options).convert(inname, isodoc_node, nil, outname)
        else
          super
        end
      end

    end
  end
end

Version data entries

15 entries across 12 versions & 2 rubygems

Version Path
metanorma-iso-1.5.5 lib/metanorma/iso/processor.rb
metanorma-iso-1.5.4 lib/metanorma/iso/processor.rb
metanorma-iso-1.5.3 lib/metanorma/iso/processor.rb
metanorma-iso-1.5.2 lib/metanorma/iso/processor.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/metanorma-iso-1.5.1/lib/metanorma/iso/processor.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/metanorma-iso-1.4.2/lib/metanorma/iso/processor.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/metanorma-iso-1.4.3/lib/metanorma/iso/processor.rb
metanorma-iso-1.5.1 lib/metanorma/iso/processor.rb
metanorma-iso-1.5.0 lib/metanorma/iso/processor.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/metanorma-iso-1.4.2/lib/metanorma/iso/processor.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/metanorma-iso-1.4.3/lib/metanorma/iso/processor.rb
metanorma-iso-1.4.3 lib/metanorma/iso/processor.rb
metanorma-iso-1.4.3.pre.alpha lib/metanorma/iso/processor.rb
metanorma-iso-1.4.2 lib/metanorma/iso/processor.rb
metanorma-iso-1.4.1 lib/metanorma/iso/processor.rb