lib/jekyll-toc.rb in jekyll-toc-0.9.0.beta1 vs lib/jekyll-toc.rb in jekyll-toc-0.9.0.beta2
- old
+ new
@@ -2,30 +2,34 @@
require 'nokogiri'
require 'table_of_contents/parser'
module Jekyll
- class TocTag < Liquid::Tag
- def render(context)
- return unless context.registers[:page]['toc'] == true
- content_html = context.registers[:page].content
- ::Jekyll::TableOfContents::Parser.new(content_html).build_toc
- end
- end
+ # class TocTag < Liquid::Tag
+ # def render(context)
+ # return unless context.registers[:page]['toc']
+ #
+ # content_html = context.registers[:page].content
+ # ::Jekyll::TableOfContents::Parser.new(content_html).build_toc
+ # end
+ # end
module TableOfContentsFilter
def toc_only(html)
return html unless toc_enabled?
+
::Jekyll::TableOfContents::Parser.new(html, toc_config).build_toc
end
def inject_anchors(html)
return html unless toc_enabled?
+
::Jekyll::TableOfContents::Parser.new(html, toc_config).inject_anchors_into_html
end
def toc(html)
return html unless toc_enabled?
+
::Jekyll::TableOfContents::Parser.new(html, toc_config).toc
end
private