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
11
# File 'lib/madman/navigation.rb', line 8

def initialize(dir = '.', depth: 10)
  @dir = dir
  @depth = 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



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

def markdown
  @markdown ||= markdown!
end

#tocObject



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

def toc
  @toc ||= toc!
end