Skip to content

Commit adb08a2

Browse files
committed
docs: readme of @vuepress/markdown
1 parent 6a20c40 commit adb08a2

File tree

1 file changed

+36
-22
lines changed

1 file changed

+36
-22
lines changed

Diff for: packages/@vuepress/markdown/README.md

+36-22
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,54 @@
11
# @vuepress/markdown
22

3-
> markdown for vuepress
3+
> markdown library for vuepress
44
5-
## Usage
5+
## Public API
66

7-
```javascript
8-
const createMarkdown = require('@vuepress/markdown')
9-
const md = createMarkdown(/* options */)
10-
```
11-
12-
## Options
7+
### PLUGINS
138

14-
### slugify
9+
A map [constant](./lib/constant.js) containing the names of all built-in markdown-it plugins.
1510

16-
- TODO
11+
### isRequiredPlugin(pluginName: string)
1712

18-
### externalLinks
13+
- **Usage**:
1914

20-
- TODO
15+
```js
16+
const { isRequiredPlugin } = require('@vuepress/markdown')
17+
console.log(isRequiredPlugin(PLUGINS.COMPONENT)) // true
18+
console.log(isRequiredPlugin(PLUGINS.HIGHLIGHT_LINES)) // false
19+
```
2120

22-
### anchor
21+
### removePlugin(config: chainMarkdown, pluginName: string)
2322

24-
- TODO
23+
Remove the specified built-in markdown-it plugin in VuePress.
2524

26-
### toc
25+
It's needed to use with VuePress's [Plugin API > chainMarkdown](https://vuepress.vuejs.org/plugin/option-api.html#chainmarkdown).
2726

28-
- TODO
27+
- **Usage**:
2928

30-
### lineNumbers
29+
```js
30+
// You 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+
```
3138

32-
- TODO
39+
> Note that `PLUGINS.COMPONENT` and `PLUGINS.ANCHOR` are required in VuePress, It is forbidden to delete them!
3340
34-
### beforeInstantiate
41+
### removeAllBuiltInPlugins(config: chainMarkdown)
3542

36-
- TODO
43+
Remove all built-in but not 100% necessary markdown-it plugins in VuePress.
3744

38-
### afterInstantiate
45+
- **Usage**:
3946

40-
- TODO
47+
```js
48+
// You VuePress Plugin or site config.
49+
module.exports = {
50+
chainMarkdown (config) {
51+
require('@vuepress/markdown').removeAllBuiltInPlugins(config)
52+
}
53+
}
54+
```

0 commit comments

Comments
 (0)