Sha256: 27b9b304a11955adb82e1df3e73aa4235aba25d1b2c3dea0d156853d9582af51

Contents?: true

Size: 1018 Bytes

Versions: 33

Compression:

Stored size: 1018 Bytes

Contents

require "metanorma/processor"

module Metanorma
  module Rsd
    class Processor < Metanorma::Processor

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

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

      def version
        "Metanorma::Rsd #{Metanorma::Rsd::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::Rsd::HtmlConvert.new(options).convert(outname, isodoc_node)
        when :doc
          IsoDoc::Rsd::WordConvert.new(options).convert(outname, isodoc_node)
        when :pdf
          IsoDoc::Rsd::PdfConvert.new(options).convert(outname, isodoc_node)
        else
          super
        end
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
metanorma-rsd-1.4.4 lib/metanorma/rsd/processor.rb
metanorma-rsd-1.4.3 lib/metanorma/rsd/processor.rb
metanorma-rsd-1.4.2 lib/metanorma/rsd/processor.rb
metanorma-rsd-1.4.1 lib/metanorma/rsd/processor.rb
metanorma-rsd-1.4.0 lib/metanorma/rsd/processor.rb
metanorma-rsd-1.3.11 lib/metanorma/rsd/processor.rb
metanorma-rsd-1.3.10 lib/metanorma/rsd/processor.rb
metanorma-rsd-1.3.9 lib/metanorma/rsd/processor.rb
metanorma-rsd-1.3.8 lib/metanorma/rsd/processor.rb
metanorma-rsd-1.3.7 lib/metanorma/rsd/processor.rb
metanorma-rsd-1.3.6 lib/metanorma/rsd/processor.rb
metanorma-rsd-1.3.5 lib/metanorma/rsd/processor.rb
metanorma-rsd-1.3.4 lib/metanorma/rsd/processor.rb
metanorma-rsd-1.3.3 lib/metanorma/rsd/processor.rb
metanorma-rsd-1.3.2 lib/metanorma/rsd/processor.rb
metanorma-rsd-1.3.1 lib/metanorma/rsd/processor.rb
metanorma-rsd-1.3.0 lib/metanorma/rsd/processor.rb
metanorma-rsd-1.2.3 lib/metanorma/rsd/processor.rb
metanorma-rsd-1.2.2 lib/metanorma/rsd/processor.rb
metanorma-rsd-1.2.1 lib/metanorma/rsd/processor.rb