Sha256: 161b43930935f70bf8ed3a21b24a69bbd2e7850fb79288028cc3b311eef806d7

Contents?: true

Size: 345 Bytes

Versions: 42

Compression:

Stored size: 345 Bytes

Contents

module Govspeak
  Header = Struct.new(:text, :level, :id)

  class HeaderExtractor < Kramdown::Converter::Base
    def convert(doc)
      doc.root.children.map do |el|
        if el.type == :header
          Header.new(el.options[:raw_text], el.options[:level], generate_id(el.options[:raw_text]))
        end
      end.compact
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
govspeak-3.5.1 lib/govspeak/header_extractor.rb
govspeak-3.5.0 lib/govspeak/header_extractor.rb
govspeak-3.4.0 lib/govspeak/header_extractor.rb
govspeak-3.3.0 lib/govspeak/header_extractor.rb
govspeak-3.2.0 lib/govspeak/header_extractor.rb
govspeak-3.1.1 lib/govspeak/header_extractor.rb
govspeak-3.1.0 lib/govspeak/header_extractor.rb
govspeak-3.0.0 lib/govspeak/header_extractor.rb
govspeak-2.0.2 lib/govspeak/header_extractor.rb
govspeak-2.0.0 lib/govspeak/header_extractor.rb
govspeak-1.6.2 lib/govspeak/header_extractor.rb
govspeak-1.6.1 lib/govspeak/header_extractor.rb
govspeak-1.6.0 lib/govspeak/header_extractor.rb
govspeak-1.5.4 lib/govspeak/header_extractor.rb
govspeak-1.5.3 lib/govspeak/header_extractor.rb
govspeak-1.5.2 lib/govspeak/header_extractor.rb
govspeak-1.5.1 lib/govspeak/header_extractor.rb
govspeak-1.5.0 lib/govspeak/header_extractor.rb
govspeak-1.4.0 lib/govspeak/header_extractor.rb
govspeak-1.3.0 lib/govspeak/header_extractor.rb