Sha256: 3a1fc7e338002edfcdccf1c0e76eedd1ab2a7fdc098cd016374bc9579807a52d

Contents?: true

Size: 919 Bytes

Versions: 7

Compression:

Stored size: 919 Bytes

Contents

require "metanorma/processor"

module Metanorma
  module Standoc
    class Processor < Metanorma::Processor

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

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

      def version
        "Asciidoctor::Standoc #{Metanorma::Standoc::VERSION}/IsoDoc #{IsoDoc::VERSION}"
      end

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

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
metanorma-standoc-1.0.4 lib/metanorma/standoc/processor.rb
metanorma-standoc-1.0.3 lib/metanorma/standoc/processor.rb
metanorma-standoc-1.0.2 lib/metanorma/standoc/processor.rb
metanorma-standoc-1.0.1 lib/metanorma/standoc/processor.rb
metanorma-standoc-1.0.0 lib/metanorma/standoc/processor.rb
metanorma-standoc-0.0.2 lib/metanorma/standoc/processor.rb
metanorma-standoc-0.0.1 lib/metanorma/standoc/processor.rb