输入命令安装 GitBook。
npm install gitbook-cli -g
检验是否安装成功
gitbook -V
进入要写书的目录,输入命令
gitbook init
初始化完毕后将生成README.md 和SUMMARY.md 文件
gitbook serve
在浏览器地址栏中输入 http://localhost:4000进入项目进行浏览
逐个安装
npm install gitbook-plugin-插件名字
批量安装
gitbook install ./
新建一个book.json文件
{
"title": "标题",
"description": "说明",
"author": "作者",
"language": "zh-hans",
"gitbook": "3.2.2",
"root": ".",
"styles": {
"website": "styles/website.css"
},
"plugins": [
"-lunr",
"-search",
"-highlight",
"livereload",
"theme-comscore",
"theme-default",
"expandable-chapters-small",
"prism",
"prism-themes",
"ace",
"search-plus",
"code",
"back-to-top-button",
"splitter",
"tbfed-pagefooter",
"search-pro",
"page-toc-button",
"custom-favicon"
],
"pluginsConfig": {
"theme-default": {
"showLevel": false
},
"prism": {
"css": [
"prism-themes/themes/prism-vs.css"
],
"lang": {
"flow": "typescript"
}
},
"code": {
"copyButtons": true
},
"tbfed-pagefooter": {
"copyright":"Copyright © 网址 2017",
"modify_label": "该文件修订时间:",
"modify_format": "YYYY-MM-DD HH:mm:ss"
},
"page-toc-button": {
"maxTocDepth": 4,
"minTocSize": 2
},
"favicon": "icon/favicon.ico"
}
}