importmarkdownItTocAndAnchorfrom"markdown-it-toc-and-anchor" markdownIt({ html:true, linkify:true, typographer:true, }) .use(markdownItTocAndAnchor,{ // ...options }) .render(md) ``` ES5 / CommonJS ```js varmarkdownIt=require('markdown-it'), ...
var markdownIt = require('markdown-it'), markdownItTocAndAnchor = require('markdown-it-toc-and-anchor').default; markdownIt({ html: true, linkify: true, typographer: true, }) .use(markdownItTocAndAnchor, { // ...options }) .render(md)...
$ npm install @leisn/markdown-it-toc or $ yarn add @leisn/markdown-it-toc E.g. default Source markdown [toc]#H1-1##H2-1###H3-1#H1-2 Result document <p><divid="toc"class="toc-wrapper"><ul><li><ahref="#toc.1"><spanclass="toc-item-index">1</span>H1-1</a></li>...
* Options for markdown-it-toc-done-right * *@seehttps://github.com/nagaozen/markdown-it-toc-done-right#options */ exportinterfaceTocPluginOptions{ /** * The pattern serving as the TOC placeholder in your markdown */ placeholder?:string ...
"markdownit".varmd=window.markdownit({html:false,xhtmlOut:true,typographer:true}).use(window.markdownItAnchor,{permalink:true,permalinkBefore:true,permalinkSymbol:'§'}).use(window.markdownItTocDoneRight);varresult=md.render("# markdown-it rulezz!\n\n${toc}\n## with markdown-it-toc-...
由于markdown-it本身是同步的,所以不需要担心异步问题,当markdown-it运行完成后,变量一定会指向生成好的目录对象(除非你没给他赋值) importmarkdownitfrom'markdown-it'letmenuTree,mdLinkHTMLconstmd=markdownit({html:true,linkify:true,typography:true}).use(markdownItToc,{// Set directory level(设定目录级...
git clone https://github.com/Sharma-IT/markdown-toc.git cd markdown-toc pip install -e . Usage Basic Usage Generate a TOC for README.md in current directory: markdown-toc Generate a TOC for a specific file: markdown-toc path/to/your/README.md Show help and examples: markdown-toc ...
https://dwatow.github.io/2018/01-28-hexo/how-to-hexo-markdown-it-toc/ ¶markdown-it 如何順利使用 toc 在 hexo 這個文章標題有點難解釋。 首先,這是解決 hexo 的問題。(就是此 blog 產生器的問題) 但是,要改 markdown-it 渲染器才有的問題。 最後,這個問題是 我的 toc 都是 #undefined ¶...
{ "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [ "markdown", "markdown-it", "markdown-it-plugin", "markdown-it-toc" ], "repository": { "type": "git", "url": "https://github.com/GXYyz/markdown-it-toc-better" }, "homepage": "https://xei...
(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_; (Without this flag, the default is to print the TOC to stdout.) --json: Print the TOC in JSON format --append: Append a string to the end of the ...