Sha256: cca0f1fcfdc576fc5dda008e64262115188b78ec5510c0effad5d2966d085451

Contents?: true

Size: 1.72 KB

Versions: 20

Compression:

Stored size: 1.72 KB

Contents

# frozen_string_literal: true

require "reverse_adoc"
require "stepmod/utils/converters/a"
require "stepmod/utils/converters/blockquote"
require "stepmod/utils/converters/br"
require "stepmod/utils/converters/bypass"
require "stepmod/utils/converters/code"
require "stepmod/utils/converters/description"
require "stepmod/utils/converters/drop"
require "stepmod/utils/converters/em_express_description"
require "stepmod/utils/converters/example"
require "stepmod/utils/converters/express_ref_express_description"
require "stepmod/utils/converters/ext_description"
require "stepmod/utils/converters/ext_descriptions"
require "stepmod/utils/converters/head"
require "stepmod/utils/converters/hr"
require "stepmod/utils/converters/ignore"
require "stepmod/utils/converters/module_ref_express_description"
require "stepmod/utils/converters/note"
require "stepmod/utils/converters/p"
require "stepmod/utils/converters/pass_through"
require "stepmod/utils/converters/q"
require "stepmod/utils/converters/strong"
require "stepmod/utils/converters/sub"
require "stepmod/utils/converters/sup"
require "stepmod/utils/converters/text"
require "stepmod/utils/cleaner"

module Stepmod
  module Utils
    class SmrlDescriptionConverter
      def self.convert(input, options = {})
        root = case input
               when String
                 Nokogiri::XML(input).root
               when Nokogiri::XML::Document
                 input.root
               when Nokogiri::XML::Node
                 input
               end

        root || (return "")

        ReverseAdoc.config.with(options) do
          result = ReverseAdoc::Converters.lookup(root.name).convert(root, options)
          Stepmod::Utils::Cleaner.new.tidy(result)
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
stepmod-utils-0.4.8 lib/stepmod/utils/smrl_description_converter.rb
stepmod-utils-0.4.7 lib/stepmod/utils/smrl_description_converter.rb
stepmod-utils-0.4.6 lib/stepmod/utils/smrl_description_converter.rb
stepmod-utils-0.4.5 lib/stepmod/utils/smrl_description_converter.rb
stepmod-utils-0.4.2 lib/stepmod/utils/smrl_description_converter.rb
stepmod-utils-0.4.1 lib/stepmod/utils/smrl_description_converter.rb
stepmod-utils-0.4.0 lib/stepmod/utils/smrl_description_converter.rb
stepmod-utils-0.3.37 lib/stepmod/utils/smrl_description_converter.rb
stepmod-utils-0.3.36 lib/stepmod/utils/smrl_description_converter.rb
stepmod-utils-0.3.35 lib/stepmod/utils/smrl_description_converter.rb
stepmod-utils-0.3.34 lib/stepmod/utils/smrl_description_converter.rb
stepmod-utils-0.3.33 lib/stepmod/utils/smrl_description_converter.rb
stepmod-utils-0.3.32 lib/stepmod/utils/smrl_description_converter.rb
stepmod-utils-0.3.31 lib/stepmod/utils/smrl_description_converter.rb
stepmod-utils-0.3.30 lib/stepmod/utils/smrl_description_converter.rb
stepmod-utils-0.3.29 lib/stepmod/utils/smrl_description_converter.rb
stepmod-utils-0.3.28 lib/stepmod/utils/smrl_description_converter.rb
stepmod-utils-0.3.27 lib/stepmod/utils/smrl_description_converter.rb
stepmod-utils-0.3.26 lib/stepmod/utils/smrl_description_converter.rb
stepmod-utils-0.3.25 lib/stepmod/utils/smrl_description_converter.rb