Skip to content

Commit df6ba9f

Browse files
committed
README.mdを更新した
- ノートの書き方 - メタデータの指定 - スライドの書き方 - ローカルマシンで確認する を書いた。
1 parent 7f4f6c9 commit df6ba9f

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

README.md

+88
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,91 @@
11
# notes
22

33
notes repository
4+
5+
## ノートの書き方
6+
7+
`_posts`ディレクトリ以下に`yyyy-mm-dd-title.md`という形式でファイル名を指定し、GitHub Flavored Markdown記法で文章を書きます。
8+
9+
例えば、`2015-12-24-christmas-eve.md`とした場合、記事は2015年12月24日に作成されたものとして扱われ、URIには`christmas-eve`が使用されます。
10+
11+
GitHub Flavored Markdown記法については以下を参考にしてください。
12+
13+
- [Basic writing and formatting syntax](https://help.github.com/articles/basic-writing-and-formatting-syntax/)
14+
- [Organizing information with tables](https://help.github.com/articles/organizing-information-with-tables/)
15+
- [Creating and highlighting code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks/)
16+
- [Autolinked references and URLs](https://help.github.com/articles/autolinked-references-and-urls/)
17+
18+
ファイルの配置場所は`_posts`ディレクトリ以下であれば直下であってもサブディレクトリ以下でも構いません。
19+
20+
公開せずに下書きとして見たい場合は`_posts`ディレクトリの代わりに`_drafts`ディレクトリ以下に配置します。
21+
22+
## メタデータの指定
23+
24+
ファイルの先頭にメタデータを書くことができます。メタデータは`---`で区切った中に書きます。
25+
26+
```
27+
---
28+
author: John Doe
29+
tags: christmas event
30+
title: Christmas Eve
31+
---
32+
# Christmas Eve
33+
34+
...
35+
```
36+
37+
## スライドの書き方
38+
39+
レイアウトにデフォルトの`note`でなく`slide`を指定することでスライドとして表示することができます。
40+
41+
```
42+
---
43+
author: John Doe
44+
layout: slide
45+
tags: christmas event
46+
title: Christmas Eve
47+
---
48+
```
49+
50+
ライブラリは[remark](http://remarkjs.com/)を使用しています。
51+
52+
また、同時に[mermaid](http://knsv.github.io/mermaid/)も使用しているのでフローチャートやダイアグラムを表示することができます。
53+
54+
```markdown
55+
<div class="mermaid">
56+
graph TD;
57+
A-->B;
58+
A-->C;
59+
B-->D;
60+
C-->D;
61+
</div>
62+
```
63+
64+
とすることで図を表示できます。
65+
66+
## ローカルマシンで確認する
67+
68+
Rubyと[github-pages](https://rubygems.org/gems/github-pages)というgemがインストールされていればローカルマシンで確認できます。
69+
70+
```sh
71+
$ gem install github-pages
72+
$ jekyll serve --drafts --watch
73+
```
74+
75+
とすることでサーバを起動し、ファイルに変更があった場合にはリコンパイルを自動的に行います。
76+
77+
### rbenvとruby-buildがインストールされている場合
78+
79+
[rbenv](https://github.com/rbenv/rbenv)[ruby-build](https://github.com/rbenv/ruby-build)がインストールされている場合は以下の通りにコマンドを実行するとローカルマシンで確認できるようになります。
80+
81+
```sh
82+
$ rbenv install `cat .ruby-version`
83+
$ gem install bundler rake
84+
$ rake install
85+
$ rake preview
86+
```
87+
88+
1. `.ruby-version`に書かれたバージョンのRubyをインストールする
89+
2. `Bundler``Rake`をインストールする
90+
3. `github-pages``Bundler`でインストールする
91+
4. サーバを起動する

0 commit comments

Comments
 (0)