UNPKG

1.33 kBMarkdownView Raw
1# @vuepress/markdown
2
3> markdown library for VuePress
4
5## Public API
6
7### PLUGINS
8
9A map [constant](./lib/constant.js) containing the names of all built-in markdown-it plugins.
10
11### isRequiredPlugin(pluginName: string)
12
13- **Usage**:
14
15```js
16const { isRequiredPlugin } = require('@vuepress/markdown')
17console.log(isRequiredPlugin(PLUGINS.COMPONENT)) // true
18console.log(isRequiredPlugin(PLUGINS.HIGHLIGHT_LINES)) // false
19```
20
21### removePlugin(config: chainMarkdown, pluginName: string)
22
23Remove the specified built-in markdown-it plugin in VuePress.
24
25It's needed to use with VuePress’s [Plugin API > chainMarkdown](https://vuepress.vuejs.org/plugin/option-api.html#chainmarkdown).
26
27- **Usage**:
28
29```js
30// Your VuePress Plugin or site config.
31const { removePlugin } = require('@vuepress/markdown')
32module.exports = {
33 chainMarkdown (config) {
34 removePlugin(config, PLUGINS.HIGHLIGHT_LINES)
35 }
36}
37```
38
39> Note that `PLUGINS.COMPONENT` and `PLUGINS.ANCHOR` are required in VuePress, It is forbidden to delete them!
40
41### removeAllBuiltInPlugins(config: chainMarkdown)
42
43Remove all built-in but not 100% necessary markdown-it plugins in VuePress.
44
45- **Usage**:
46
47```js
48// Your VuePress Plugin or site config.
49module.exports = {
50 chainMarkdown (config) {
51 require('@vuepress/markdown').removeAllBuiltInPlugins(config)
52 }
53}
54```