acyort-util-md
- use remark to parse markdown
- use prismjs to highlight code
- use gatsby-remark-prismjs adapted
remark
andprismjs
- use prettier to format
code
- use github-slugger and markdown-toc to generate
toc
- use remark-container to parse
:::
syntax todiv.container
, like vuepress/markdown-container
Usage
const toc parseMd frontMatter = ;const md = '#heading'const tocHTML = const contentHTML = // format yaml front-matterconst data =
Types
declare
Markdown Extensions
toc and heading
use the same slug to parse html
and generate toc
input
# hefd A b c## heading2
output
<!-- toc --> hefd A b c heading2 <!-- body --> hefd A b c heading2
code
block-container
input
::: tipThis is content:::
output
TIP this is content
front-matter
use gray-matter to format yaml
---data1: some textdata2:- listItem1- listItem2---