class HTMLPipeline::NodeFilter::TableOfContentsFilter

Examples

TocPipeline =
  HTMLPipeline.new [
    HTMLPipeline::TableOfContentsFilter
  ]
# => #<HTMLPipeline:0x007fc13c4528d8...>
orig = %(<h1>Ice cube</h1><p>is not for the pop chart</p>)
# => "<h1>Ice cube</h1><p>is not for the pop chart</p>"
result = {}
# => {}
TocPipeline.call(orig, {}, result)
# => {:toc=> ...}
result[:toc]
# => "{:href=>"#ice-cube", :text=>"Ice cube"}"
result[:output].to_s
# => "<h1>\n<a id=\"ice-cube\" class=\"anchor\" href=\"#ice-cube\">..."