Closed EYHN closed 7 years ago
var markdownIt = require('markdown-it'), markdownItTocAndAnchor = require('markdown-it-toc-and-anchor').default; markdownIt({ html: true, linkify: true, typography: true, }) .use(markdownItTocAndAnchor, { // ...options }) .render("## Hello World! Hexo!\n\n从wordpress转Hexo啦!\n\n<!--more-->\n\n### Hello World! Hexo!\n\n## Hello World! Hexo!\n\nHexo真的比wordpress,geek多了,零成本博客不是梦!\n\n## Hello World! Hexo!\n\n现在还在配置主题和Hexo,下面列出建站过程中利用到的工具和开源项目。顺便熟悉markdown语法。\n\n#### Hello World! Hexo!\n\n* [Hexo](https://hexo.io) 基于node的博客框架\n* [hexo-theme-material](https://github.com/viosey/hexo-theme-material) Material 原质 -- 酷炫的md风格主题\n* [Coding](https://coding.net) 国内免费的pages服务,本站由Coding托管\n* [Vscode](https://code.visualstudio.com/) 我使用vscode写markdown\n\n头像自动同步qq头像,调用的是这个接口\n\n[http://q1.qlogo.cn/headimg_dl?bs=QQ号&dst_uin=QQ号&spec=100&url_enc=0&referer=bu_interface&term_type=PC](http://q1.qlogo.cn/headimg_dl?bs=1106996185&dst_uin=1106996185&spec=100&url_enc=0&referer=bu_interface&term_type=PC)")
Please update your NPM package as soon as possible !!!
Done: https://www.npmjs.com/package/markdown-it-toc-and-anchor