生成markdoown
推薦一個postman導出markdown的方法:
(1.)打開postman,點擊導出
(2.)選擇conllection2 ,或者2.1
(3.) 安裝pip for python2.7
sudo apt update
sudo apt install python-pip
pip --version
pip install postdown
(4.) 轉換json到markdown
postdown xxx.json xxx.md
(5.)將md部署到mindoc上
mindoc安裝
mindoc安裝
docgen使用
(1.)下載源代碼
go get -u github.com/thedevsaddam/docgen //依賴於go環境
(2.)進入docgen目錄
./build.sh //編譯代碼
(3.)生成二進制文件
linux_amd64 //linux
window_amd64.exe //windows
(4.)全局使用,將二進制文件,拷貝到path中
cp ./linux_amd4 /usr/local/bin/docgen
(5.)執行如下命令
// postman導出的json 到頁面展示
docgen server -f xxx.postman_collection.json -p 8000
// postman導出的json到markdown展示
docgen server -f input-postman-collection.json -p 8000 -m
// postman導出的josn 轉為為html文件
docgen build -i input-postman-collection.json -o ~/Downloads/index.html
//postman導出的json文件 轉化為markdown文件
docgen build -i input-postman-collection.json -o ~/Downloads/index.md -m
相關鏈接
https://github.com/TitorX/Postdown
https://github.com/thedevsaddam/docgen