Sha256: 4efd14ee9f9a2153a1a123a7cc64a0e7d7ea56a8d8f628a0ad270156a7407f72

Contents?: true

Size: 1 KB

Versions: 32

Compression:

Stored size: 1 KB

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",
          pdf: "pdf"
        )
      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)
        when :pdf
          IsoDoc::Mpfd::PdfConvert.new(options).convert(outname, isodoc_node)
        else
          super
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
metanorma-mpfd-0.3.18 lib/metanorma/mpfd/processor.rb
metanorma-mpfd-0.3.17 lib/metanorma/mpfd/processor.rb
metanorma-mpfd-0.3.16 lib/metanorma/mpfd/processor.rb
metanorma-mpfd-0.3.15 lib/metanorma/mpfd/processor.rb
metanorma-mpfd-0.3.14 lib/metanorma/mpfd/processor.rb
metanorma-mpfd-0.3.13 lib/metanorma/mpfd/processor.rb
metanorma-mpfd-0.3.11 lib/metanorma/mpfd/processor.rb
metanorma-mpfd-0.3.10 lib/metanorma/mpfd/processor.rb
metanorma-mpfd-0.3.9 lib/metanorma/mpfd/processor.rb
metanorma-mpfd-0.3.8 lib/metanorma/mpfd/processor.rb
metanorma-mpfd-0.3.7 lib/metanorma/mpfd/processor.rb
metanorma-mpfd-0.3.6 lib/metanorma/mpfd/processor.rb
metanorma-mpfd-0.3.5 lib/metanorma/mpfd/processor.rb
metanorma-mpfd-0.3.4 lib/metanorma/mpfd/processor.rb
metanorma-mpfd-0.3.3 lib/metanorma/mpfd/processor.rb
metanorma-mpfd-0.3.2 lib/metanorma/mpfd/processor.rb
metanorma-mpfd-0.3.1 lib/metanorma/mpfd/processor.rb
metanorma-mpfd-0.3.0 lib/metanorma/mpfd/processor.rb
metanorma-mpfd-0.2.3 lib/metanorma/mpfd/processor.rb
metanorma-mpfd-0.2.2 lib/metanorma/mpfd/processor.rb