markdown-ext
Add basic GFM support to VuePress with useful features.
Usage
npm i -D @vuepress/plugin-markdown-ext@nextimport { markdownExtPlugin } from '@vuepress/plugin-markdown-ext'
export default {
plugins: [
markdownExtPlugin({
// options
}),
],
}Syntax
Footnote
Use
[^Anchor text]in Markdown to define a footnoteUse
[^Anchor text]: ...to describe footnote contentIf there are multiple paragraphs in footnote, the paragraph show be double indented
Footnote 1 link[1].
Footnote 2 link[2].
Inline footnote[3] definition.
Duplicated footnote reference[2:1].
Footnote 1 link[^first].
Footnote 2 link[^second].
Inline footnote^[Text of inline footnote] definition.
Duplicated footnote reference[^second].
[^first]: Footnote **can have markup**
and multiple paragraphs.
[^second]: Footnote text.Task list
- Use
- [ ] some textto render an unchecked task item. - Use
- [x] some textto render a checked task item. (CapitalXis also supported)
- [ ] Plan A
- [x] Plan BComponent
You can use component fence block to add a component into your markdown content. Both YAML and JSON format props data are supported:
YAML Recommended:
```component ComponentName # component data here ```JSON:
```component ComponentName { // component data here } ```
```component Badge
text: Mr.Hope
type: tip
```
```component Badge
{
"text": "Mr.Hope",
"type": "tip"
}
```v-pre
You can use any mustache syntax as raw text in v-pre container:
{{ abc }}
::: v-pre
{{ abc }}
:::Options
booleanWhether tweaks the behavior and features to be more similar to GitHub Flavored Markdown.
markdown-it already supports tables and strike through by default. If this option is true, the following new features will be enabled:
- Auto link (named
linkifyinmarkdown-it) - Hard breaks
- Footnote
- Task list
Note: Not all behavior is exactly the same as GitHub Flavored Markdown.
booleanWhether to enable footnote format support.
MarkdownItTaskListOptions | booleanWhether to enable tasklist format support. You can pass an object to config tasklist.
booleantrueWhether disable checkbox.
booleantrueWhether use <label> to wrap text.
booleanWhether convert \n in paragraphs into <br>s.
booleanWhether convert URL-like text into links.
booleanWhether to enable component fence support.
booleanWhether to enable v-pre wrapper.
booleanWhether to enable CJK-friendly support for emphasis marks. When not set, automatically enabled for CJK languages (zh, ja, ko) detected in site configuration.
