Class: Madman::Navigation
- Inherits:
-
Object
- Object
- Madman::Navigation
- Defined in:
- lib/madman/navigation.rb
Overview
Generate a markdown Table of Contents
Instance Attribute Summary collapse
-
#depth ⇒ Object
readonly
Returns the value of attribute depth.
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
Instance Method Summary collapse
-
#initialize(dir = '.', depth: 10) ⇒ Navigation
constructor
A new instance of Navigation.
- #markdown ⇒ Object
- #toc ⇒ Object
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
#depth ⇒ Object (readonly)
Returns the value of attribute depth.
6 7 8 |
# File 'lib/madman/navigation.rb', line 6 def depth @depth end |
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
6 7 8 |
# File 'lib/madman/navigation.rb', line 6 def dir @dir end |
Instance Method Details
#markdown ⇒ Object
16 17 18 |
# File 'lib/madman/navigation.rb', line 16 def markdown @markdown ||= markdown! end |
#toc ⇒ Object
12 13 14 |
# File 'lib/madman/navigation.rb', line 12 def toc @toc ||= toc! end |