Sha256: a212463376f0a1e4d8b89644f3a04655bfb1f39e3f7a2370dc029ba86d760f08

Contents?: true

Size: 1018 Bytes

Versions: 36

Compression:

Stored size: 1018 Bytes

Contents

require "metanorma/processor"

module Metanorma
  module Csd
    class Processor < Metanorma::Processor

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

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

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

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
metanorma-csd-1.3.18 lib/metanorma/csd/processor.rb
metanorma-csd-1.3.17 lib/metanorma/csd/processor.rb
metanorma-csd-1.3.16 lib/metanorma/csd/processor.rb
metanorma-csd-1.3.15 lib/metanorma/csd/processor.rb
metanorma-csd-1.3.14 lib/metanorma/csd/processor.rb
metanorma-csd-1.3.13 lib/metanorma/csd/processor.rb
metanorma-csd-1.3.12 lib/metanorma/csd/processor.rb
metanorma-csd-1.3.11 lib/metanorma/csd/processor.rb
metanorma-csd-1.3.10 lib/metanorma/csd/processor.rb
metanorma-csd-1.3.9 lib/metanorma/csd/processor.rb
metanorma-csd-1.3.8 lib/metanorma/csd/processor.rb
metanorma-csd-1.3.7 lib/metanorma/csd/processor.rb
metanorma-csd-1.3.6 lib/metanorma/csd/processor.rb
metanorma-csd-1.3.5 lib/metanorma/csd/processor.rb
metanorma-csd-1.3.4 lib/metanorma/csd/processor.rb
metanorma-csd-1.3.3 lib/metanorma/csd/processor.rb
metanorma-csd-1.3.2 lib/metanorma/csd/processor.rb
metanorma-csd-1.3.1 lib/metanorma/csd/processor.rb
metanorma-csd-1.3.0 lib/metanorma/csd/processor.rb
metanorma-csd-1.2.3 lib/metanorma/csd/processor.rb