module Infoboxer::Navigation::Sections

`Sections` module provides logical view on document strcture.

From this module's point of view, each {Tree::Document Document} is a {Sections::Container Sections::Container}, which consists of {Sections::Container#intro} (before first heading) and a set of nested {Sections::Container#sections}.

Each document node, in turn, provides method {Sections::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:

“`ruby document.sections # => list of Section instances document.lookup(:Section) # => []

paragraph.in_sections # => list of sections paragraph.

lookup_parents(:Section) # => []

“`