retter 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -8,7 +8,6 @@ tmp/*
8
8
  lib/generator/skel/.gitignore
9
9
  lib/generator/skel/.preview.html
10
10
  lib/generator/skel/retters/*.md
11
- lib/generator/skel/tmp/*
12
11
  lib/generator/skel/entries.*
13
12
  lib/generator/skel/entries/*.html
14
13
  lib/generator/skel/vendor
data/.rspec CHANGED
@@ -1 +1,2 @@
1
1
  --format Fuubar
2
+ --color
@@ -1,3 +1,2 @@
1
1
  rvm:
2
- - '1.9.2-p290'
3
- - '1.9.3-p0'
2
+ - '1.9.3-p125'
@@ -0,0 +1,21 @@
1
+ # 0.2.0
2
+
3
+ ## Features
4
+
5
+ Pygments Support.
6
+
7
+ Pygments syntax highlight is now available.
8
+ To use, add a following line to Retterfile.
9
+
10
+ ```ruby
11
+ renderer Retter::Renderers::PygmentsRenderer
12
+ ```
13
+
14
+ ## Improves
15
+
16
+ * Improved boot overhead of all command.
17
+ * Improved wait time for rebind (bind) command by cache.
18
+
19
+ # 0.0.1
20
+
21
+ It's first release.
data/README.md CHANGED
@@ -1,242 +1,184 @@
1
- # 注意
1
+ # RETTER - Flyweight diary workflow. [![Build Status](https://secure.travis-ci.org/hibariya/retter.png?branch=master)](http://travis-ci.org/hibariya/retter)
2
2
 
3
- 0.1.0 以降、`layouts/`ファイル以下に追加と変更があります。
4
- 以下のコマンドで`layouts/`以下のファイルを上書きしてください。
5
-
6
- ~~~~
7
- retter gen $RETTER_HOME
8
- ~~~~
9
-
10
- # RETTER (レッター) Flyweight diary workflow.
11
-
12
- 手軽さを追求した記事作成ツール。以下のような特徴があります。
3
+ 手軽さを追求した記事作成ツール。
13
4
 
14
5
  * CLIでの操作を前提としています
15
- * どこ(cwd)にいてもすぐに記事を編集できます(Markdown
6
+ * どこ(cwd)にいてもすぐに記事をMarkdownで編集できます
16
7
  * オフラインで簡単にプレビューできます
17
- * だいたいどんなサーバ上でも動作します(Heroku, GitHub Pages, Dropbox などで、静的HTMLまたはRackアプリとして)
8
+ * だいたいどこでも動作します(Heroku, GitHub Pages, Dropbox などで、静的HTMLまたはRackアプリとして)
18
9
  * RSSフィードを吐きます
19
- * トラックバック、**コメント**などの機能は外部のサービスを使用できます
10
+ * トラックバック、**コメント**などの機能は外部のサービスを使う必要があります
20
11
  * コールバックを設定することでさらに手数を減らすことができます
21
12
 
22
- # インストール - Installation
13
+ # Quick Start
23
14
 
24
15
  *ruby-1.9.2* or later is required.
25
16
 
17
+ **Install:**
18
+
26
19
  ~~~~
27
20
  gem install retter
28
21
  ~~~~
29
22
 
30
- # 使い方 - Usage
31
-
32
- ## 新規サイト生成 - New site
33
-
34
- `retter new`で新しいサイトのひな形を生成し、依存ライブラリをインストールし、gitリポジトリを初期化します。
23
+ **Generate a new site:**
35
24
 
36
25
  ~~~~
37
26
  $ retter new my_sweet_diary
38
27
  ~~~~
39
28
 
40
- 生成するファイルはHAMLテンプレート、設定ファイル、デフォルトのCSS、Rackアプリ用の設定などです。
41
-
42
- ## 初期設定 - Settings
43
-
44
- ### $EDITOR
45
-
46
- **retter requires `$EDITOR` variable.**
47
-
48
- Retterで記事を編集する際には任意のエディタが起動します。そのためには`$EDITOR`環境変数が設定されている必要があります。
49
- 大抵の場合は設定されていると思いますが、もし設定されていなければ`~/.bash_profile`や`~/.zshenv`などに追記する必要があります。
29
+ **Quick settings:**
50
30
 
51
31
  ~~~~
52
- $ echo "export EDITOR=vim" >> ~/.bash_profile
53
- $ . ~/.bash_profile
32
+ $ export EDITOR=vim
33
+ $ export RETTER_HOME=`pwd`/my_sweet_diary
54
34
  ~~~~
55
35
 
56
- ### $RETTER_HOME
57
-
58
- ファイルシステム上のどこに居ても`retter`コマンドを使って編集から公開まで行えるよう、 事前に`$RETTER_HOME`環境変数を設定します。
59
-
60
- You can use `retter` command anywhere, If you set `$RETTER_HOME` variable.
61
-
62
- ~~~~
63
- $ echo "export RETTER_HOME=/path/to/my_sweet_diary" >> ~/.bash_profile
64
- $ . ~/.bash_profile
65
- ~~~~
66
-
67
- 作業ディレクトリにRetterfileがある場合は、そのディレクトリが`$RETTER_HOME`に指定されているものとして動作します。
68
-
69
- ## 記事を書く - Write an entry
70
-
71
- `retter`コマンドは設定されているエディタを起動します。今のところMarkdown形式で記事を書くことができます。
72
-
73
- `retter` opens `$EDITOR`. Write an article with Markdown.
36
+ **Writing article:**
74
37
 
75
38
  ~~~~
76
39
  $ retter
77
40
  ~~~~
78
41
 
79
- 記事をひと通り書き終えたり確認したくなったら、エディタの機能で記事を保存して終了してください。
80
- 保存された記事は、その段階ではまだ下書きの状態です。
81
-
82
- ## プレビュー - Preview
83
-
84
- 下書きの記事を確認するには`preview`サブコマンドを使います(デフォルトブラウザが起動します)。
42
+ `retter` opens `$EDITOR`. Write an article with Markdown.
85
43
 
86
- `preview` opens the draft article by your default browser.
44
+ **Preview:**
87
45
 
88
46
  ~~~~
89
47
  $ retter preview
90
48
  ~~~~
91
49
 
92
- 気に入らない箇所を見つけたらページを閉じて、また`retter`コマンドで記事を編集します。
93
- 満足のいく文章が出来上がるまで編集とプレビューを繰り返しましょう。
94
-
95
-
96
- ## 記事の生成 - Bind
97
-
98
- 下書きが完成したら、記事をそのサイトのページとして生成します。
99
- `bind`, `rebind` は下書きの記事をその日の記事として保存し、すべてのHTMLを再生成します。
50
+ `preview` opens the draft article by your default browser.
100
51
 
101
- `bind` and `rebind` binds the draft article. And re-generates actual html web pages. All html pages will be overwritten.
52
+ **Generate HTML:**
102
53
 
103
54
  ~~~~
104
- $ retter bind
55
+ $ retter rebind
105
56
  ~~~~
106
57
 
107
- ## サイト全体の確認 - Browse Offline
108
-
109
- 生成されるすべてのページは静的HTMLですから、オフラインでも自分のマシンで全体的な見栄えを確認できます。
110
- `open`サブコマンドはデフォルトブラウザを起動してサイトのトップページを開きます。
58
+ `bind` and `rebind` binds the draft article. And re-generates actual html web pages. All html pages will be overwritten.
111
59
 
112
- `open` sub-command opens your (static) website by your default browser.
60
+ **Browse offline:**
113
61
 
114
62
  ~~~~
115
63
  $ retter open
116
64
  ~~~~
117
65
 
118
- デプロイ先のサーバではRackアプリとして起動しているということであれば、rackupで確認しましょう。
66
+ `open` sub-command opens your (static) website by your default browser.
67
+
68
+ **Show Articles list:**
119
69
 
120
70
  ~~~~
121
- $ retter home # `home` opens a new shell in $RETTER_HOME.
122
- (retter) bundle exec rackup
71
+ $ retter list
72
+ [e0] 2011-11-09
73
+ my sweet article title
123
74
  ~~~~
124
75
 
125
- ## 記事の公開 - Publish
126
-
127
- 記事をインターネット上に公開するには、必要なすべてのファイルを git リポジトリにコミットしリモートサーバに push、または単純にファイルをアップロードします。
76
+ **Re-writing an article:**
128
77
 
129
- To publish, use the git command. Or, upload the file to your server.
78
+ ~~~~
79
+ $ retter edit e0
80
+ ... abbr ...
81
+ $ retter preview e0
82
+ ~~~~
130
83
 
131
- ### Basic flow
84
+ **How to Deploy**
132
85
 
133
- 最も原始的な方法は、gitコマンドを直接使う方法です。
86
+ examle:
134
87
 
135
88
  ~~~~
136
89
  $ cd $RETTER_HOME
137
90
  $ git add .
138
- $ git commit -m 'commit message'
139
- $ git push [remote] [branch] # heroku, github pages, etc..
91
+ $ git commit -m 'Entry written'
92
+ $ git push [your_git_remote] master
140
93
  ~~~~
141
94
 
142
- ### Using shortcut commands
95
+ To publish, use the git command. Or, upload the file to your server.
143
96
 
144
- いくつかのショートカットを使い、コミットメッセージを書くことを省略したりすることができます。
97
+ # Environment variables
145
98
 
146
- ~~~~
147
- $ retter commit # Shortcut of `git add . ; git commit -m 'Retter commit'`
148
- $ retter home # Open a new shell at $RETTER_HOME
149
- (retter) git push [remote] [branch] # heroku, github pages, etc..
150
- ~~~~
151
-
152
- 後述するコールバックを設定しておくことで、さらに手数を減らすことも可能です。
99
+ **Important**
153
100
 
154
- ## 特定の日付の記事を編集する - Edit entry (specific date).
101
+ retter requires `$EDITOR` variable.
155
102
 
156
- 昨日、明日、過去や未来の日付を指定して記事を編集・プレビューするには、 `--date` オプションを用います。
103
+ ## $RETTER_HOME
157
104
 
158
- `--date` option is available in `edit` `preview` sub-command.
105
+ You can use `retter` command anywhere, If you set `$RETTER_HOME` variable.
159
106
 
160
107
  ~~~~
161
- retter --date 20110101 # 編集
162
- retter preview --date 20110101 # プレビュー
108
+ $ echo "export RETTER_HOME=/path/to/my_sweet_diary" >> ~/.bash_profile
109
+ $ . ~/.bash_profile
163
110
  ~~~~
164
111
 
165
- サブコマンドを明示する場合は、日付の指定は引数のように指定することもできます(`--date`が不要になります)。
112
+ You have to cd to the directory, If you don't set `$RETTER_HOME` variable.
166
113
 
167
114
  ~~~~
168
- retter edit 20110101
169
- retter preview 20110101
115
+ $ cd path/to/my_sweet_diary
116
+ $ retter
170
117
  ~~~~
171
118
 
172
- 日付は相対的に指定することができます。以下のような形式をサポートします。
119
+ # Using shortcuts
173
120
 
174
121
  ~~~~
175
- retter edit yesterday # 昨日
176
- retter edit today # 今日
177
- retter edit tommorow # 明日
178
-
179
- retter edit '3 days ago' # 3日前
180
- retter edit 3.days.ago # 3日前
181
- retter edit 3.days.since # 3日後
182
- retter edit 1.week.ago # 1週間前
183
- retter edit 3.weeks.ago # 3週間前
184
- retter edit 3.months.ago # 3カ月前
185
- retter edit 3.years.ago # 3年前
122
+ $ retter commit # Shortcut of `git add . ; git commit -m 'Retter commit'`
123
+ $ retter home # Open a new shell at $RETTER_HOME
124
+ (retter) git push [remote] [branch] # heroku, github pages, etc..
186
125
  ~~~~
187
126
 
188
- ## 特定のファイルを編集する - Edit entry (specific file).
127
+ # Command options
189
128
 
190
- 記事の編集・プレビューにはファイル名での指定も可能です。
129
+ Date is specify-able in `edit` `preview` sub-command.
191
130
 
192
131
  ~~~~
193
- retter edit today.md
194
- retter edit 20110101.md
195
- retter preview 20110101.md
132
+ $ retter edit 20110101 # edit
133
+ $ retter preview 20110101 # preview
196
134
  ~~~~
197
135
 
198
- ## 記事の一覧を出力する - Browse entries
199
-
200
- これまでに書いた記事の一覧を出力することができます。すべての一覧を出力するため、`less`や`lv`、`grep`などで適宜フィルタしてください。
136
+ Relative date is available too.
201
137
 
202
138
  ~~~~
203
- retter list
204
- [e0] 2011-10-12
205
- 記事ごとにPermlinkがつくようにした, retter 0.1.0
139
+ $ retter edit yesterday
140
+ $ retter edit today
141
+ $ retter edit tommorow
206
142
 
207
- [e1] 2011-10-10
208
- Rubyのトップレベルについて整理する
209
-
210
- [e2] 2011-10-03
211
- モジュール関数がprivateな理由
212
-
213
- [e3] 2011-09-19
214
- スタイルシートを追加してテーマを変えられるようにした
143
+ $ retter edit '3 days ago'
144
+ $ retter edit 3.days.ago
145
+ $ retter edit 3.days.since
146
+ $ retter edit 1.week.ago
147
+ $ retter edit 3.weeks.ago
148
+ $ retter edit 3.months.ago
149
+ $ retter edit 3.years.ago
215
150
  ~~~~
216
151
 
217
- 日付の左側に表示されている文字列は、編集やプレビューの際の記事の指定するキーワードとして使うことができます。
152
+ And file name.
218
153
 
219
154
  ~~~~
220
- retter edit e3
221
- retter preview e3
155
+ $ retter edit today.md
156
+ $ retter edit 20110101.md
157
+ $ retter preview 20110101.md
222
158
  ~~~~
223
159
 
224
- ## コールバック - Callbacks
225
-
226
- コールバックはいくつかのサブコマンド(edit bind rebind commit)の実行直後に自動的に実行されます。
227
- コールバックを定義しておくことで、手数の多い割に代わり映えのしない作業を自動化することができます。
160
+ # Callbacks
228
161
 
229
- Callback is enabled in `edit`, `bind`, `rebind` and `commit` sub-command.
162
+ Some command (edit bind rebind commit) will call callback if you defined callbacks.
230
163
 
231
- ### Syntax
164
+ In Retterfile:
232
165
 
233
- ~~~~ruby
166
+ ~~~~
234
167
  after [command], [invoke command or proc]
235
168
  ~~~~
236
169
 
237
- ### HTMLの生成時、デプロイまでの作業を自動化する - Auto deploying
170
+ ## Example1: Auto preview
238
171
 
239
- 以下のような内容を Retterfile に記述しておくことで、rebind または bind が実行されると即座に公開までの処理も実行されます。
172
+ In Retterfile:
173
+
174
+ ~~~~ruby
175
+ after :edit do
176
+ ident = ARGV.pop || 'today'
177
+ preview ident if yes?("Preview now? [yes/no]")
178
+ end
179
+ ~~~~
180
+
181
+ ## Example2: Auto deploying
240
182
 
241
183
  In Retterfile:
242
184
 
@@ -249,33 +191,19 @@ In Retterfile:
249
191
  end
250
192
  ~~~~
251
193
 
252
- もし毎回デプロイするのが煩わしい場合は、`--silent`オプションを付けることでコールバックを回避できます。
253
- その場合は`retter rebind`ではなく`retter rebind --silent`を実行することになります。
194
+ ## Skipping callback
254
195
 
255
- `--silent` option skip the callback.
196
+ `--silent` option skips those callback.
256
197
 
257
- ### エディタを終了したとき即座にプレビューする - Auto preview
198
+ ## Run callback
258
199
 
259
- 記事を編集しエディタを終了したあとブラウザでプレビューしたい場合は、`edit`へのコールバックを設定できます。
260
-
261
- ~~~~ruby
262
- after :edit do
263
- preview ARGV.pop if yes?("Preview now? [yes/no]")
264
- end
265
- ~~~~
266
-
267
- もしもコールバックを毎回実行したくない場合、`--silent`を指定する以外に、上記のように確認プロンプトを表示させるという方法もあります。
268
-
269
- ### コールバック呼出し
270
-
271
- コマンド実行後にコールバックだけを再度実行したい場面では、`callback`サブコマンドを使用できます。
200
+ `callback` sub-command runs only callback proccess.
272
201
 
273
202
  ~~~~
274
203
  $ retter callback --after edit
275
204
  ~~~~
276
205
 
277
- ## コメントシステム(DISQUS)の導入 - Install DISQUS
278
-
206
+ ## Install DISQUS (Comment tool)
279
207
 
280
208
  ### Prepare
281
209
 
@@ -302,10 +230,19 @@ in layouts/article.html.haml
302
230
  -# abbrev
303
231
  ~~~~
304
232
 
305
- ## 組込みテーマ - Pre-installed themes
233
+ # Code Highlight
234
+
235
+ Pygments is available.
236
+ To use, add a following line to Retterfile.
237
+
238
+ ```ruby
239
+ renderer Retter::Renderers::PygmentsRenderer
240
+ ```
306
241
 
307
- スタイルシートを変更することでテーマを変更できます。HTMLのヘッダを変更するには `layouts/retter.html.haml` を編集します。
308
- スタイルシートの指定を変更し、`retter rebind`コマンドを実行するとすべてのページが更新されます。
242
+ ## Built-in themes
243
+
244
+ Retter has some themes.
245
+ You can switch the theme by replacing stylesheet.
309
246
 
310
247
  ### Default
311
248
 
@@ -323,25 +260,19 @@ in layouts/article.html.haml
323
260
 
324
261
  ![Orange](http://hibariya.github.com/images/theme_samples/retter_orange.jpg)
325
262
 
326
- ## HTMLの修正 - HTML Layout
263
+ ## HTML Layout
327
264
 
328
- HTMLのレイアウト自体を変更するには`layouts/`ディレクトリ以下のHAMLファイルを修正します。
329
- これらのファイルを変更したとしても、`retter rebind`コマンドを実行するまでは反映されません。
265
+ To customize layout, edit following files.
330
266
 
331
267
  ~~~~
332
268
  layouts
333
- |-- article.html.haml
334
- |-- entries.html.haml
335
- |-- entry.html.haml
336
- |-- index.html.haml
337
- |-- profile.html.haml
338
- `-- retter.html.haml
339
- ~~~~
340
-
341
- `retter.html.haml`はHTML宣言を含めた全体のHTMLが含まれています。
342
- `entry.html.haml`を変更することで日別のページのレイアウトを変更することができます。
343
- `article.html.haml`を変更することで個々の記事のレイアウトを変更することができます。
344
- その他のファイルは実際のURLと名前が対応しています。
269
+ |-- article.html.haml # Article page
270
+ |-- entries.html.haml # Entries list page
271
+ |-- entry.html.haml # Entry (by day) page
272
+ |-- index.html.haml # Front page
273
+ |-- profile.html.haml # Profile page
274
+ `-- retter.html.haml # Basic layout
275
+ ~~~~
345
276
 
346
277
  # LICENSE
347
278