@esydoc/resolver-plugin-ext-doc
TypeScript icon, indicating that this package has built-in type declarations

1.0.19 • Public • Published

@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')
          ]
        })
      ]
    }
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @esydoc/resolver-plugin-ext-doc

Weekly Downloads

1

Version

1.0.19

License

ISC

Unpacked Size

667 kB

Total Files

342

Last publish

Collaborators

  • limingyi_100
  • hy-ext