Class: Govspeak::HeaderExtractor
- Inherits:
-
Kramdown::Converter::Base
- Object
- Kramdown::Converter::Base
- Govspeak::HeaderExtractor
- 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.[:raw_text], el.[:level], generate_id(el.[:raw_text])) end end.compact end |