Class MaRuKu::Section
In: lib/maruku/toc.rb
Parent: Object

A section in the table of contents of a document.

Methods

_to_html   _to_latex   inspect   new   numerate   to_html   to_latex  

Attributes

header_element  [RW]  The `:header` node for this section. The value of `meta[:section]` for the header will be this node.

@return [MDElement]

immediate_children  [RW]  The immediate child nodes of this section.

@todo Why does this never contain Strings?

@return [Array<MDElement>]

section_children  [RW]  The subsections of this section.

@return [Array<Section>]

section_level  [RW]  The depth of the section (0 for toplevel).

Equivalent to `header_element.level`.

@return [Fixnum]

section_number  [RW]  The nested section number, e.g. `[1, 2, 5]` for Section 1.2.5.

@return [Array<Fixnum>]

Public Class methods

Public Instance methods

Assign \{section_number section numbers} to this section and its children. This also assigns the section number attribute to the sections’ headers.

This should only be called on the root section.

@overload def numerate

Returns an HTML representation of the table of contents.

This should only be called on the root section.

Returns a LaTeX representation of the table of contents.

This should only be called on the root section.

Protected Instance methods

[Validate]