Gitbook 的使用

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

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

石兴稳

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值