LoginSignup
12
10

More than 3 years have passed since last update.

HonKitのdockerイメージを作りました (日本語検索、日本語PDF出力に対応)

Last updated at Posted at 2020-07-28

dockerイメージの使い方

docker-compose.yml
web:
  image: tukiyo3/honkit
  restart: always
  volumes:
    - ./honkit:/srv/honkit
  ports:
    - "4000:4000"
起動
docker-compose up
chmod -R 777 ./honkit/
# プラグインの設定
cp book.json ./honkit/

vim ./honkit/README.md

Gitbookのプラグイン追加方法

  • 日本語検索対応のsearch-pro-fixedを利用するには
npm i gitbook-plugin-search-pro-fixed

gitbook installではないので注意!

./honkit/book.json
{
    "plugins": [ "-lunr", "-search", "search-pro-fixed" ]
}

search-pro-kuiではうまく検索できなかった。

GitHub Pages に UPするときのハマりポイント

  • _book のような、アンダースコアから始まるフォルダは404を返される。
    • .nojekyllという空ファイルを置けば解決。

HonKitについて


(参考までに) 公式のdockerイメージの使い方

honkit init

docker-compose.yml
honkit:
  image: honkit/honkit
  restart: always
  volumes:
    - ./honkit:/srv/honkit
  ports:
    - 4000:4000
  working_dir: /srv/honkit
# init
docker-compose run honkit  honkit init

honkit serve

# serve
docker-compose run honkit  honkit serve

もしくは以下

docker-compose.yml
honkit:
  image: honkit/honkit
  restart: always
  volumes:
    - ./honkit:/srv/honkit
  ports:
    - 4000:4000
  working_dir: /srv/honkit
  command: honkit serve
docker-compose up
12
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
10