Class: Madman::Navigation

Inherits:
Object
  • Object
show all
Defined in:
lib/madman/navigation.rb

Overview

Generate a markdown Table of Contents

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dir = '.', depth: 10) ⇒ Navigation

Returns a new instance of Navigation.



8
9
10
# File 'lib/madman/navigation.rb', line 8

def initialize(dir='.', depth: 10)
  @dir, @depth = dir, depth
end

Instance Attribute Details

#depthObject (readonly)

Returns the value of attribute depth.



6
7
8
# File 'lib/madman/navigation.rb', line 6

def depth
  @depth
end

#dirObject (readonly)

Returns the value of attribute dir.



6
7
8
# File 'lib/madman/navigation.rb', line 6

def dir
  @dir
end

Instance Method Details

#markdownObject



16
17
18
# File 'lib/madman/navigation.rb', line 16

def markdown
  @markdown ||= markdown!
end

#tocObject



12
13
14
# File 'lib/madman/navigation.rb', line 12

def toc
  @toc ||= toc!
end