GitBook 它基於Git建立,並且直接考量技術文件編寫上的各種需求,像是所視即所得的Markdown編輯器、也可以自動地將Markdown轉換為PDFePubmobi等電子書格式,甚至包辦了出版及販售電子書的相關平臺功能,越來越多開發者選擇在GitBook撰寫技術文件,甚至其他領域的使用者也聞風而來,就連現任臺北市長之前在競選時,也運用GitBook來發表市政白皮書。


安裝

shell> npm install -g gitbook-cli
shell> gitbook help

shell> mkdir mybook
shell> cd mybook
shell> gitbook init
shell> gitbook serve

Configuration

book.json

title

description

author

language

plugins

:books: 參考網站:

GitBook Editor

:books: 參考網站:

Plugins

book.json

{
  "plugins": ["myPlugin", "anotherPlugin"]
}
{
  "plugins": ["advanced-emoji"]
}
{
  "plugins": ["youtube", "jsfiddle"]
  "pluginsConfig": {
    "jsfiddle": {
      "type": "script",
      "tabs": ["result", "js", "css", "html", "resources"],
      "height": "500",
      "width": "500",
      "fontColor": "00FF00"
    }
  }
}

youtube

{% youtube %}https://www.youtube.com/watch?v=9bZkp7q19f0{% endyoutube %}

shell> gitbook install

jsfiddle

[source code](https://jsfiddle.net/4o4z6fqn/9/)

search-pro

{
  "plugins": [
    "-lunr", "-search", "search-pro"
  ]
}

emphasize

{
  "plugins": ["emphasize"]
}

This text is highlighted !

This text is highlighted with markdown!

This text is highlighted in green!

This text is highlighted in red!

This text is highlighted with a custom color!

This text is {% em %}highlighted !{% endem %}

This text is {% em %}highlighted with **markdown**!{% endem %}

This text is {% em type="green" %}highlighted in green!{% endem %}

This text is {% em type="red" %}highlighted in red!{% endem %}

This text is {% em color="#ff0000" %}highlighted with a custom color!{% endem %}

splitter

{
  "plugins": ["splitter"]
}

tbfed-pagefooter

{
  "plugins": ["tbfed-pagefooter"],
  "pluginsConfig": {
    "tbfed-pagefooter": {
      "type": "script",
      "copyright": "&copy Taobao FED Team",
      "modify_label": "該檔案修訂時間:",
      "modify_format": "YYYY-MM-DD HH:mm:ss"
    }
  }
}

toggle-chapters

{
  "plugins": ["toggle-chapters"]
}

plugin-fontsettings

{
  "plugins": ["-fontsettings"]
}
{
  "pluginsConfig": {
    "fontsettings": {
      "theme": 'white', // 'sepia', 'night' or 'white',
      "family": 'sans', // 'serif' or 'sans',
      "size": 1 // 1 - 4
    }
  }
}

cover.jpg

cover_small.jpg

:books: 參考網站:


powered by Gitbook最後更新: 2017-08-25 10:06:20

results matching ""

    No results matching ""