rabbit 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/data/locale/en/LC_MESSAGES/rabbit.mo +0 -0
  3. data/data/locale/ja/LC_MESSAGES/rabbit.mo +0 -0
  4. data/doc/_config.yml +2 -2
  5. data/doc/en/faq.rd +4 -2
  6. data/doc/en/news.rd +91 -0
  7. data/doc/en/sample/hiki/rabbit.hiki +0 -4
  8. data/doc/en/sample/rd/rabbit.rd +0 -4
  9. data/doc/en/usage/rabbit-slide.rd +3 -3
  10. data/doc/index.html.en +1 -1
  11. data/doc/ja/faq.rd +2 -0
  12. data/doc/ja/news.rd +90 -0
  13. data/doc/ja/sample/hiki/rabbit.hiki +0 -4
  14. data/doc/ja/sample/rd/rabbit.rd +0 -4
  15. data/doc/ja/usage/rabbit-slide.rd +3 -3
  16. data/doc/ja/users.rd +7 -0
  17. data/lib/rabbit/action/toggle.rb +7 -0
  18. data/lib/rabbit/author-configuration.rb +3 -4
  19. data/lib/rabbit/canvas.rb +11 -1
  20. data/lib/rabbit/command/rabbit-slide.rb +59 -1
  21. data/lib/rabbit/command/rabbit-slide.ui +127 -49
  22. data/lib/rabbit/command/rabbit.rb +5 -9
  23. data/lib/rabbit/element/image.rb +78 -94
  24. data/lib/rabbit/element/video.rb +3 -11
  25. data/lib/rabbit/error.rb +2 -2
  26. data/lib/rabbit/frame.rb +102 -4
  27. data/lib/rabbit/gem-pusher.rb +28 -6
  28. data/lib/rabbit/image/base.rb +97 -26
  29. data/lib/rabbit/image/dia.rb +21 -6
  30. data/lib/rabbit/image/pdf.rb +1 -4
  31. data/lib/rabbit/image/svg.rb +1 -4
  32. data/lib/rabbit/image.rb +3 -4
  33. data/lib/rabbit/info-window.rb +106 -80
  34. data/lib/rabbit/keys.rb +6 -0
  35. data/lib/rabbit/menu.rb +2 -0
  36. data/lib/rabbit/parser/ext/charty.rb +58 -0
  37. data/lib/rabbit/parser/ext/image.rb +2 -1
  38. data/lib/rabbit/parser/rd/ext/block-verbatim.rb +13 -5
  39. data/lib/rabbit/progress.rb +1 -1
  40. data/lib/rabbit/properties.rb +141 -0
  41. data/lib/rabbit/rabbit.rb +3 -1
  42. data/lib/rabbit/relative-size.rb +28 -0
  43. data/lib/rabbit/renderer/base.rb +6 -0
  44. data/lib/rabbit/renderer/display/drawing-area-base.rb +0 -1
  45. data/lib/rabbit/renderer/display/drawing-area-primitive.rb +1 -0
  46. data/lib/rabbit/renderer/display/info.rb +6 -1
  47. data/lib/rabbit/renderer/display/key-handler.rb +27 -2
  48. data/lib/rabbit/renderer/engine/cairo.rb +24 -3
  49. data/lib/rabbit/renderer/screen.rb +0 -1
  50. data/lib/rabbit/slide-configuration.rb +12 -8
  51. data/lib/rabbit/task/slide.rb +3 -3
  52. data/lib/rabbit/theme/clear-blue/clear-blue.rb +3 -1
  53. data/lib/rabbit/theme/edge-info-toolkit/edge-info-toolkit.rb +12 -2
  54. data/lib/rabbit/theme/image-slide-number/image-slide-number.rb +1 -1
  55. data/lib/rabbit/theme/slide-footer-info/slide-footer-info.rb +2 -0
  56. data/lib/rabbit/theme/tag/tag.rb +9 -2
  57. data/lib/rabbit/theme-configuration.rb +3 -4
  58. data/lib/rabbit/version.rb +1 -1
  59. data/lib/rabbit/video-window.rb +14 -3
  60. data/lib/rabbit/yaml-loader.rb +39 -0
  61. data/po/en/rabbit.edit.po +82 -64
  62. data/po/en/rabbit.po +16 -2
  63. data/po/fr/rabbit.edit.po +81 -63
  64. data/po/fr/rabbit.po +15 -1
  65. data/po/ja/rabbit.edit.po +108 -65
  66. data/po/ja/rabbit.po +19 -3
  67. data/sample/can_rabbit.rd +0 -24
  68. data/sample/rabbit-en.hiki +0 -4
  69. data/sample/rabbit-en.rd +0 -4
  70. data/sample/rabbit.hiki +0 -4
  71. data/sample/rabbit.rd +0 -4
  72. data/test/test-slide-configuration.rb +3 -2
  73. metadata +27 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5ac1e9a044b494427ee4a86ff4acac595284072d727b51bed4796fd7eba213ed
4
- data.tar.gz: 1bcdaae93582301350310d3beb14ebeecc5884cd1a68e75f8f50f6f7faf545cc
3
+ metadata.gz: 1ce2e5a227e5b700aab7ed9bf170bd44cdd322e2acf75fdfbd7e846d0a95f5f4
4
+ data.tar.gz: 73e79afd0c49ecb664fb98594b589521a4bbaf74bcd1b91209335a22e90f5d74
5
5
  SHA512:
6
- metadata.gz: 373124d83ef693e876daff6330bd6e41a77561d5e465e8dfce3cc16199cb7f9b6976999cbd7a6bd6ba04a903d715b31c90c30d6285869a702d40d9f702f4dae6
7
- data.tar.gz: 77d70fdd763523ccb33f4d640559aeeeb817da7c6a94b5a8c0def05af0a6e76d100cb5e5f41c28e96f8f84e8bc34e933278202c9314fde1068acf2adcf90b698
6
+ metadata.gz: 8a76046159d4c2dc9bb19703a59222f1c93d993f9c5928b41b57868b15377f2659629a15492058ede5e3dbeeb32592099dcadb39a8b686187fa45e47129f1107
7
+ data.tar.gz: aee5a1944c8fe477b7a879fae1641fcbfa4f02ea050aab9f82415e1eb194a21a994e33512182a51a36c5a595fb992a335e176e7eddc555812bb090b43139affe
Binary file
Binary file
data/doc/_config.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  markdown: kramdown
2
- version: 3.0.0
3
- release_date: 2019-09-06
2
+ version: 3.0.1
3
+ release_date: 2021-09-25
4
4
  rabbiter_version: 2.0.3
5
5
  rabbiter_release_date: 2016-08-21
6
6
  rabbirack_version: 2.0.0
data/doc/en/faq.rd CHANGED
@@ -39,16 +39,18 @@ Use --allotted-time option.
39
39
 
40
40
  % rabbit --allotted-time 5m slide.pdf
41
41
 
42
- The same value format of
42
+ The same value format of
43
43
 
44
44
  # _
45
45
  : allotted-time
46
46
  5m
47
47
 
48
- on slides are available for that of --allotted-time.
48
+ on slides are available for that of --allotted-time.
49
49
 
50
50
  For this example you set "5m" and the tortoise runs just 5 minutes.
51
51
 
52
+ Note that not all themes support the hare and tortoise feature. For example, the "default" theme supports it but the "lightning-talk" theme doesn't support it.
53
+
52
54
  == How can I reset tortoise to start?
53
55
 
54
56
  Hit Alt+t
data/doc/en/news.rd CHANGED
@@ -3,6 +3,97 @@ layout: en
3
3
  title: News
4
4
  ---
5
5
  {% raw %}
6
+
7
+ == 3.0.1: 2021-09-25
8
+
9
+ Ruby 3.0 support release.
10
+
11
+ === Improvements
12
+
13
+ ==== rabbit
14
+
15
+ * Suppressed warnings.
16
+ [GitHub#132][Patch by kojix2]
17
+
18
+ * image: Added support for Ruby 3.0.
19
+ [GitHub#133][Patch by kojix2]
20
+
21
+ * image: Reused downloaded images.
22
+
23
+ * image: Removed support for (({normalized_width})) and
24
+ (({normalized_height})).
25
+
26
+ * image: Added support for clipping by (({clip_x})), (({clip_y})),
27
+ (({clip_width})) and (({clip_height})).
28
+
29
+ * info-window: Moved timer position to bottom on note mode.
30
+
31
+ * info-window: Added support for (({wait})).
32
+
33
+ * Removed duplicated requires.
34
+ [GitHub#134][Patch by kojix2]
35
+
36
+ * Added support for Charty.
37
+
38
+ * Added support for embedding terminal.
39
+
40
+ * Dropped support for Ustream.
41
+
42
+ * Added support for pushing gem with MFA enabled account.
43
+ [GitHub#141][Patch by Yusuke Nakamura]
44
+
45
+ ==== rabbit-slide
46
+
47
+ * Added support for specifying slide size.
48
+
49
+ ==== Theme
50
+
51
+ * clear-blue: Added support for disabling vertical centering.
52
+
53
+ * tag: (({margin-*})): Added support for negative and float values.
54
+
55
+ * tag: Added support for wrapping by (({wrap-char})),
56
+ (({wrap-word})) and (({wrap-word-char})).
57
+
58
+ * tag: Added support for justifying by (({justify})) and
59
+ (({no-justify})).
60
+
61
+ * edge-info-toolkit: Added support for center text.
62
+
63
+ * slide-footer-info: Added support for center text.
64
+
65
+ ==== Document
66
+
67
+ * Added note about theme and here + tortoise.
68
+ [GitHub#139][Patch by Asaf Bartov]
69
+
70
+ === Fixes
71
+
72
+ ==== Theme
73
+
74
+ * image-slide-number: Fixed wrong width calculation.
75
+ [GitHub#130][Patch by HASUMI Hitoshi]
76
+
77
+ ==== Document
78
+
79
+ * Fixed English.
80
+ [GitHub#128][Patch by Zero King]
81
+
82
+ * Fixed typos.
83
+ [GitHub#140][Patch by Yusuke Nakamura]
84
+
85
+ === Thanks
86
+
87
+ * Zero King
88
+
89
+ * HASUMI Hitoshi
90
+
91
+ * kojix2
92
+
93
+ * Asaf Bartov
94
+
95
+ * Yusuke Nakamura
96
+
6
97
  == 3.0.0: 2019-09-06
7
98
 
8
99
  GTK+ 3 support release. GTK+ 2 support is dropped.
@@ -129,8 +129,6 @@ A presentation tool
129
129
  :keep_ratio => true,
130
130
  :width => 100,
131
131
  :height => 100,
132
- # :normalized_width => 50,
133
- # :normalized_height => 50,
134
132
  # :relative_width => 100,
135
133
  # :relative_height => 50,
136
134
  })}}
@@ -177,8 +175,6 @@ Relative image sizes
177
175
  {
178
176
  :caption => "USAGI",
179
177
  :keep_ratio => true,
180
- # :normalized_width => 50,
181
- # :normalized_height => 50,
182
178
  # :relative_width => 100,
183
179
  :relative_height => 80,
184
180
  })}}
@@ -133,8 +133,6 @@ title: "Sample slide: Rabbit"
133
133
  # keep_ratio = true
134
134
  # width = 100
135
135
  # height = 100
136
- # # normalized_width = 50
137
- # # normalized_height = 50
138
136
  # # relative_width = 100
139
137
  # # relative_height = 50
140
138
 
@@ -185,8 +183,6 @@ title: "Sample slide: Rabbit"
185
183
  # src = usagi.png
186
184
  # caption = USAGI
187
185
  # keep_ratio = true
188
- # # normalized_width = 50
189
- # # normalized_height = 50
190
186
  # # relative_width = 100
191
187
  # relative_height = 80
192
188
 
@@ -201,12 +201,12 @@ For example, here is a theme-benchmark-en case:
201
201
  elements. So it's useful for confirming your theme.
202
202
 
203
203
  You can publish your slide to both RubyGems.org and SlideShare by
204
- ((%rabbit publish%)). The following documentation describes to publish
204
+ ((%rake publish%)). The following documentation describes to publish
205
205
  your slide separately.
206
206
 
207
207
  === Publication for RubyGems.org
208
208
 
209
- You can publish your slide to RubyGems.org by ((%rabbit
209
+ You can publish your slide to RubyGems.org by ((%rake
210
210
  publish:rubygems%)):
211
211
 
212
212
  % rake publish:rubygems
@@ -231,7 +231,7 @@ RubyGems.org.
231
231
 
232
232
  === Publication for SlideShare
233
233
 
234
- You can publish your slide to SlideShare by ((%rabbit publish:slideshare%)).
234
+ You can publish your slide to SlideShare by ((%rake publish:slideshare%)).
235
235
 
236
236
  % rake publish:slideshare
237
237
 
data/doc/index.html.en CHANGED
@@ -5,7 +5,7 @@ lang_suffix: true
5
5
  no_sidebar: true
6
6
  ---
7
7
  <div class="latest-release">
8
- <p><a href="/en/news.html">{{ site.version }}</a> is the latest release. It had been released at {{ site.release_date }}.</p>
8
+ <p><a href="/en/news.html">{{ site.version }}</a> is the latest release. It was released on {{ site.release_date }}.</p>
9
9
  </div>
10
10
 
11
11
  <section id="screenshots">
data/doc/ja/faq.rd CHANGED
@@ -51,6 +51,8 @@ XXX.rdから1ページに8枚のスライドが入ったPDF(XXX_multi.pdf)
51
51
 
52
52
  上の例だと「5m」なので、亀が5分かけて走ります。
53
53
 
54
+ すべてのテーマがうさぎと亀をサポートしているわけではないことに注意してください。たとえば、「default」テーマはサポートしていますが、「lightning-talk」テーマはサポートしていません。
55
+
54
56
  == 亀を元に戻したいときは?
55
57
 
56
58
  Alt+t
data/doc/ja/news.rd CHANGED
@@ -4,6 +4,96 @@ title: お知らせ
4
4
  apply_data: false
5
5
  ---
6
6
  {% raw %}
7
+
8
+ == 3.0.1: 2021-09-25
9
+
10
+ Ruby 3.0をサポートしたリリース。
11
+
12
+ === 改良
13
+
14
+ ==== rabbit
15
+
16
+ * 警告を除去。
17
+ [GitHub#132][kojix2さんがパッチ提供]
18
+
19
+ * image: Ruby 3.0をサポート。
20
+ [GitHub#133][kojix2さんがパッチを提供]
21
+
22
+ * image: ダウンロードした画像を再利用するようにしました。
23
+
24
+ * image: (({normalized_width}))と(({normalized_height}))のサポートを
25
+ 削除。
26
+
27
+ * image: (({clip_x}))と(({clip_y}))と(({clip_width}))と(({clip_height}))で
28
+ クリップをサポート。
29
+
30
+ * info-window: ノートモードではタイマーの位置を下部に移動。
31
+
32
+ * info-window: (({wait}))をサポート。
33
+
34
+ * 重複した(({require}))を削除。
35
+ [GitHub#134][kojix2さんがパッチを提供]
36
+
37
+ * Chartyをサポート。
38
+
39
+ * 埋め込みターミナルをサポート。
40
+
41
+ * Ustreamサポートを削除。
42
+
43
+ * MFAが有効になったアカウントでのgemのpushをサポート。
44
+ [GitHub#141][Yusuke Nakamuraさんが報告]
45
+
46
+ ==== rabbit-slide
47
+
48
+ * スライドサイズの指定をサポート。
49
+
50
+ ==== テーマ
51
+
52
+ * clear-blue: 縦方向のセンタリングの無効化をサポート。
53
+
54
+ * tag: (({margin-*})): 負の値と浮動小数点数をサポート。
55
+
56
+ * tag: (({wrap-char}))と(({wrap-word}))と(({wrap-word-char}))で折り返し
57
+ をサポート。
58
+
59
+ * tag: (({justify}))と(({no-justify}))で両端揃えをサポート。
60
+
61
+ * edge-info-toolkit: テキストのセンタリングをサポート。
62
+
63
+ * slide-footer-info: テキストのセンタリングをサポート。
64
+
65
+ ==== ドキュメント
66
+
67
+ * うさぎとかめとテーマに関する注意書きを追加。
68
+ [GitHub#139][Asaf Bartovさんがパッチを提供]
69
+
70
+ === 修正
71
+
72
+ ==== テーマ
73
+
74
+ * image-slide-number: 幅の計算方法を修正。
75
+ [GitHub#130][HASUMI Hitoshiさんがパッチを提供]
76
+
77
+ ==== ドキュメント
78
+
79
+ * 英語を修正。
80
+ [GitHub#128][Zero Kingさんがパッチを提供]
81
+
82
+ * typoを修正。
83
+ [GitHub#140][Yusuke Nakamuraさんがパッチを提供]
84
+
85
+ === 感謝
86
+
87
+ * Zero Kingさん
88
+
89
+ * HASUMI Hitoshiさん
90
+
91
+ * kojix2さん
92
+
93
+ * Asaf Bartovさん
94
+
95
+ * Yusuke Nakamuraさん
96
+
7
97
  == 3.0.0: 2019-09-06
8
98
 
9
99
  GTK+ 3をサポートしたリリース。GTK+ 2のサポートは終了。
@@ -130,8 +130,6 @@ title: "サンプルスライド: Rabbit"
130
130
  :caption => "Lavie",
131
131
  :width => 100,
132
132
  :height => 100,
133
- # :normalized_width => 50,
134
- # :normalized_height => 50,
135
133
  # :relative_width => 100,
136
134
  # :relative_height => 50,
137
135
  })}}
@@ -177,8 +175,6 @@ title: "サンプルスライド: Rabbit"
177
175
  {{image("usagi.png",
178
176
  {
179
177
  :caption => "兎",
180
- # :normalized_width => 50,
181
- # :normalized_height => 50,
182
178
  # :relative_width => 100,
183
179
  :relative_height => 50,
184
180
  })}}
@@ -133,8 +133,6 @@ title: "サンプルスライド: Rabbit"
133
133
  # caption = Lavie
134
134
  # width = 100
135
135
  # height = 100
136
- # # normalized_width = 50
137
- # # normalized_height = 50
138
136
  # # relative_width = 100
139
137
  # # relative_height = 50
140
138
 
@@ -184,8 +182,6 @@ title: "サンプルスライド: Rabbit"
184
182
  # image
185
183
  # src = usagi.png
186
184
  # caption = 兎
187
- # # normalized_width = 50
188
- # # normalized_height = 50
189
185
  # # relative_width = 100
190
186
  # relative_height = 80
191
187
 
@@ -185,12 +185,12 @@ APIがなかったので諦めました。
185
185
  Rabbitのテーマを確認するためのスライドです。スライドで使われる要素がた
186
186
  くさん入っているためテーマの確認に便利です。
187
187
 
188
- 準備ができたら((%rabbit publish%))でRubyGems.orgとSlideShareにまとめて
188
+ 準備ができたら((%rake publish%))でRubyGems.orgとSlideShareにまとめて
189
189
  公開できます。別々に公開する方法は以下の通りです。
190
190
 
191
191
  === RubyGems.orgへ公開
192
192
 
193
- ((%rabbit publish:rubygems%))でRubyGems.orgに公開できます。
193
+ ((%rake publish:rubygems%))でRubyGems.orgに公開できます。
194
194
 
195
195
  % rake publish:rubygems
196
196
 
@@ -213,7 +213,7 @@ Rabbit Slide ShowはRubyGems.orgに公開されているスライドを自動で
213
213
 
214
214
  === SlideShareへ公開
215
215
 
216
- ((%rabbit publish:slideshare%))でSlideShareに公開できます。
216
+ ((%rake publish:slideshare%))でSlideShareに公開できます。
217
217
 
218
218
  % rake publish:slideshare
219
219
 
data/doc/ja/users.rd CHANGED
@@ -186,4 +186,11 @@ Rabbitショッカーのためにshocker-jaというメーリングリストが
186
186
  * ((<効率的なビットマップマーキングを用いたRuby用ごみ集め実装|URL:http://www.narihiro.info/resource/presen/Ruby%20Garbage%20Collection%20Using%20Efficient%20Bitmap%20Marking.pdf>))
187
187
  * うえださん
188
188
  * ((<エンジニアでありたい人の日記|URL:http://d.hatena.ne.jp/hiro-ueda/>))
189
+
190
+ # 2019年
191
+
192
+ * yoku0825さん
193
+ * ((<日々の覚書|URL:https://yoku0825.blogspot.com/>))
194
+ * ((<Shooting a trouble of MySQL|URL:https://speakerdeck.com/yoku0825/shooting-a-trouble-of-mysql>))
195
+ * 他にもたくさん
189
196
  * ...
@@ -71,5 +71,12 @@ module Rabbit
71
71
  def act_toggle_magnifier_config(config, canvas)
72
72
  config[:label] = N_("Magnifier")
73
73
  end
74
+
75
+ def act_toggle_terminal(action, group, canvas)
76
+ canvas.toggle_terminal
77
+ end
78
+ def act_toggle_terminal_config(config, canvas)
79
+ config[:label] = N_("Terminal")
80
+ end
74
81
  end
75
82
  end
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2012 Kouhei Sutou <kou@cozmixng.org>
1
+ # Copyright (C) 2012-2021 Sutou Kouhei <kou@cozmixng.org>
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or modify
4
4
  # it under the terms of the GNU General Public License as published by
@@ -14,11 +14,10 @@
14
14
  # with this program; if not, write to the Free Software Foundation, Inc.,
15
15
  # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16
16
 
17
- require "yaml"
18
-
19
17
  require "rabbit/gettext"
20
18
  require "rabbit/logger"
21
19
  require "rabbit/path-manipulatable"
20
+ require "rabbit/yaml-loader"
22
21
 
23
22
  module Rabbit
24
23
  class AuthorConfiguration
@@ -35,7 +34,7 @@ module Rabbit
35
34
 
36
35
  def load
37
36
  return unless File.exist?(path)
38
- conf = YAML.load(File.read(path))
37
+ conf = YAMLLoader.load(File.read(path))
39
38
  clear
40
39
  merge!(conf)
41
40
  rescue
data/lib/rabbit/canvas.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2004-2019 Sutou Kouhei <kou@cozmixng.org>
1
+ # Copyright (C) 2004-2021 Sutou Kouhei <kou@cozmixng.org>
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or modify
4
4
  # it under the terms of the GNU General Public License as published by
@@ -43,6 +43,8 @@ module Rabbit
43
43
  def_delegators(:@frame, :iconify, :window)
44
44
  def_delegators(:@frame, :fullscreen_available?)
45
45
  def_delegators(:@frame, :iconify_available?)
46
+ def_delegators(:@frame, :toggle_terminal)
47
+ def_delegators(:@frame, :in_terminal?)
46
48
 
47
49
  def_delegators(:@renderer, :width, :height)
48
50
  # Deprecated. Use #base_width= instead.
@@ -436,6 +438,14 @@ module Rabbit
436
438
  @renderer.post_iconify
437
439
  end
438
440
 
441
+ def pre_terminal
442
+ @renderer.pre_terminal
443
+ end
444
+
445
+ def post_terminal
446
+ @renderer.post_terminal
447
+ end
448
+
439
449
  def saved_image_base_name
440
450
  if @saved_image_base_name
441
451
  base_name = @saved_image_base_name.encode("UTF-8")
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2012-2019 Kouhei Sutou <kou@cozmixng.org>
1
+ # Copyright (C) 2012-2021 Sutou Kouhei <kou@cozmixng.org>
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or modify
4
4
  # it under the terms of the GNU General Public License as published by
@@ -106,6 +106,8 @@ module Rabbit
106
106
  " --id rubykaigi2012 \\\n" \
107
107
  " --base-name rabbit-introduction \\\n" \
108
108
  " --markup-language rd \\\n" \
109
+ " --width 800 \\\n" \
110
+ " --height 450 \\\n" \
109
111
  " --name \"Kouhei Sutou\" \\\n" \
110
112
  " --email kou@cozmixng.org \\\n" \
111
113
  " --rubygems-user kou \\\n" \
@@ -218,6 +220,22 @@ module Rabbit
218
220
  @data.slide_conf.presentation_end_time = time
219
221
  end
220
222
 
223
+ width_example = "--width=800"
224
+ parser.on("--width=WIDTH", Integer,
225
+ _("The default slide width"),
226
+ _("(e.g.: %s)") % width_example,
227
+ _("(optional)")) do |width|
228
+ @data.slide_conf.width = width
229
+ end
230
+
231
+ height_example = "--width=450"
232
+ parser.on("--height=HEIGHT", Integer,
233
+ _("The default slide height"),
234
+ _("(e.g.: %s)") % height_example,
235
+ _("(optional)")) do |height|
236
+ @data.slide_conf.height = height
237
+ end
238
+
221
239
  parser.separator(_("Your information"))
222
240
 
223
241
  messages = [
@@ -324,6 +342,20 @@ module Rabbit
324
342
  end
325
343
  end
326
344
 
345
+ class IntegerMapper
346
+ def initialize(data)
347
+ @data = data
348
+ end
349
+
350
+ def attach(entry)
351
+ entry.value = value if value
352
+ end
353
+
354
+ def apply(entry)
355
+ apply_value(entry.value_as_int)
356
+ end
357
+ end
358
+
327
359
  class SlideIDMapper < TextMapper
328
360
  private
329
361
  def valid?(value)
@@ -374,11 +406,35 @@ module Rabbit
374
406
  end
375
407
  end
376
408
 
409
+ class SlideWidthMapper < IntegerMapper
410
+ private
411
+ def value
412
+ @data.slide_conf.width
413
+ end
414
+
415
+ def apply_value(value)
416
+ @data.slide_conf.width = value
417
+ end
418
+ end
419
+
420
+ class SlideHeightMapper < IntegerMapper
421
+ private
422
+ def value
423
+ @data.slide_conf.height
424
+ end
425
+
426
+ def apply_value(value)
427
+ @data.slide_conf.height = value
428
+ end
429
+ end
430
+
377
431
  def build_gui_mappers
378
432
  {
379
433
  "slide-id" => SlideIDMapper.new(@data),
380
434
  "slide-base-name" => SlideBaseNameMapper.new(@data),
381
435
  "slide-markup-language" => SlideMarkupLanguageMapper.new(@data),
436
+ "slide-width" => SlideWidthMapper.new(@data),
437
+ "slide-height" => SlideHeightMapper.new(@data),
382
438
  }
383
439
  end
384
440
 
@@ -484,6 +540,8 @@ EOD
484
540
  def generate_dot_rabbit
485
541
  create_file(".rabbit") do |dot_rabbit|
486
542
  options = []
543
+ size = [@data.slide_conf.width, @data.slide_conf.height].join(",")
544
+ options << "--size #{size}"
487
545
  if @data.author_conf.markup_language.nil? and @data.allotted_time
488
546
  options << "--allotted-time #{@data.allotted_time}"
489
547
  end