jsdoc使用

248 阅读1分钟

主要是生成公共componentutil文档说明

安装

mkdir docs //项目中docs独立
cd docs
npm init -y
npm i jsdoc

配置文件

touch conf.json
{
  "tags": {
      "allowUnknownTags": true
  },
  "source": {
      "include": [path],
      "includePattern": ".+\\.js(doc|x)?$",
      "excludePattern": "(^|\\/|\\\\)_"
  },
  "plugins": [],
  "opts": {
      "encoding": "utf8",
      "recurse": true
  },
  "templates": {
    "cleverLinks": false,
    "monospaceLinks": false
    }
}

配置生成文档命令

//package.json
"scripts":{
   "build":"./node_modules/.bin/jsdoc -r -c ./conf.json"
}