Class: Bookwatch::Subnav::NavigationEntriesFromMarkdownRoot
- Inherits:
-
Object
- Object
- Bookwatch::Subnav::NavigationEntriesFromMarkdownRoot
- Defined in:
- lib/bookwatch/subnav/navigation_entries_from_markdown_root.rb
Constant Summary collapse
Class.new(RuntimeError)
Class.new(RuntimeError)
Class.new(RuntimeError)
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(product_config, output_locations) ⇒ Object
-
#initialize(fs, require_valid_subnav_links) ⇒ NavigationEntriesFromMarkdownRoot
constructor
A new instance of NavigationEntriesFromMarkdownRoot.
Constructor Details
#initialize(fs, require_valid_subnav_links) ⇒ NavigationEntriesFromMarkdownRoot
Returns a new instance of NavigationEntriesFromMarkdownRoot.
12 13 14 15 16 |
# File 'lib/bookwatch/subnav/navigation_entries_from_markdown_root.rb', line 12 def initialize(fs, ) @fs = fs @require_valid_subnav_links = @renderer = Redcarpet::Markdown.new(Redcarpet::Render::HTML.new) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
37 38 39 |
# File 'lib/bookwatch/subnav/navigation_entries_from_markdown_root.rb', line 37 def config @config end |
#fs ⇒ Object (readonly)
Returns the value of attribute fs.
37 38 39 |
# File 'lib/bookwatch/subnav/navigation_entries_from_markdown_root.rb', line 37 def fs @fs end |
#renderer ⇒ Object (readonly)
Returns the value of attribute renderer.
37 38 39 |
# File 'lib/bookwatch/subnav/navigation_entries_from_markdown_root.rb', line 37 def renderer @renderer end |
#source_for_site_gen ⇒ Object (readonly)
Returns the value of attribute source_for_site_gen.
37 38 39 |
# File 'lib/bookwatch/subnav/navigation_entries_from_markdown_root.rb', line 37 def source_for_site_gen @source_for_site_gen end |
Instance Method Details
#get_links(product_config, output_locations) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/bookwatch/subnav/navigation_entries_from_markdown_root.rb', line 18 def get_links(product_config, output_locations) @source_for_site_gen = output_locations.source_for_site_generator @config = product_config root = absolute_source_from_path(Pathname(config.)) if root.nil? if @require_valid_subnav_links raise SubnavRootMissingError.new('Subnav root not found at: ' + config.) else return [] end end @parsed_files = {Pathname(root) => '(root)'} gather_urls_and_texts(root) end |