Module: Jekyll::TableOfContentsFilter
- Defined in:
- lib/jekyll-toc.rb
Overview
Jekyll Table of Contents filter plugin
Instance Method Summary collapse
- #inject_anchors(html) ⇒ Object
- #toc(html) ⇒ Object
-
#toc_only(html) ⇒ Object
Deprecated method.
Instance Method Details
#inject_anchors(html) ⇒ Object
30 31 32 33 34 |
# File 'lib/jekyll-toc.rb', line 30 def inject_anchors(html) return html unless toc_enabled? TableOfContents::Parser.new(html, toc_config).inject_anchors_into_html end |
#toc(html) ⇒ Object
36 37 38 39 40 |
# File 'lib/jekyll-toc.rb', line 36 def toc(html) return html unless toc_enabled? TableOfContents::Parser.new(html, toc_config).toc end |
#toc_only(html) ⇒ Object
Deprecated method. Removed in v1.0.
22 23 24 25 26 27 28 |
# File 'lib/jekyll-toc.rb', line 22 def toc_only(html) Jekyll.logger.warn 'Deprecation: toc_only filter is deprecated and will be remove in jekyll-toc v1.0.', 'Use `{% toc %}` instead of `{{ contents | toc_only }}`.' return '' unless toc_enabled? TableOfContents::Parser.new(html, toc_config).build_toc end |