1. Install node. js: nodejs.org/en/

Install GitBook:

NPM install gitbook-cli -g gitbook -v # Check whether gitbook is successfully installed.Copy the code

Nodejs image configuration

npm config set registry http://registry.npm.taobao.org
Copy the code
3. Use gitbookCopy the code
Gitbook init // Initializes directory filesCopy the code
Initialization effect:Copy the code

 

Edit the summary. md file and change the content to:

(Chapter1/ readme.md) * (Chapter1/ readme.md) * (Chapter1/ readme.md) Second](Chapter1/senond.md) * [第3: third](Chapter1/third. Md) * [第4: Chapter1/ readme.md * [Chapter2/ readme.md] * [Chapter3/ readme.md] * [Chapter4/ readme.md)Copy the code

Run the gitbook init command again, and gitbook looks for the directories and files described in the summary.md file, or creates them if none are present.

Gitbook serve // To preview the bookCopy the code

  

 

Problem: Gitbook Serve often reports errors in finding files

Solutions:

CD ~/.gitbook/versions/ versions/ lib/output/website/ vim copypluginassets.js Delete line 112Copy the code

 

Refer to the link: https://blankj.com/gitbook/gitbook/ https://jingyan.baidu.com/article/e8cdb32b33e8f637052bada8.htmlCopy the code