Class: Jekyll::TableOfContents::Configuration
- Inherits:
-
Object
- Object
- Jekyll::TableOfContents::Configuration
- Defined in:
- lib/table_of_contents/configuration.rb
Overview
jekyll-toc configuration class
Constant Summary collapse
- DEFAULT_CONFIG =
{ 'min_level' => 1, 'max_level' => 6, 'ordered_list' => false, 'no_toc_section_class' => 'no_toc_section', 'list_id' => 'toc', 'list_class' => 'section-nav', 'sublist_class' => '', 'item_class' => 'toc-entry', 'item_prefix' => 'toc-' }.freeze
Instance Attribute Summary collapse
-
#item_class ⇒ Object
readonly
Returns the value of attribute item_class.
-
#item_prefix ⇒ Object
readonly
Returns the value of attribute item_prefix.
-
#list_class ⇒ Object
readonly
Returns the value of attribute list_class.
-
#list_id ⇒ Object
readonly
Returns the value of attribute list_id.
-
#no_toc_class ⇒ Object
readonly
Returns the value of attribute no_toc_class.
-
#no_toc_section_class ⇒ Object
readonly
Returns the value of attribute no_toc_section_class.
-
#ordered_list ⇒ Object
readonly
Returns the value of attribute ordered_list.
-
#sublist_class ⇒ Object
readonly
Returns the value of attribute sublist_class.
-
#toc_levels ⇒ Object
readonly
Returns the value of attribute toc_levels.
Instance Method Summary collapse
-
#initialize(options) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(options) ⇒ Configuration
Returns a new instance of Configuration.
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/table_of_contents/configuration.rb', line 22 def initialize() = generate_option_hash() @toc_levels = ['min_level']..['max_level'] @ordered_list = ['ordered_list'] @no_toc_class = 'no_toc' @no_toc_section_class = ['no_toc_section_class'] @list_id = ['list_id'] @list_class = ['list_class'] @sublist_class = ['sublist_class'] @item_class = ['item_class'] @item_prefix = ['item_prefix'] end |
Instance Attribute Details
#item_class ⇒ Object (readonly)
Returns the value of attribute item_class.
7 8 9 |
# File 'lib/table_of_contents/configuration.rb', line 7 def item_class @item_class end |
#item_prefix ⇒ Object (readonly)
Returns the value of attribute item_prefix.
7 8 9 |
# File 'lib/table_of_contents/configuration.rb', line 7 def item_prefix @item_prefix end |
#list_class ⇒ Object (readonly)
Returns the value of attribute list_class.
7 8 9 |
# File 'lib/table_of_contents/configuration.rb', line 7 def list_class @list_class end |
#list_id ⇒ Object (readonly)
Returns the value of attribute list_id.
7 8 9 |
# File 'lib/table_of_contents/configuration.rb', line 7 def list_id @list_id end |
#no_toc_class ⇒ Object (readonly)
Returns the value of attribute no_toc_class.
7 8 9 |
# File 'lib/table_of_contents/configuration.rb', line 7 def no_toc_class @no_toc_class end |
#no_toc_section_class ⇒ Object (readonly)
Returns the value of attribute no_toc_section_class.
7 8 9 |
# File 'lib/table_of_contents/configuration.rb', line 7 def no_toc_section_class @no_toc_section_class end |
#ordered_list ⇒ Object (readonly)
Returns the value of attribute ordered_list.
7 8 9 |
# File 'lib/table_of_contents/configuration.rb', line 7 def ordered_list @ordered_list end |
#sublist_class ⇒ Object (readonly)
Returns the value of attribute sublist_class.
7 8 9 |
# File 'lib/table_of_contents/configuration.rb', line 7 def sublist_class @sublist_class end |
#toc_levels ⇒ Object (readonly)
Returns the value of attribute toc_levels.
7 8 9 |
# File 'lib/table_of_contents/configuration.rb', line 7 def toc_levels @toc_levels end |