@esydoc/resolver-plugin-ext-doc
v1.0.19
Published
> TODO: description
Downloads
6
Readme
@esydoc/resolver-plugin-ext-doc
定制小程序文档插件
Props
type MatchItem = {
regex: RegExp // 匹配 api 的 path,例如:hyExt.advance.getTid()
makeTemplate: (
options: RenderOptions,
helper: typeof DocCodeResolver
) => string
}
// 定制文档
type HYExtDocPluginProps = {
match?: MatchItem[]
helpers?: string[]
partials?: string[]
}
Usage
const path = require('path')
const HYExtDocPlugin = require('@esydoc/resolver-plugin-ext-doc')
module.exports = {
source: {
include: ['src/modules'],
exclude: ['src/edoc-api-config']
},
context: __dirname,
apiConfigPaths: ['src/edoc-api-config/**.js'],
apiConfigDefaultOutputPath: 'src/edoc-api-config',
resolves: {
'@esydoc/resolver-doc': {
plugins: [
new HYExtDocPlugin({
match: [
{
regex: /commonOperate/,
makeTemplate: () => `{{>commonOperate}}`
},
{
regex: /commonQuery/,
makeTemplate: () => `{{>commonQuery}}`
}
],
partials: [
path.join(__dirname, './custom/commonOperate.hbs'),
path.join(__dirname, './custom/commonQuery.hbs')
]
})
]
}
}
}