module Jekyll::TableOfContentsFilter
Jekyll
Table of Contents filter plugin
Public Instance Methods
Source
# File lib/jekyll-toc.rb, line 28 def inject_anchors(html) return html unless toc_enabled? TableOfContents::Parser.new(html, toc_config).inject_anchors_into_html end
Source
# File lib/jekyll-toc.rb, line 34 def toc(html) return html unless toc_enabled? TableOfContents::Parser.new(html, toc_config).toc end
Source
# File lib/jekyll-toc.rb, line 22 def toc_only(html) return '' unless toc_enabled? TableOfContents::Parser.new(html, toc_config).build_toc end
Deprecated method. Removed in v1.0.
Private Instance Methods
Source
# File lib/jekyll-toc.rb, line 46 def toc_config @context.registers[:site].config['toc'] || {} end
Source
# File lib/jekyll-toc.rb, line 42 def toc_enabled? @context.registers[:page]['toc'] == true end