programlearned
  • Introduction
  • js 筆記
    • Hammer.js 應用
  • node 筆記
    • 安裝與開始
    • exports 的應用
    • http 模組知識
    • Express 開始
      • 載入靜態檔案(image,css,js)
      • ejs 的使用
      • ejs layout的使用
      • ejs include的使用
      • ejs-form 的使用
      • ejs-ajax 的使用
      • route 的整理使用
    • 參考資料
  • vue 筆記
    • 安裝與開始
    • 基礎知識
      • 創建vue與輸出
      • v-bind 綁訂應用
      • v-for 與 v-if
      • v-on
      • v-class
      • 計算功能函數
      • 表單資料綁定
      • TodoList製作
    • 參考資料
  • Bootstrap 筆記
    • 相關資源網站
    • 安裝與開始
    • CSS 基礎知識
    • 容器container 應用
    • 網格系統 應用
      • 斷點
      • 版本斷點比較
      • 欄位排序
      • 欄位推移
      • 巢狀欄位
      • Flexbox 方向性
    • 間隔工具
    • 按鈕(button)
    • 不同的呈現(display)方式
    • 容器對齊方式
    • 文字(背景顏色)對齊與樣式
    • 導覽列應用
    • 參考資源
  • gitbook 製作與離線版
Powered by GitBook
On this page
  • 基本安裝與製作
  • github 步驟
  • gitbook 步驟
  • gitbook pdf & 離線網頁版

Was this helpful?

gitbook 製作與離線版

基本安裝與製作

  • 使用 node 安裝 gitbook

    • npm install gitbook -g

    • npm install gitbook-cli -g

  • 創建依專案資料夾,並進入

  • 初始化 gitbook 文件 : gitbook init

  • 將會看到 README.md , SUMMARY.md

  • gitbook會依照 SUMMARY.md的 縮排 與 排列 順序來編輯電子書

  • README.md 範例 :

    ## 我的首頁
    #### 看起來還不錯
  • SUMMARY.md 範例 :

# Summary

* [我的首頁](README.md)
    * [我的首頁分頁](my.md)
* [更多內容](content.md)
  • .gitbook.yaml 為 gitbook設定檔

  • .gitbook.yaml 範例 :

# Root directory to locate the content
# Default is the root directory of the repository.
root: ./你的專案資料夾名稱/

# Files to use as SUMMARY/README.
# (Relative to <root> directory)
structure:
  readme:  README.md
  summary: SUMMARY.md

# Redirect urls to specific files (relative to the <root> directory)
#redirects:
  #previous/page: new-folder/page.md
  • 編輯完書籍 : 可用指令 gitbook serve 可隨時觀看是否有誤

github 步驟

  • 請先在 github 創立一個專案(若不太會git建議起初創立README.md,之後就可以透過 upload files 直接上傳)

  • 先將 .gitbook.yaml 設定檔上傳以後,再將專案資料夾上傳即可

  • 原本github創建的 README.md 可以用來介紹此專案的目的

gitbook 步驟

  • 當創建完帳號,一定會創立一個組織

  • 名字都可以隨意(因為都可以更改頭像與名字)

  • 在組織裡創建一個 space(電子書)

  • space 的名字也可自取~最重要的是 與 github 連結(方便上版到gitbook)

  • 點選左下方的 藍色方塊按鈕 找到 integrations 可以看到 github

  • 點選以後,與當初在github的專案連結起來即可

gitbook pdf & 離線網頁版

  • 前面的目錄檔案都需準備好

  • 安裝 calibre

  • 設定book.json檔(注意要放在同一目錄資料夾)

  • book.json 範例 : 裡面包含pdf設定 與 plugin 插件

{   
    "title": "Bootstrap 4 指南",
    "description": "<Bootstrap 4 指南>中文版",
    "language": "zh",
    "pluginsConfig": {
        "fontSettings": {
          "theme": "white",
          "family": "msyh",
          "size": 2
        } 
    },
    "plugins": [
      "multipart",
      "yahei",
      "katex",
      "search",
      "splitter",
      "collapsible-chapters"
   ],
  "pdf": {
    "pageNumbers": true, 
    "fontFamily": "Arial",
    "fontSize": 12,
    "paperSize": "a4",
    "margin": {
      "right": 0,
      "left": 0,
      "top": 0,
      "bottom": 0
    }
  }
}
  • gitbook install : 安裝所有 plugin 插件

  • gitbook build : 做出離線網頁板 book

  • gitbook serve : 開啟網頁 gitbook

  • gitbook pdf : 做出 電子書 pdf

Previous參考資源

Last updated 6 years ago

Was this helpful?