yapi-plugin-api-doc
Advanced tools
@@ -5,3 +5,3 @@ /* | ||
| * @LastEditors: qiucong | ||
| * @LastEditTime: 2020-05-20 17:28:09 | ||
| * @LastEditTime: 2020-05-21 13:54:57 | ||
| */ | ||
@@ -120,2 +120,3 @@ const baseController = require('controllers/base.js'); | ||
| // 分类信息 | ||
| // todo 这种创建的接口没有project的basepath,需要修复 | ||
| mdTemplate += md.createListMarkdown(list, isToc); | ||
@@ -122,0 +123,0 @@ return mdTemplate; |
@@ -82,3 +82,3 @@ const baseController = require('controllers/base.js'); | ||
| try { | ||
| const wikiModel = require('../../yapi-plugin-wiki/wikiModel.js'); | ||
| const wikiModel = require(yapi.path.join(yapi.WEBROOT, '/exts/yapi-plugin-wiki/wikiModel.js')); | ||
| wikiData = await yapi.getInst(wikiModel).get(pid); | ||
@@ -85,0 +85,0 @@ } catch (error) { |
+0
-5
@@ -11,7 +11,2 @@ const shell = require ('shelljs'); | ||
| shell.exec ('git pull origin master'); | ||
| let a = shell.exec (`git tag |grep ${version} |wc -l`); | ||
| if (a && parseInt (a) > 0) { | ||
| shell.exec ('git tag -d ' + version); | ||
| shell.exec ('git push origin :' + version); | ||
| } | ||
| shell.exec ('git tag ' + version); | ||
@@ -18,0 +13,0 @@ shell.exec ('git push origin ' + version); |
+1
-1
| { | ||
| "name": "yapi-plugin-api-doc", | ||
| "version": "0.2.0", | ||
| "version": "0.2.1", | ||
| "description": "在标签页中加入查看接口文档,在线查看接口文档", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+15
-1
@@ -5,6 +5,20 @@ # yapi-plugin-api-doc | ||
| 第一步:在config.json 这层目录下运行 ```yapi plugin --name yapi-plugin-api-doc``` 安装插件 | ||
| ## 安装 | ||
| 第一步:在config.json这层目录下运行 `yapi plugin --name yapi-plugin-api-doc` 安装插件 | ||
| 第二步: 重启服务器 | ||
| 注:如果是第一次安装插件会安装依赖,由于node-sass安装极易失败可能导致插件安装失败,可以手动进入vendors手动安装`npm i node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass/`后再执行上述步骤重新安装插件。 | ||
| ### 更新 | ||
| 通过yapi-cli更新插件还是比较麻烦的,直接再执行一次命令并不会更新。因为yapi-cli安装插件实际上就是在vendors目录下执行`npm install --registry https://registry.npm.taobao.org yapi-plugin-api-doc`,所以最后会在package.json文件中记录下开始安装的版本号,再次执行安装的还是同一个版本。 | ||
| 执行如下操作可以进行更新: | ||
| 1. 进入`vendors`目录中,需要先清除ykit的缓存,删除`node_modules/.ykit_cache`文件夹 | ||
| 2. 修改package.json里面`yapi-plugin-api-doc`的版本或者直接`npm i yapi-plugin-api-doc@version` | ||
| 3. 执行命令`NODE_ENV=production ykit pack -m` | ||
| 4. 在config.json这层目录下执行命令`yapi plugin --name yapi-plugin-api-doc`后再重启服务器就完成安装指定版本的插件 | ||
| ## 特性 | ||
@@ -11,0 +25,0 @@ |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
56024
1.9%41
51.85%1843
-0.22%3
50%