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 11 |
# File 'lib/madman/navigation.rb', line 8 def initialize(dir = '.', depth: 10) @dir = dir @depth = 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
17 18 19 |
# File 'lib/madman/navigation.rb', line 17 def markdown @markdown ||= markdown! end |
#toc ⇒ Object
13 14 15 |
# File 'lib/madman/navigation.rb', line 13 def toc @toc ||= toc! end |