Sha256: 795fc48de3409df9c05aa02bb06c05e9de4a99909f98ca7d5efe34272f574edd

Contents?: true

Size: 908 Bytes

Versions: 1

Compression:

Stored size: 908 Bytes

Contents

require "metanorma/processor"

module Metanorma
  module Mpfd
    class Processor < Metanorma::Processor

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

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

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

      def input_to_isodoc(file, filename)
        Metanorma::Input::Asciidoc.new.process(file, filename, @asciidoctor_backend)
      end

      def output(isodoc_node, outname, format, options={})
        case format
        when :html
          IsoDoc::Mpfd::HtmlConvert.new(options).convert(outname, isodoc_node)
        when :doc
          IsoDoc::Mpfd::WordConvert.new(options).convert(outname, isodoc_node)
        else
          super
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
metanorma-mpfd-0.3.19 lib/metanorma/mpfd/processor.rb