GitBook基本使用

 

一、安裝 Node.js:https://nodejs.org/en/html

二、安裝 GitBook:node

npm install gitbook-cli -g

gitbook -V  #查看gitbook是否成功安裝。

 nodejs 鏡像配置git

npm config set registry http://registry.npm.taobao.org

三、gitbook使用
gitbook init  //初始化目錄文件
初始化效果:

 

編輯 SUMMARY.md 文件,內容修改成:web

# 目錄

* [前言](README.md)
* [第一章](Chapter1/README.md)
  * [第1節:first](Chapter1/first.md)
  * [第2節:second](Chapter1/senond.md)
  * [第3節:third](Chapter1/third.md)
  * [第4節:fourth](Chapter1/fourth.md)
* [第二章](Chapter2/README.md)
* [第三章](Chapter3/README.md)
* [第四章](Chapter4/README.md)

再次執行 gitbook init 命令,GitBook 會查找 SUMMARY.md 文件中描述的目錄和文件,若是沒有則會將其建立。npm

gitbook serve  //來預覽這本書籍

  

 

問題:gitbook serve 常常報錯找不到文件vim

解決方法:ruby

cd ~/.gitbook/versions/版本/lib/output/website/
vim copyPluginAssets.js
刪除112行

 

參考連接:https://blankj.com/gitbook/gitbook/https://jingyan.baidu.com/article/e8cdb32b33e8f637052bada8.html
相關文章
相關標籤/搜索