-
Notifications
You must be signed in to change notification settings - Fork 3
socube用户手册维护流程
GCS-ZHN edited this page Jul 18, 2022
·
3 revisions
- 熟悉markdown
- 熟悉git版本控制管理
- 熟悉gitbook
- nodejs <= 16.14.0
- gitbook-cli@latest
- git
安装nodejs有两种主要途径,一种是直接去官网下载,另外一种是使用nvm版本控制器安装。安装好nodejs后使用npm安装gitbook
choco install nvm # windows下,先安装nvm,没有安装choco的建议安装一下,它相当于linux的yum/dnf/apt-get
choco install git # 安装git,也可以去git官网下载安装包
nvm install 12.22.12 # 安装指定版本nodejs,管理员权限
nvm use 12.22.12 # 管理员
npm i gitbook-cli@latest -g # 全局安装,建议使用国内镜像
- fork当前仓库到自己的仓库
- 克隆自己的仓库
git clone git@github.com:OWNER/socube-docs
- vscode打开项目文件夹
- 在指定语种的子目录下进行修改
- 新建语种时,先
zh-hans
简体中文子目录复制,并将内容翻译成对应语言,目录名称需要和符合国际标准
简写 | 语言 |
---|---|
zh-hans | 简体中文 |
jp | 日语 |
en | 英语 |
zh | 繁体中文 |
zh-tw | 台湾繁体中文 |
-
gitbook serve
启动本地gitbook服务,查看是否正常生成文档。 - git提交(commit)修改,并推送到你的fork仓库,再去github web页面发起Pull requests(PR)合并到本仓库
git add .
git commit -m "提交信息的描述"
git push # push到origin远程仓库,也就是clone的仓库
- 审核人员审核通过,拉取合并内容,docs页面自动更新。
- gitbook init/build/serve时遇到下列报错
cb.apply is not a function
。
if (cb) cb.apply(this, arguments)
^
TypeError: cb.apply is not a function
at C:\Users\zhang\AppData\Roaming\npm\node_modules\gitbook-cli\node_modules\npm\node_modules\graceful-fs\polyfills.js:287:18
at FSReqCallback.oncomplete (node:fs:199:5)
解决方法:用vscode编辑日志提示的polyfills.js文件的62-64行,将其注释掉
// fs.stat = statFix(fs.stat)
// fs.fstat = statFix(fs.fstat)
// fs.lstat = statFix(fs.lstat)
- gitbook-cli初始化卡在
Installing GitBook 3.2.3
Installing GitBook 3.2.3
(node:27028) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
(node:27028) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
(node:27028) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
(node:27028) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
解决办法:等着吧,国内就是慢,安装完就好了,至于上面的Warning,不用管。