Class: Madness::InlineTableOfContents
- Inherits:
-
Object
- Object
- Madness::InlineTableOfContents
- Includes:
- ServerHelper
- Defined in:
- lib/madness/inline_table_of_contents.rb
Overview
Generate a markdown Table of Contents for a single document
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text) ⇒ InlineTableOfContents
constructor
A new instance of InlineTableOfContents.
- #markdown ⇒ Object
Methods included from ServerHelper
#config, #disallowed_static?, #docroot, #find_static_file, #log, #theme
Constructor Details
#initialize(text) ⇒ InlineTableOfContents
10 11 12 |
# File 'lib/madness/inline_table_of_contents.rb', line 10 def initialize(text) @text = text end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
8 9 10 |
# File 'lib/madness/inline_table_of_contents.rb', line 8 def text @text end |
Instance Method Details
#markdown ⇒ Object
14 15 16 |
# File 'lib/madness/inline_table_of_contents.rb', line 14 def markdown @markdown ||= ([caption, ''] + items).join "\n" end |