Sha256: 7b835f50c8f4a06d55bf09a15f512819d5176e7165517258718a8258677705d7

Contents?: true

Size: 1.18 KB

Versions: 5

Compression:

Stored size: 1.18 KB

Contents

require "metanorma/processor"

module Metanorma
  module MPFA
    def self.fonts_used
      {
        html: ["Titillium Web", "Space Mono"],
        doc: ["Arial", "Courier New"],
      }
    end

    class Processor < Metanorma::Processor

      def initialize
        @short = [:mpfd, :mpfa]
        @input_format = :asciidoc
        @asciidoctor_backend = :mpfa
      end

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

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

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
metanorma-mpfa-0.5.7 lib/metanorma/mpfa/processor.rb
metanorma-mpfa-0.5.6 lib/metanorma/mpfa/processor.rb
metanorma-mpfa-0.5.5 lib/metanorma/mpfa/processor.rb
metanorma-mpfa-0.5.4 lib/metanorma/mpfa/processor.rb
metanorma-mpfa-0.5.3 lib/metanorma/mpfa/processor.rb