1.7 gitbook 插件等相关设置
摘要
本文记录了1.7 gitbook 插件等相关设置,解决gitbook不支持latex公式等问题。
文章同步于: 我的gitbook
gitbook 插件等相关配置
插件安装配置方法
在你gitbook更目录中编辑book.json文件,文件配置好后,不会生效,需要先执行命令
gitbook install # 安装命令
然后执行如下命令进行编译
gitbook build
Mermaid
图和流程图(甘特图之类的)
Mermaid 的 plugins地址, Mermaid 的github地址

安装方法,在book.json加入以下内容,然后gitbook install
{ "plugins": ["mermaid"] }
graph TD; A-->B; A-->C; B-->D; C-->D;
classDiagram Class01 <|-- AveryLongClass : Cool Class03 -- Class04 Class05 o-- Class06 Class07 .. Class08 Class09 --> C2 : Where am i? Class09 -- C3 Class09 --|> Class07 Class07 : equals() Class07 : Object[] elementData Class01 : size() Class01 : int chimp Class01 : int gorilla Class08 <--> C2: Cool label
具体使用帮助文档请移步github
KaTex
为了支持数学公式, 我们可以使用KaTex和MathJax插件, 官网上说Katex速度要快于MathJax
"plugins": [
"katex"
]
用法:
Inline math: $$\int_{-\infty}^\infty g(x) dx$$
Block math:
$$
\int_{-\infty}^\infty g(x) dx
$$
Or using the templating syntax:
{% math %}\int_{-\infty}^\infty g(x) dx{% endblock %}
安装视屏播放插件
Install Add the below to your book.json file, then run gitbook install :
{
"plugins": ["chinese-video"]
}
Usage Currently, This plugin support:
Bilibili Youku Iqiyi QQ Sohu Mgtv PPTV There are each methods which you should use to insert matched website's video.
Tips:
[xxx] is optional parameter. You can ignore it but don't ignore any @. The width x height, which is defined by you, is the largest size of the player and if you have a small screen to look through the page, Page will zoom the player with the scale of your width x height. Bilibili html5 https
{% bilibili %} avCode @ [section] @ [width x height] {% endbilibili %}
avCode is bilibili video's serial number. Just like this: https://www.bilibili.com/video/av 170001
avCode should be a number. Don't attach "av" to it.
section is matched video's sub video's serial number.
width x height is player's size.
Youku html5 flash https
{% youku %} videoCode @ [mode] @ [width x height] {% endyouku %}
mode is player's mode. js(html5) or flash.
videoCode just like this: https://v.youku.com/v_show/id_ XNDU4MjQ3MzA0 .html
width x height is player's size.
Iqiyi html5 flash https(HTML5 player) http(Flash player)
Iqiyi's parameter just like shit!!!
Flash player
{% iqiyi %} flash @ parameter1 @ video @ albumId @ tvId @ [width x height] {% endiqiyi %}
flash is key word. Don't change it.
You only can visit Iqiyi's video's Sharing page and copy its HTML to get these parameters. It just like this:
{% bilibili %} 170001 @ [section] @ [640 x 480] {% endbilibili %}
Last updated
Was this helpful?