docker 安装 gitbook

docker-compose

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
version: "3"
services:
  gitbook:
    hostname: gitbook
    container_name: gitbook
    image: fellah/gitbook
    pull_policy: always
    restart: always
    privileged: true
    tty: true
    volumes:
      - /data/gitbook:/srv/gitbook
      - /etc/localtime:/etc/localtime
    ports:
      - 4000:4000
    command:
      - /bin/bash
      - -c
      - |
        /bin/bash

gitbook

SUMMARY.md

1
2
3
4
5
# Summary

* [Introduction](README.md)

* [bash](bash.md)

book.jon

对于整个网站的风格,可以通过 book.json 的配置进行渲染:

1
2
3
4
5
6
{
    "plugins": [
        "-sharing",
        "theme-comscore"
    ]
}

开始部署

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
npm i gitbook-plugin-theme-default
npm i gitbook-plugin-theme-comscore
npm i -g gitbook-cli

gitbook init .
gitbook install
gitbook serve . &

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

删除 publish with gitbook

ref: https://blog.tedxiong.com/how_to_remove_Published_with_GitBook_in_GitBook.html

  • 首先,在book的根目录里创建styles文件夹,然后在其中创建website.css文件,添加以下内容:

    1
    2
    3
    
    .gitbook-link {
        display: none !important;
    }
  • 编辑book.json文件

    1
    2
    3
    4
    5
    
    {
      "styles": {
          "website": "styles/website.css"
      }
    }

相关内容

william 支付宝支付宝
william 微信微信
0%