Class: Govspeak::HeaderExtractor

Inherits:
Kramdown::Converter::Base
  • Object
show all
Defined in:
lib/govspeak/header_extractor.rb

Instance Method Summary collapse

Instance Method Details

#convert(doc) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/govspeak/header_extractor.rb', line 5

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