1 | # @vuepress/markdown
|
2 |
|
3 | > markdown library for VuePress
|
4 |
|
5 | ## Public API
|
6 |
|
7 | ### PLUGINS
|
8 |
|
9 | A 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
|
16 | const { isRequiredPlugin } = require('@vuepress/markdown')
|
17 | console.log(isRequiredPlugin(PLUGINS.COMPONENT)) // true
|
18 | console.log(isRequiredPlugin(PLUGINS.HIGHLIGHT_LINES)) // false
|
19 | ```
|
20 |
|
21 | ### removePlugin(config: chainMarkdown, pluginName: string)
|
22 |
|
23 | Remove the specified built-in markdown-it plugin in VuePress.
|
24 |
|
25 | It'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.
|
31 | const { removePlugin } = require('@vuepress/markdown')
|
32 | module.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 |
|
43 | Remove 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.
|
49 | module.exports = {
|
50 | chainMarkdown (config) {
|
51 | require('@vuepress/markdown').removeAllBuiltInPlugins(config)
|
52 | }
|
53 | }
|
54 | ```
|