-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
36 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,54 @@ | ||
# @vuepress/markdown | ||
|
||
> markdown for vuepress | ||
> markdown library for vuepress | ||
## Usage | ||
## Public API | ||
|
||
```javascript | ||
const createMarkdown = require('@vuepress/markdown') | ||
const md = createMarkdown(/* options */) | ||
``` | ||
|
||
## Options | ||
### PLUGINS | ||
|
||
### slugify | ||
A map [constant](./lib/constant.js) containing the names of all built-in markdown-it plugins. | ||
|
||
- TODO | ||
### isRequiredPlugin(pluginName: string) | ||
|
||
### externalLinks | ||
- **Usage**: | ||
|
||
- TODO | ||
```js | ||
const { isRequiredPlugin } = require('@vuepress/markdown') | ||
console.log(isRequiredPlugin(PLUGINS.COMPONENT)) // true | ||
console.log(isRequiredPlugin(PLUGINS.HIGHLIGHT_LINES)) // false | ||
``` | ||
|
||
### anchor | ||
### removePlugin(config: chainMarkdown, pluginName: string) | ||
|
||
- TODO | ||
Remove the specified built-in markdown-it plugin in VuePress. | ||
|
||
### toc | ||
It's needed to use with VuePress's [Plugin API > chainMarkdown](https://vuepress.vuejs.org/plugin/option-api.html#chainmarkdown). | ||
|
||
- TODO | ||
- **Usage**: | ||
|
||
### lineNumbers | ||
```js | ||
// You VuePress Plugin or site config. | ||
const { removePlugin } = require('@vuepress/markdown') | ||
module.exports = { | ||
chainMarkdown (config) { | ||
removePlugin(config, PLUGINS.HIGHLIGHT_LINES) | ||
} | ||
} | ||
``` | ||
|
||
- TODO | ||
> Note that `PLUGINS.COMPONENT` and `PLUGINS.ANCHOR` are required in VuePress, It is forbidden to delete them! | ||
### beforeInstantiate | ||
### removeAllBuiltInPlugins(config: chainMarkdown) | ||
|
||
- TODO | ||
Remove all built-in but not 100% necessary markdown-it plugins in VuePress. | ||
|
||
### afterInstantiate | ||
- **Usage**: | ||
|
||
- TODO | ||
```js | ||
// You VuePress Plugin or site config. | ||
module.exports = { | ||
chainMarkdown (config) { | ||
require('@vuepress/markdown').removeAllBuiltInPlugins(config) | ||
} | ||
} | ||
``` |