Class: Middleman::Tocable::TocGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/middleman/tocable/toc_generator.rb

Overview

A store of all the blog slides in the site, with accessors for the slides by various dimensions. Accessed via “blog” in templates.

Instance Method Summary collapse

Constructor Details

#initialize(page) ⇒ TocGenerator

Returns a new instance of TocGenerator.



11
12
13
14
15
16
# File 'lib/middleman/tocable/toc_generator.rb', line 11

def initialize page
  @page = page
  @toc = []
  
  generate
end

Instance Method Details

#add(node) ⇒ Object



18
19
20
# File 'lib/middleman/tocable/toc_generator.rb', line 18

def add node
  node
end

#tocObject



22
23
24
# File 'lib/middleman/tocable/toc_generator.rb', line 22

def toc
  @toc
end