Gitbook 还是非常方便的,
下面是安装步骤
使用Centos7.5 mini 版本操作系统,需要关闭firewalled 和禁用selinux
systemctl stop firewalld && systemctl disable firewalld
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenforce 0
##安装基础软件
yum install epel-release -y
yum install nodejs -y
##npm 进行安装 gitbook-cli
npm install -g gitbook-cli
npm install -g gitbook-cli
/usr/bin/gitbook -> /usr/lib/node_modules/gitbook-cli/bin/gitbook.js
/usr/lib
└─┬ gitbook-cli@2.3.2
├── bash-color@0.0.4
├── commander@2.11.0
##创建一个目录
[root@localhost opt]# mkdir /opt/gitbook
[root@localhost opt]# cd gitbook/
##初始化 gitbook
[root@localhost gitbook]# gitbook init
Installing GitBook 3.2.3
warn: no summary file in this book
info: create README.md
info: create SUMMARY.md
info: initialization is finished
##构建
[root@localhost gitbook]# gitbook build
info: 7 plugins are installed
info: 6 explicitly listed
info: loading plugin "highlight"... OK
info: loading plugin "search"... OK
info: loading plugin "lunr"... OK
info: loading plugin "sharing"... OK
info: loading plugin "fontsettings"... OK
info: loading plugin "theme-default"... OK
info: found 1 pages
info: found 0 asset files
info: >> generation finished with success in 0.9s !
##启动服务 该服务可以后台启用 且加入开启自启动
[root@localhost gitbook]# gitbook serve
Live reload server started on port: 35729
Press CTRL+C to quit ...
info: 7 plugins are installed
info: loading plugin "livereload"... OK
info: loading plugin "highlight"... OK
info: loading plugin "search"... OK
info: loading plugin "lunr"... OK
info: loading plugin "sharing"... OK
info: loading plugin "fontsettings"... OK
info: loading plugin "theme-default"... OK
info: found 1 pages
info: found 0 asset files
info: >> generation finished with success in 1.8s !
Starting server ...
Serving book on http://localhost:4000