From adb08a2194ab8e875fcc7b769f074ad367f5fa0e Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Wed, 14 Nov 2018 02:41:23 +0800 Subject: [PATCH] docs: readme of @vuepress/markdown --- packages/@vuepress/markdown/README.md | 58 +++++++++++++++++---------- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/packages/@vuepress/markdown/README.md b/packages/@vuepress/markdown/README.md index 048de753..02045401 100644 --- a/packages/@vuepress/markdown/README.md +++ b/packages/@vuepress/markdown/README.md @@ -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) + } +} +``` -- GitLab