1.0.1 • Published 11 months ago

stencil-doc-generator v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Install

npm install stencil-doc-generator -D

Usage

在stencil.config.ts中配置自定义文档输出:

{
  outputTargets:[
    {
      type: 'docs-custom',
      generator: generateCustomDoc({
        templatePath: './template.mdx',
        outputDir: 'docs/',
        outputFileName: (tag) => {
          return `${tag}.mdx`
        }
      })
    },
  ]
}

所有的组件文档会被自动生成到目标目录下

Template

本项目中有一个默认的模板,也可以使用自己创建的模版,模版使用模版引擎handlebars编写,具体可以参考handlebars,传入的编译数据类型可参考stencil-docs

Interface

选项类型描述默认值
templatestring模板字符串可选
templatePathstring模板文件路径可选
outputDirstring输出目录可选
outputFileSuffixstring输出文件后缀'md'
outputFileName(tag: string, file: string) => string输出文件名生成函数可选
compileOptionsobject编译选项可选
1.0.1

11 months ago

1.0.0

11 months ago