Class: Bookbinder::Subnav::JsonFromMarkdownToc
- Inherits:
-
Object
- Object
- Bookbinder::Subnav::JsonFromMarkdownToc
- Defined in:
- lib/bookbinder/subnav/json_from_markdown_toc.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#fs ⇒ Object
readonly
Returns the value of attribute fs.
-
#renderer ⇒ Object
readonly
Returns the value of attribute renderer.
-
#source_for_site_gen ⇒ Object
readonly
Returns the value of attribute source_for_site_gen.
Instance Method Summary collapse
- #get_links(subnav_config, output_locations) ⇒ Object
-
#initialize(fs) ⇒ JsonFromMarkdownToc
constructor
A new instance of JsonFromMarkdownToc.
Constructor Details
#initialize(fs) ⇒ JsonFromMarkdownToc
Returns a new instance of JsonFromMarkdownToc.
8 9 10 11 |
# File 'lib/bookbinder/subnav/json_from_markdown_toc.rb', line 8 def initialize(fs) @fs = fs @renderer = Redcarpet::Markdown.new(Redcarpet::Render::HTML.new) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
20 21 22 |
# File 'lib/bookbinder/subnav/json_from_markdown_toc.rb', line 20 def config @config end |
#fs ⇒ Object (readonly)
Returns the value of attribute fs.
20 21 22 |
# File 'lib/bookbinder/subnav/json_from_markdown_toc.rb', line 20 def fs @fs end |
#renderer ⇒ Object (readonly)
Returns the value of attribute renderer.
20 21 22 |
# File 'lib/bookbinder/subnav/json_from_markdown_toc.rb', line 20 def renderer @renderer end |
#source_for_site_gen ⇒ Object (readonly)
Returns the value of attribute source_for_site_gen.
20 21 22 |
# File 'lib/bookbinder/subnav/json_from_markdown_toc.rb', line 20 def source_for_site_gen @source_for_site_gen end |
Instance Method Details
#get_links(subnav_config, output_locations) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/bookbinder/subnav/json_from_markdown_toc.rb', line 13 def get_links(, output_locations) @source_for_site_gen = output_locations.source_for_site_generator @config = { links: get_links_and_headers }.to_json end |