LoginSignup
1
2

More than 5 years have passed since last update.

GitBook でドキュメントを書く準備を整える

Last updated at Posted at 2019-01-27

ちょっと書いてみたくなったのでメモ

環境

ミドルウェア バージョン
Node.js 10.15.0
GitBook cli 3.2.3

手順

  1. Node.js をあらかじめインストールしておく
  2. GitBook CLI をグローバルにインストールする

    $ npm install gitbook-cli -g
    
  3. GitBook コマンドで初期化する

    $ gitbook init
    

    新規でディレクトリを作成したい場合は次のように入力する

    $ gitbook init ./<作成したいディレクトリ名>
    
  4. 現在のディレクトリ(もしくは新規作成したディレクトリ)に新しいファイルが作成されていることを確認する

    $ ls
    README.md   SUMMARY.md
    
  5. サーバを立ち上げる

    $ 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.4s ! 
    
    Starting server ...
    Serving book on http://localhost:4000
    

確認

ブラウザから次のURLにアクセスして、画面が表示されればOK

http://localhost:4000

注意事項

  • GitBook CLI は今後アクティブな開発は行われない(アナウンスがあった)

参考

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