# lib-doc **Repository Path**: broncos/lib-doc ## Basic Information - **Project Name**: lib-doc - **Description**: yaml合并工具 - **Primary Language**: JavaScript - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-04-05 - **Last Updated**: 2023-08-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # lib-doc #### 介绍 1. 开发项目时,发现文档管理不太合理,所有的文档,都聚集在index.yaml中,太过臃肿,难以维护,费时费力。为了很好的管理文档,优化编写文档流程,提高团队生产力,产生了open api文档合并工具。 2. 为了不侵入项目,可以全局安装工具,使用`doc -i directory -o filename.yaml`命令输出文档 #### 安装教程 1. yarn全局安装:`yarn global add https://gitee.com/broncos/lib-doc.git` 2. npm全局安装:`npm install -g https://gitee.com/broncos/lib-doc.git` #### 使用说明 ``` Usage: doc [options] Options: -v, --version output the version number -i, --input which directory yaml files need to be merged -o, --output the output of the merged yaml file (default: "tmp.yaml") -h, --help display help for command Examples: $ doc -i /project/dir ``` 1. 工具不做yaml语法的检测,所以请遵守yaml语法规范 2. 工具只基于最外层的key操作,如paths、components 3. 工具期望将paths和components拆分出去,单独管理,基本的yaml信息写在base.yaml里,具体如example文件夹示例 > 特别说明,工具不期望array类型的数据拆分写,比如servers和tags,可以如示例一样,写在base.yaml里。如果与paths、components一样拆分写,最后执行的会覆盖之前的数据