工具名称:apiDoc Git地址:https://github.com/apidoc/apidoc 项目地址:http://apidocjs.com/
参数说明: -f 文件过滤 使用正则表达式,表示哪些文件需要本转换,不设置的情况下,默认为.cs .dart .erl .go .java .js .php .py .rb .ts 后缀的文件。
-i 代码文件夹
-o 输出Api文档的路径
-t 使用模板文件的路径,可以自定义输出的模板
无package.json文件时,需要在代码文件夹的根目录下,创建apidoc.json文件。
{ "name": "Apidoc Example", "version": "1.0.0", "description": "Apidoc Example descrption", "title": "Custom apiDoc browser title", "url" : "http://localhost:8000/api/v1", "sampleUrl": "http://localhost:8000/api/v1", "template": { "withCompare": true, "withGenerator": true } }C:\Users\Administrator\AppData\Roaming\npm\node_modules\apidoc\node_modules\apidoc-core\lib\workers\api_group.js 注释掉 //group = group.replace(/[^\w]/g, ‘_’);
接口打开路径会根据 @apiGroup + @apiName