gitbook 制作文档
1、安装
[root@gitbook date]# history
curl -O http://file.youto.club/Script/init.sh
sh init.sh gitbook
wget https://registry.npmmirror.com/-/binary/node/v10.23.0/node-v10.23.0-linux-x64.tar.xz
tar xf node-v10.23.0-linux-x64.tar.xz -C /usr/local/
ln -s node-v10.23.0-linux-x64 node
vim /etc/profile
source /etc/profile
node -v
npm -v
npm config set registry https://registry.npm.taobao.org
npm config get registry
npm install -g gitbook-cli
mkdir /date
cd /date/
gitbook init
gitbook build
gitbook serve
2、检查 node 版本
[root@gitbook local]# node -v
v10.23.0
[root@gitbook local]# npm -v
6.14.8
3、测试
[root@gitbook date]# ls
README.md SUMMARY.md
[root@gitbook date]# cat SUMMARY.md
# Summary
* [Introduction](README.md)
[root@gitbook date]# cat README.md
# Introduction
[root@gitbook date]# 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.3s !
[root@gitbook date]# 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 0.3s !
Starting server ...
Serving book on http://localhost:4000
4、美化 & 安装插件
[root@gitbook date]# cat book.json
{
"title": "Acha Note Book",
"description": "histry",
"author": "Acha <wz.0527@qq.com>",
"lang": "zh-hans",
"plugins": [
"-search","-sharing","fontsettings","expandable-chapters","chapter-fold","code","lightbox","anchor-navigation-ex","local-video"
],
"pluginsConfig": {
"anchor-navigation-ex": {
"showLevel": false,
"showGoTop": false
}
}
}
npm i gitbook-plugin-expandable-chapters
npm i gitbook-plugin-chapter-fold
npm i gitbook-plugin-code
npm i gitbook-plugin-lightbox
npm i gitbook-plugin-anchor-navigation-ex
npm i gitbook-plugin-local-video
5、目录结构
[root@gitbook date]# cat SUMMARY.md
# Summary
* [简介](README.md)
* [杂谈](杂谈/README.md)
* [docker for windows](杂谈/docker for windows.md)
* [Hyper-V](杂谈/Hyper-V.md)
* [Windows Server 2022 使用](杂谈/Windows Server 2022 使用.md)
评论