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-1.2.5 lib/govspeak/header_extractor.rb
govspeak-1.2.4 lib/govspeak/header_extractor.rb
govspeak-1.2.3 lib/govspeak/header_extractor.rb
govspeak-1.2.2 lib/govspeak/header_extractor.rb
govspeak-1.2.0 lib/govspeak/header_extractor.rb
govspeak-1.1.0 lib/govspeak/header_extractor.rb
govspeak-1.0.1 lib/govspeak/header_extractor.rb
govspeak-1.0.0 lib/govspeak/header_extractor.rb
govspeak-0.8.18 lib/govspeak/header_extractor.rb
govspeak-0.8.17 lib/govspeak/header_extractor.rb
govspeak-0.8.16 lib/govspeak/header_extractor.rb
govspeak-0.8.15 lib/govspeak/header_extractor.rb
govspeak-0.8.14 lib/govspeak/header_extractor.rb
govspeak-0.8.13 lib/govspeak/header_extractor.rb
govspeak-0.8.12 lib/govspeak/header_extractor.rb
govspeak-0.8.11 lib/govspeak/header_extractor.rb
govspeak-0.8.10 lib/govspeak/header_extractor.rb
govspeak-0.8.9 lib/govspeak/header_extractor.rb
govspeak-0.8.8 lib/govspeak/header_extractor.rb
govspeak-0.8.7 lib/govspeak/header_extractor.rb