LoginSignup
3
2

More than 5 years have passed since last update.

Gitbookを使ってみる

Last updated at Posted at 2017-08-31

もうこりごり

Wordでのドキュメント作成にもうこりごりなわけですよ。。。

環境

  • CentOS7
  • NPM 4.2.0
  • Node.js v7.10.1

手順

Node.jsのインストール

必要なパッケージのインストール
 yum install -y gcc-c++ make
Node.js7.xのリポジトリを追加
curl -sL https://rpm.nodesource.com/setup_7.x | sudo bash -
Node.jsのインストール
yum install -y nodejs

GitBookのインストール

Gitbookのインストール
npm install gitbook-cli -g

Gitbookプロジェクトの作成

Gitbook用のディレクトリを作成
mkdir gitbook-test
Gitbookの作成
gitbook init
tree
.
├── README.md
└── SUMMARY.md

0 directories, 2 files
Gitbookプロジェクトの起動
gitbook serve
Live reload server started on port: 35729
Press CTRL+C to quit ...

info: 7 plugins are installed
info: loading plugin "livereload"... OK
info: loading plugin "highlight"... OK
info: loading plugin "search"... OK
info: loading plugin "lunr"... OK
info: loading plugin "sharing"... OK
info: loading plugin "fontsettings"... OK
info: loading plugin "theme-default"... OK
info: found 1 pages
info: found 0 asset files
info: >> generation finished with success in 0.8s !

Starting server ...
Serving book on http://localhost:4000
起動後のファイル構成
tree
.
├── README.md
├── SUMMARY.md
└── _book
    ├── gitbook
    │   ├── fonts
    │   │   └── fontawesome
    │   │       ├── FontAwesome.otf
    │   │       ├── fontawesome-webfont.eot
    │   │       ├── fontawesome-webfont.svg
    │   │       ├── fontawesome-webfont.ttf
    │   │       ├── fontawesome-webfont.woff
    │   │       └── fontawesome-webfont.woff2
    │   ├── gitbook-plugin-fontsettings
    │   │   ├── fontsettings.js
    │   │   └── website.css
    │   ├── gitbook-plugin-highlight
    │   │   ├── ebook.css
    │   │   └── website.css
    │   ├── gitbook-plugin-livereload
    │   │   └── plugin.js
    │   ├── gitbook-plugin-lunr
    │   │   ├── lunr.min.js
    │   │   └── search-lunr.js
    │   ├── gitbook-plugin-search
    │   │   ├── lunr.min.js
    │   │   ├── search-engine.js
    │   │   ├── search.css
    │   │   └── search.js
    │   ├── gitbook-plugin-sharing
    │   │   └── buttons.js
    │   ├── gitbook.js
    │   ├── images
    │   │   ├── apple-touch-icon-precomposed-152.png
    │   │   └── favicon.ico
    │   ├── style.css
    │   └── theme.js
    ├── index.html
    └── search_index.json

11 directories, 27 files

ブラウザからのアクセス

Introduction · GitBook.png

感想

これは簡単にできてよさそう!
テンプレートやフォントも自由に変更できて、画像差し込みなども簡単にできるのでこれでドキュメント作成してGitでバージョン管理すると捗りそうだなとおもいましたはい。

参考

3
2
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
3
2