Module: Infoboxer::Navigation::Sections
- Defined in:
- lib/infoboxer/navigation/sections.rb
Overview
Sections
module provides logical view on document strcture.
From this module's point of view, each Document is a Sections::Container, which consists of Container#intro (before first heading) and a set of nested Container#sections.
Each document node, in turn, provides method Node#in_sections, allowing you to receive list of sections, which contains current node.
NB: Sections are "virtual" nodes, they are not, in fact, in documents tree. So, you can be surprised with:
document.sections # => list of Section instances
document.lookup(:Section) # => []
paragraph.in_sections # => list of sections
paragraph.
lookup_parents(:Section) # => []