提交 bcf85c2a 编写于 作者: U uce

[Docs] Limit nesting of generated TOCs

The jekyll tocify plugin generates an HTML TOC based on the headings
of the markdown files. This commit limits the nesting of the TOC to 2,
which means that only h1 and h2 element will be taken into account.
Previously, all heading elements were used, which resulted in a very
cluttered TOC.
上级 23289d6e
module Jekyll
module Tocify
def tocify(input)
converter = Redcarpet::Markdown.new(Redcarpet::Render::HTML_TOC)
converter = Redcarpet::Markdown.new(Redcarpet::Render::HTML_TOC.new(nesting_level: 2))
converter.render(input)
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册