Method: Amber::Render::TableOfContents#initialize
- Defined in:
- lib/amber/render/table_of_contents.rb
#initialize(html, options = {}) ⇒ TableOfContents
options:
:content_selector (css selector for headings, nokogiri backend only)
:href_base -- use this href for the toc links
:numeric_prefix -- prefix toc entries and headings with numeric counter (e.g. 1.1.0, 1.2.0, ...)
23 24 25 26 27 28 29 30 31 |
# File 'lib/amber/render/table_of_contents.rb', line 23 def initialize(html, = {}) @html = html @toc = TocItem.new @levels = {"h1" => 0, "h2" => 0, "h3" => 0, "h4" => 0} @heading_anchors = {} = [:tag] ||= 'ol' @parsed = nil end |