Sha256: b7e9755375c52bf4ee93840810d063d01302838cd11845e74926dba58bcd92e6

Contents?: true

Size: 465 Bytes

Versions: 7

Compression:

Stored size: 465 Bytes

Contents

module ReverseAsciidoctor
  module Converters
    class H < Base
      def convert(node, state = {})
        id = node['id']
        anchor = id ? "[[#{id}]]\n" : ""
        prefix = '=' * (node.name[/\d/].to_i + 1)
        ["\n", anchor, prefix, ' ', treat_children(node, state), "\n"].join
      end
    end

    register :h1, H.new
    register :h2, H.new
    register :h3, H.new
    register :h4, H.new
    register :h5, H.new
    register :h6, H.new
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
reverse_adoc-0.2.5 lib/reverse_asciidoctor/converters/h.rb
reverse_adoc-0.2.4 lib/reverse_asciidoctor/converters/h.rb
reverse_adoc-0.2.3 lib/reverse_asciidoctor/converters/h.rb
reverse_asciidoctor-0.2.2 lib/reverse_asciidoctor/converters/h.rb
reverse_asciidoctor-0.2.1 lib/reverse_asciidoctor/converters/h.rb
reverse_asciidoctor-0.2.0 lib/reverse_asciidoctor/converters/h.rb
reverse_asciidoctor-0.1.0 lib/reverse_asciidoctor/converters/h.rb