1. 程式人生 > >windows 安裝gitbook並使用gitbook editor視覺化工具

windows 安裝gitbook並使用gitbook editor視覺化工具

 GitBook 是一個基於 Node.js 的命令列工具,可使用 Github/Git 和 Markdown 來製作精美的電子書。

1、官網下載nodejs直接安裝 : 傳送門

安裝完成後如下:

可以看到npm也安裝了,此時可以在cmd控制檯進行驗證(win+r),輸入cmd進入控制檯:

C:\pc>node -v
v8.11.1

C:\pc>npm -v
5.6.0

 

二、安裝gitbook

在cmd控制檯輸入如下命令進行安裝:

C:\pc>npm install gitbook-cli -g
npm WARN notice [SECURITY] lodash has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=lodash&version=4.17.4 - Run `npm i

[email protected] -g` to upgrade your npm version, and then `npm audit` to get more info.
C:\pc\AppData\Roaming\npm\gitbook -> C:\pc\AppData\Roaming\npm\node_modules\gitbook-cli\bin\gitbook.js
+ [email protected]
added 578 packages in 134.873s

 

三、安裝gitbook editor windows版

官網地址:gitbook editor windows版

備用網盤下載:https://pan.baidu.com/s/10UH7dlY5EEni8mIq2YNuSw  提取碼:odor 

直接執行gitbook.exe檔案,我裝的時候報錯,我直接給忽略,最終還是能用的,如圖:

此時可點選Do This Later進入

 

 點選進入編輯即可:

之後儲存即可

 

四、測試

cmd控制檯進入所建的電子書目錄下:

輸入:gitbook init 進行初始化

e:\Gitbook\2019\Import\test>gitbook init
Installing GitBook 
3.2.3 [email protected]3.2.3 C:\Users\FUJIAN~2\AppData\Local\Temp\tmp-186002ka7aHl7tyHD\node_modules\gitbook ├── escape[email protected]1.0.3 ├── [email protected]1.0.4 ├── escape-string[email protected]1.0.5 ├── [email protected]3.1.2 ├── bash[email protected]0.0.4 ├── gitbook[email protected]0.0.1 ├── cp@0.2.0 ├── github[email protected]1.0.1 ├── graceful[email protected]4.1.4 ├── nunjucks-do@1.0.0 ├── [email protected]1.4.1 ├── spawn[email protected]0.0.2 ├── gitbook[email protected]2.0.0 ├── [email protected]0.0.5 ├── [email protected]3.3.0 ├── [email protected]0.1.5 ├── object[email protected]0.9.2 ├── [email protected]3.0.2 ├── gitbook[email protected]2.2.1 ├── json[email protected]0.1.1 ├── [email protected]1.1.0 ├── [email protected]3.4.0 ├── [email protected]1.18.0 ├── [email protected]5.1.0 ├── front[email protected]2.3.0 ├── [email protected]3.8.2 ├── dom[email protected]0.1.0 ([email protected]1.1.3, [email protected]1.1.2) ├── [email protected]7.0.2 (string[email protected]0.2.1, [email protected]4.0.1) ├── [email protected]0.0.28 ([email protected]1.0.2) ├── [email protected]2.0.1 ([email protected]4.3.6) ├── omit[email protected]0.1.0 ([email protected]0.0.1, [email protected]0.2.0) ├── [email protected]0.13.2 ([email protected]0.3.0, [email protected]1.7.0, [email protected]1.2.1, [email protected]1.0.3, [email protected]0.7.1, [email protected]1.1.2, [email protected]2.2.0, [email protected]1.3.4, [email protected]1.3.1, [email protected]2.3.0) ├── [email protected]0.5.1 ([email protected]0.0.8) ├── [email protected]1.1.7 ├── rmdir@1.2.0 ([email protected]1.2.3) ├── fresh[email protected]1.0.3 ([email protected]0.0.1, [email protected]0.0.1, [email protected]0.1.1, [email protected]1.3.0, [email protected]0.6.5, [email protected]0.9.0, [email protected]1.11.0) ├── js[email protected]3.12.1 ([email protected]4.0.1, [email protected]1.0.10) ├── gitbook[email protected]1.0.7 ├── [email protected]1.1.1 ([email protected]2.4.5) ├── tiny[email protected]0.2.1 ([email protected]1.3.2, [email protected]2.4.0, [email protected]5.1.0, [email protected]2.2.0, [email protected]1.14.2, [email protected]0.10.0) ├── read[email protected]4.0.3 ([email protected]1.0.1, [email protected]1.0.3, [email protected]1.1.6, [email protected]1.0.2, [email protected]2.0.13) ├── gitbook[email protected]1.2.0 ([email protected]1.2.0, [email protected]0.5.12) ├── [email protected]1.5.0 ([email protected]1.0.1, [email protected]1.0.1, [email protected]2.0.3, [email protected]2.0.0, [email protected]2.0.1, [email protected]1.0.1, [email protected]1.3.2, [email protected]2.2.1) ├── [email protected]2.5.2 ([email protected]2.0.6, [email protected]3.32.0, [email protected]1.7.0) ├── gitbook[email protected]2.0.2 ([email protected]9.2.0) ├── [email protected]2.13.0 ├── gitbook[email protected]1.0.2 ([email protected]3.10.1) ├── gitbook[email protected]1.3.2 ([email protected]0.2.1, [email protected]1.3.3, [email protected]0.5.6, [email protected]4.17.11) ├── i18n[email protected]1.0.1 ([email protected]4.17.11) ├── [email protected]0.20.0 ([email protected]1.1.2, css-select@1.2.0, [email protected]3.8.3, [email protected]7.2.2, [email protected]4.17.11) ├── [email protected]2.0.0 ([email protected]1.12.2, [email protected]0.4.2, [email protected]0.5.3, [email protected]0.3.1, [email protected]2.9.0, [email protected]2.2.5, [email protected]2.0.0) ├── gitbook[email protected]1.2.2 ([email protected]1.3.3, [email protected]1.5.5-1, [email protected]4.17.11) ├── [email protected]2.72.0 ([email protected]0.4.3, [email protected]0.6.0, [email protected]0.6.1, [email protected]0.8.2, [email protected]1.0.0, [email protected]0.11.0, [email protected]0.0.6, [email protected]1.8.0, [email protected]0.1.2, [email protected]5.0.1, [email protected]2.2.2, [email protected]6.1.2, [email protected]1.4.8, [email protected]1.0.7, [email protected]2.1.21, [email protected]1.1.2, [email protected]3.1.3, [email protected]1.1.1, [email protected]2.0.6, [email protected]1.0.1) └── [email protected]3.9.2 info: create SUMMARY.md info: initialization is finished

 

輸入:gitbook serve 啟動檢視服務

e:\Gitbook\2019\Import\test>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 3 pages
info: found 1 asset files
info: >> generation finished with success in 1.2s !

Starting server ...
Serving book on http://localhost:4000

瀏覽器訪問:http://localhost:4000

 之後就可以盡情的編輯了