mirror of
https://github.com/wahyd4/vuepress.git
synced 2026-08-09 05:16:23 +10:00
- fix($core): markdown slot doesn‘t work. (regression of c85f62d)
- docs: fresh Node.JS API.
- test: official plugins.
34 lines
694 B
JavaScript
34 lines
694 B
JavaScript
'use strict'
|
|
|
|
/**
|
|
* Module dependencies.
|
|
*/
|
|
|
|
const createMarkdown = require('@vuepress/markdown')
|
|
|
|
/**
|
|
* Expose createMarkdown.
|
|
*/
|
|
|
|
module.exports = function (ctx) {
|
|
const { markdown: markdownConfig = {}} = ctx.siteConfig
|
|
const { chainMarkdown, extendMarkdown } = markdownConfig
|
|
|
|
const beforeInstantiate = config => {
|
|
chainMarkdown && chainMarkdown(config)
|
|
ctx.pluginAPI.applySyncOption('chainMarkdown', config)
|
|
}
|
|
|
|
const afterInstantiate = md => {
|
|
extendMarkdown && extendMarkdown(md)
|
|
ctx.pluginAPI.applySyncOption('extendMarkdown', md)
|
|
}
|
|
|
|
return createMarkdown(
|
|
Object.assign(markdownConfig, {
|
|
beforeInstantiate,
|
|
afterInstantiate
|
|
})
|
|
)
|
|
}
|