4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

mdBookを使ってみた(導入編)

Posted at

mdBook使ってみた

mdBookを使うと、マークダウン形式でブックをつくることができる
ブックとは、まさにリンク先のページのようなもの
左に目次があってその他のスペースが記事になる

この記事では、雛形を作成し目次をカスタマイズするところまで行う

前提

Rustがインストールされていること

> cargo --version
# cargo 1.51.0 (43b129a20 2021-03-16)

> rustc --version
# rustc 1.51.0 (2fd73fabe 2021-03-23)

環境構築

デフォルトのページを表示するまで行う

mdbookコマンドラインツールをゲットする

# 10分くらいかかった
cargo install mdbook

作業ディレクトリを初期化する

mkdir book-test
cd .\book-test\
mdbook init

# Do you want a .gitignore to be created? (y/n)
y
# What title would you like to give the book? 
my_first_book:wa

# All done, no errors...

ビルドしてページを見てみる

mdbook build -o

build.png

カスタマイズ

SUMMARY.mdファイルを追加編集してブックをカスタマイズする
編集内容をブラウザへ反映するためにmdbook watch -oをつかう

# Summary

1. [Chapter 1](./chapter_1.md)

1. [Chapter 2](./chapter_2.md)
    1. [Chapter 2 Sub](./chapter_2_sub.md)

# Another Section

1. [Chapter 3](./chapter_3.md)

custom.png

ここまでのディレクトリ階層

作業ディレクトリ
│  .gitignore
│  book.toml
│  
├─book
|       # ここにはたくさんのファイル
│          
└─src
        chapter_1.md
        chapter_2.md
        chapter_2_sub.md
        chapter_3.md
        SUMMARY.md

以上

4
0
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
4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?