Sha256: 35682fdb90ea338e4427ce859eebc64c7afe09135689b8d06b2483bd7780fb7d

Contents?: true

Size: 1.02 KB

Versions: 14

Compression:

Stored size: 1.02 KB

Contents

require "metanorma/processor"

module Metanorma
  module Csand
    class Processor < Metanorma::Processor

      def initialize
        @short = [:csand, :csa]
        @input_format = :asciidoc
        @asciidoctor_backend = :csand
      end

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

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
metanorma-csand-1.3.9 lib/metanorma/csand/processor.rb
metanorma-csand-1.3.8 lib/metanorma/csand/processor.rb
metanorma-csand-1.3.7 lib/metanorma/csand/processor.rb
metanorma-csand-1.3.6 lib/metanorma/csand/processor.rb
metanorma-csand-1.3.5 lib/metanorma/csand/processor.rb
metanorma-csand-1.3.4 lib/metanorma/csand/processor.rb
metanorma-csand-1.3.3 lib/metanorma/csand/processor.rb
metanorma-csand-1.3.2 lib/metanorma/csand/processor.rb
metanorma-csand-1.3.1 lib/metanorma/csand/processor.rb
metanorma-csand-1.3.0 lib/metanorma/csand/processor.rb
metanorma-csand-1.2.3 lib/metanorma/csand/processor.rb
metanorma-csand-1.2.2 lib/metanorma/csand/processor.rb
metanorma-csand-1.2.1 lib/metanorma/csand/processor.rb
metanorma-csand-1.2.0 lib/metanorma/csand/processor.rb