Sha256: 65a492bbd886b658968292155021dd2f1b9c194a7ae56db1afb70af7bf6547fb

Contents?: true

Size: 516 Bytes

Versions: 10

Compression:

Stored size: 516 Bytes

Contents

# frozen_string_literal: true

module Stepmod
  module Utils
    module Converters
      class P < ReverseAdoc::Converters::Base
        def convert(node, state = {})
          id = node['id']
          anchor = id ? "[[#{id}]]\n" : ""
          if state[:tdsinglepara]
            "#{anchor}#{treat_children(node, state).strip}"
          else
            "\n\n#{anchor}#{treat_children(node, state).strip}\n\n"
          end
        end
      end

      ReverseAdoc::Converters.register :p, P.new
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
stepmod-utils-0.3.5 lib/stepmod/utils/converters/p.rb
stepmod-utils-0.3.4 lib/stepmod/utils/converters/p.rb
stepmod-utils-0.3.2 lib/stepmod/utils/converters/p.rb
stepmod-utils-0.3.1 lib/stepmod/utils/converters/p.rb
stepmod-utils-0.3.0 lib/stepmod/utils/converters/p.rb
stepmod-utils-0.2.7 lib/stepmod/utils/converters/p.rb
stepmod-utils-0.2.6 lib/stepmod/utils/converters/p.rb
stepmod-utils-0.2.5 lib/stepmod/utils/converters/p.rb
stepmod-utils-0.2.4 lib/stepmod/utils/converters/p.rb
stepmod-utils-0.2.3 lib/stepmod/utils/converters/p.rb