rabbit-theme-yarp 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 83c36466926b4dde0c006b4d7283a744cc29a3d73299451ff338e95ba01ca68f
4
+ data.tar.gz: 3c02cf9c43dca0d3a1dc62e3592783b637e7060150591f0dae191669065b4a79
5
+ SHA512:
6
+ metadata.gz: 6e609068da4b01606d35b185fd487fa28a6a4276d1369eb61e7c754f2b05fa2c7d4ea44f8fecd073bbeba92a242b61b9c8a27b1f3d9b91cba4d389a455f4f2c7
7
+ data.tar.gz: c3413746276abe0b08e987b1eeafb8c336b52218a989d3c9f114ce0f38eb61b317486b760dd9416a7410dad49d4a8904277c31c1c3b43517be7d62497a90587a
data/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # Rabbit YARP Theme
2
+
3
+ A YARP theme for Rabbit (http://rabbit-shocker.org/) with lots of turquoise.
4
+
5
+ Optimized for 16:9 (use with `--width=1600 --height=900 --paper-width=1600 --paper-height=900`).
6
+
7
+ Heavily inspired by the "debian" theme.
8
+
9
+ ## For author
10
+
11
+ ### Show
12
+
13
+ rake
14
+
15
+ ### Publish
16
+
17
+ rake publish
18
+
19
+ ## For users
20
+
21
+ ### Install
22
+
23
+ gem install rabbit-theme-yarp
24
+
25
+ ### Show
26
+
27
+ rabbit -t rabbit-theme-yarp rabbit-theme-benchmark-en.gem
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require "rabbit/task/theme"
2
+
3
+ # Edit ./config.yaml to customize meta data
4
+
5
+ Rabbit::Task::Theme.new do |task|
6
+ # task.spec.licenses = ["CC BY-SA 3.0"]
7
+ # task.spec.files += Dir.glob("doc/**/*.*")
8
+ # task.spec.files -= Dir.glob("private/**/*.*")
9
+ # task.spec.add_runtime_dependency("DEPENDED THEME")
10
+ end
data/config.yaml ADDED
@@ -0,0 +1,16 @@
1
+ ---
2
+ id: yarp
3
+ tags:
4
+ - rabbit
5
+ - theme
6
+ - yarp
7
+ version: 1.0.0
8
+ licenses:
9
+ - CC-BY-SA-3.0
10
+ author:
11
+ markup_language: :markdown
12
+ name: Daniele E. Domenichelli
13
+ email: daniele.domenichelli@iit.it
14
+ rubygems_user: drdanz
15
+ slideshare_user:
16
+ speaker_deck_user:
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
data/theme.rb ADDED
@@ -0,0 +1,344 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ #--------------------------------------
4
+ # screen and spacing setup
5
+ #--------------------------------------
6
+ # 4/3 = 1
7
+ # 16/9 = 0.75
8
+ @yarp_screen_ratio_mult = 4.0 / 3.0 * canvas.height / canvas.width
9
+ @space = screen_y(1) * @yarp_screen_ratio_mult
10
+ @margin_left = screen_x(3)
11
+ @margin_right = screen_x(3)
12
+ @margin_top = screen_y(1)
13
+ @margin_bottom = screen_y(1)
14
+ @slide_footer_info_x_margin ||= screen_x(7)
15
+
16
+ #--------------------------------------
17
+ # font size setup
18
+ #--------------------------------------
19
+ @xxxx_large_font_size = screen_size(10 * Pango::SCALE * @yarp_screen_ratio_mult)
20
+ @xxx_large_font_size = screen_size(8 * Pango::SCALE * @yarp_screen_ratio_mult)
21
+ @xx_large_font_size = screen_size(6 * Pango::SCALE * @yarp_screen_ratio_mult)
22
+ @x_large_font_size = screen_size(5 * Pango::SCALE * @yarp_screen_ratio_mult)
23
+ @large_font_size = screen_size(4.5 * Pango::SCALE * @yarp_screen_ratio_mult)
24
+ @normal_font_size = screen_size(3.5 * Pango::SCALE * @yarp_screen_ratio_mult)
25
+ @small_font_size = screen_size(3.2 * Pango::SCALE * @yarp_screen_ratio_mult)
26
+ @x_small_font_size = screen_size(3 * Pango::SCALE * @yarp_screen_ratio_mult)
27
+ @xx_small_font_size = screen_size(2.8 * Pango::SCALE * @yarp_screen_ratio_mult)
28
+ @xxx_small_font_size = screen_size(2.5 * Pango::SCALE * @yarp_screen_ratio_mult)
29
+ @script_font_size = @xxx_small_font_size
30
+ @large_script_font_size = @xx_small_font_size
31
+ @x_large_script_font_size = @xsmall_font_size
32
+ #--------------------------------------
33
+ @title_slide_title_font_size = @xxx_large_font_size
34
+ @slide_footer_info_text_size ||= screen_size(1.5 * Pango::SCALE)
35
+
36
+ #--------------------------------------
37
+ # theme colors
38
+ #--------------------------------------
39
+ @yarp_color_01 = "#1bc2d8"
40
+ @yarp_color_01_t = "#1bc2d8cc"
41
+ @yarp_color_02 = "#00838f"
42
+ @yarp_color_02_t = "#00838fcc"
43
+ @yarp_color_03 = "#f6fbfd"
44
+ @yarp_color_03_t = "#f6fbfdcc"
45
+ @yarp_color_04 = "#d5f2fd"
46
+ @yarp_color_04_t = "#d5f2fdcc"
47
+
48
+ #--------------------------------------
49
+ # font family setup
50
+ #--------------------------------------
51
+ @default_font ||= "Sans"
52
+ @font_family = find_font_family(@default_font)
53
+ @bold_font ||= "Sans"
54
+ @bold_font_family = find_font_family(@bold_font)
55
+ @monospace_font ||= "Monospace"
56
+ @monospace_font_family = find_font_family(@monospace_font)
57
+
58
+ #--------------------------------------
59
+ # font color setup
60
+ #--------------------------------------
61
+ @default_emphasis_color ||= @yarp_color_02
62
+
63
+ #--------------------------------------
64
+ # set preformatted text area
65
+ #--------------------------------------
66
+ @preformatted_frame_color ||= @yarp_color_01
67
+ @preformatted_fill_color ||= @yarp_color_03
68
+ @preformatted_shadow_color ||= @yarp_color_02
69
+ @preformatted_frame_width ||= 0.5
70
+
71
+ #--------------------------------------
72
+ # set syntax highlightning area
73
+ #--------------------------------------
74
+ @syntax_highlighting_frame_color ||= @yarp_color_01
75
+ @syntax_highlighting_fill_color ||= @yarp_color_03
76
+ @syntax_highlighting_shadow_color ||= @yarp_color_02
77
+ @syntax_highlighting_frame_width ||= 0.5
78
+
79
+ #--------------------------------------
80
+ # set item marks
81
+ #--------------------------------------
82
+ @default_item1_mark_type ||= "check"
83
+ @default_item1_mark_color ||= @yarp_color_02
84
+ @default_item2_mark_color ||= @yarp_color_02
85
+ @default_item3_mark_color ||= @yarp_color_02
86
+ @default_enum_item1_mark_color ||= @yarp_color_02
87
+ @default_enum_item2_mark_color ||= @yarp_color_02
88
+ @default_description_item1_mark_color ||= @yarp_color_02
89
+ @default_block_quote_item1_mark_color ||= @yarp_color_02
90
+
91
+ #--------------------------------------
92
+ # set blockqoute texts area
93
+ #--------------------------------------
94
+ @block_quote_frame_color ||= @yarp_color_01
95
+ @block_quote_frame_width ||= 0.5
96
+ @block_quote_fill_color ||= @yarp_color_03
97
+
98
+ @block_quote_title_font_size = @x_small_font_size * 0.8
99
+ @block_quote_padding_left = screen_x(2)
100
+ @block_quote_padding_right = screen_x(2)
101
+
102
+ #--------------------------------------
103
+ # set color of description term underline
104
+ #--------------------------------------
105
+ @description_term_line_color ||= @yarp_color_01
106
+
107
+ #--------------------------------------
108
+ # set image caption size
109
+ #--------------------------------------
110
+ # @image_frame_width = 0.0
111
+ @image_caption_color = @yarp_color_02
112
+ @image_caption_font_size = @xx_small_font_size * 0.8
113
+
114
+ #--------------------------------------
115
+ # setup slide number and timer
116
+ #--------------------------------------
117
+ @image_slide_number_space_ratio ||= 1.0 / 16.0 * @yarp_screen_ratio_mult
118
+ @image_slide_number_start_flag_color ||= @yarp_color_01
119
+ @image_slide_number_goal_flag_color ||= @yarp_color_02
120
+ @image_slide_number_image ||= "images/yarp-robot-48-transp.png"
121
+ @image_timer_space_ratio ||= 1.0 / 16.0 * @yarp_screen_ratio_mult
122
+ @image_timer_image ||= "images/yarp-robot-48-grayscale-transp.png"
123
+ include_theme("image-slide-number")
124
+ include_theme("image-timer")
125
+
126
+ #--------------------------------------
127
+ # set table area
128
+ #--------------------------------------
129
+ @table_head_frame_color = @yarp_color_01
130
+ @table_head_fill_color = @yarp_color_04
131
+ @table_body_frame_color = @yarp_color_01
132
+ @table_body_fill_color = @yarp_color_03
133
+ include_theme("table")
134
+
135
+ #--------------------------------------
136
+ # use default theme
137
+ #--------------------------------------
138
+ include_theme("default")
139
+
140
+ #--------------------------------------
141
+ # override default theme icon images
142
+ #--------------------------------------
143
+ @icon_images = ["images/yarp-robot-16.png", "images/yarp-robot-64.png"]
144
+ include_theme("icon")
145
+
146
+ #----------------------------------------
147
+ # change reference text style
148
+ #----------------------------------------
149
+ match("**", ReferText) do |texts|
150
+ texts.prop_set("underline", "none")
151
+ texts.prop_set("foreground", @yarp_color_02)
152
+ end
153
+
154
+ #----------------------------------------
155
+ # Load header and footer images
156
+ #----------------------------------------
157
+ @slide_header ||= "images/top-thin-transp.png"
158
+ @slide_header_shadow_height ||= 12
159
+ @slide_header_logo_width ||= 87
160
+ slide_header_loader = ImageLoader.new(find_file(@slide_header))
161
+ slide_header_original_height = slide_header_loader.height
162
+ slide_header_original_width = slide_header_loader.width
163
+ slide_header_loader.resize(canvas.width, nil)
164
+ slide_body_top = slide_header_loader.height - (@slide_header_shadow_height / (slide_header_original_height.to_f / slide_header_loader.height.to_f)).to_i
165
+ slide_header_left = (@slide_header_logo_width / (slide_header_original_width.to_f / slide_header_loader.width.to_f)).to_i
166
+
167
+ @slide_footer ||= "images/bottom-transp.png"
168
+ slide_footer_loader = ImageLoader.new(find_file(@slide_footer))
169
+ footer_height = canvas.height/26.0 + screen_y(1) * 0.2
170
+ slide_footer_loader.resize(canvas.width, footer_height)
171
+ slide_body_bottom = footer_height
172
+ slide_body_height = canvas.height - slide_body_top - slide_body_bottom
173
+
174
+ @slide_banner ||= "images/logo-icub.png"
175
+ slide_banner_loader = ImageLoader.new(find_file(@slide_banner))
176
+ banner_height = canvas.height/26.0
177
+ slide_banner_loader.resize(nil, banner_height)
178
+ banner_pos_x = canvas.width - slide_banner_loader.width
179
+ banner_pos_y = canvas.height - slide_banner_loader.height - footer_height
180
+
181
+ #----------------------------------------
182
+ # Slide Header Settings
183
+ #----------------------------------------
184
+ # (title only slides - Takahashi method)
185
+ @lightning_talk_proc_name ||= "lightning-debian"
186
+ @lightning_talk_as_large_as_possible ||= true
187
+ @lightning_talk_color ||= @yarp_color_01
188
+ @lightning_talk_background_color ||= @yarp_color_03
189
+ # @lightning_talk_contact_information ||= "Danz"
190
+
191
+ include_theme("lightning-talk-toolkit")
192
+
193
+ match(Slide) do |slides|
194
+ slides.each do |slide|
195
+ if slide.lightning_talk?
196
+ slide.headline.margin_top = 0
197
+ slide.headline.margin_bottom = 0
198
+ slide.headline.margin_left = 0
199
+ slide.headline.margin_right = 0
200
+ slide.headline.prop_set("foreground", @yarp_color_01)
201
+ slide.headline.prop_set("shadow-color", @yarp_color_02)
202
+ slide.lightning_talk
203
+ else
204
+ slide.headline.margin_top = 0
205
+ slide.headline.margin_bottom = 0
206
+ slide.headline.margin_left = slide_header_left
207
+ slide.headline.margin_right = 0
208
+ slide.headline.prop_set("foreground", @yarp_color_03)
209
+ slide.headline.prop_set("size", @x_large_font_size)
210
+ slide.headline.add_pre_draw_proc("header-bg") do |canvas, x, y, w, h, simulation|
211
+ unless simulation
212
+ slide_header_loader.draw(canvas, 0, 0)
213
+ end
214
+ [x, y, w, h]
215
+ end
216
+ end
217
+
218
+ # Delete contact information proc (slide-footer-info is used instead)
219
+ delete_post_draw_proc_by_name(@lightning_talk_proc_name)
220
+ end
221
+ end
222
+
223
+
224
+ match(Slide, HeadLine) do |heads|
225
+ delete_post_draw_proc_by_name("head-line")
226
+ original_h = nil
227
+ heads.add_pre_draw_proc do |head, canvas, x, y, w, h, simulation|
228
+ original_h = h
229
+ [x, y, w, h]
230
+ end
231
+ heads.add_post_draw_proc do |head, canvas, x, y, w, h, simulation|
232
+ [x, slide_body_top, w, original_h - slide_body_top]
233
+ end
234
+ end
235
+
236
+ # include these again, in order to enable them in title only slides
237
+ include_theme("per-slide-background-image")
238
+ include_theme("image-slide-number")
239
+ include_theme("image-timer")
240
+
241
+ #----------------------------------------
242
+ # Slide Footer settings
243
+ #----------------------------------------
244
+ match(Slide) do |slides|
245
+ slides.each do |slide|
246
+ slide.add_pre_draw_proc("footer-bg") do |canvas, x, y, w, h, simulation|
247
+ unless simulation
248
+ slide_footer_loader.draw(canvas, 0, canvas.height - footer_height)
249
+ slide_banner_loader.draw(canvas, banner_pos_x, banner_pos_y)
250
+ end
251
+ [x, y, w, h]
252
+ end
253
+ end
254
+ end
255
+
256
+ if @slide_footer_info_right_text.nil?
257
+ if !@lightning_talk_contact_information.nil?
258
+ @slide_footer_info_right_text ||= @lightning_talk_contact_information
259
+ else
260
+ # Try to extract the author from the title slide
261
+ extracted_author = ""
262
+ match(TitleSlide, Author) do |authors|
263
+ authors.each do |author|
264
+ author.text.gsub(/\n/, ' ').split(' ').each do |name|
265
+ unless extracted_author.to_str.strip.empty?
266
+ extracted_author += ' '
267
+ end
268
+ if name.match(/[^<]+@.+\.[^>]+/)
269
+ extracted_author += "&lt;"
270
+ extracted_author += name
271
+ extracted_author += "&gt;"
272
+ else
273
+ extracted_author += name
274
+ end
275
+ end
276
+ end
277
+ end
278
+ @slide_footer_info_right_text ||= extracted_author.to_str
279
+ end
280
+ end
281
+
282
+ @slide_footer_info_base_y ||= canvas.height - footer_height
283
+ @slide_footer_info_left_text ||= canvas.title.gsub(/\n/, '')
284
+ @slide_footer_info_text_color ||= @yarp_color_03
285
+ @slide_footer_info_line_width ||= 0
286
+ include_theme("slide-footer-info")
287
+
288
+ #----------------------------------------
289
+ # Slide centering
290
+ #----------------------------------------
291
+ @slide_centering = true
292
+ match(Slide, Body) do |bodies|
293
+ bodies.vertical_centering = @slide_centering
294
+ end
295
+
296
+ #--------------------------------------
297
+ # Customize title slide
298
+ #--------------------------------------
299
+ match(TitleSlide) do |contents|
300
+ contents.prop_set("style", "normal")
301
+ end
302
+ match(TitleSlide, ContentSource) do |sources|
303
+ sources.margin_bottom = 0
304
+ end
305
+ match(TitleSlide, Date) do |dates|
306
+ dates.margin_top = @space
307
+ end
308
+ match(TitleSlide, Place) do |places|
309
+ end
310
+ match(TitleSlide, Title) do |titles|
311
+ titles.prop_set("foreground", @yarp_color_01)
312
+ end
313
+
314
+ @title_shadow_color ||= @yarp_color_02_t
315
+ include_theme("title-shadow")
316
+
317
+ #--------------------------------------
318
+ # set logo in title slide (bottom right)
319
+ #--------------------------------------
320
+ @title_logo ||= "images/logo-icub.png"
321
+ title_logo_loader = ImageLoader.new(find_file(@title_logo))
322
+ title_logo_pre_draw_proc = Proc.new do |slide, canvas, x, y, w, h, simulation|
323
+ unless simulation
324
+ draw_x = canvas.width - title_logo_loader.width
325
+ draw_y = canvas.height - title_logo_loader.height
326
+ title_logo_loader.draw(canvas, draw_x, draw_y)
327
+ end
328
+ [x, y, w, h]
329
+ end
330
+ match(TitleSlide) do |slides|
331
+ name = "title-logo"
332
+ slides.delete_pre_draw_proc_by_name(name)
333
+ slides.add_pre_draw_proc(name, &title_logo_pre_draw_proc)
334
+ end
335
+
336
+ #--------------------------------------
337
+ # set title color and background-image
338
+ #--------------------------------------
339
+ # This is at the end because it has issues with the slide-footer-info theme
340
+ @title_background_color ||= @yarp_color_03
341
+ include_theme("title-background-color")
342
+ # For some reason the background image is not found in subdirectory
343
+ @title_background_image ||= File.expand_path(find_file("images/yarp-robot-transp_b-512.png"))
344
+ include_theme("title-background-image")
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rabbit-theme-yarp
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Daniele E. Domenichelli
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-11-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rabbit
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 2.0.2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 2.0.2
27
+ description: |-
28
+ A YARP theme for Rabbit (http://rabbit-shocker.org/) with lots of turquoise.
29
+
30
+ Optimized for 16:9 (use with `--width=1600 --height=900 --paper-width=1600 --paper-height=900`).
31
+
32
+ Heavily inspired by the "debian" theme.
33
+ email:
34
+ - daniele.domenichelli@iit.it
35
+ executables: []
36
+ extensions: []
37
+ extra_rdoc_files: []
38
+ files:
39
+ - README.md
40
+ - Rakefile
41
+ - config.yaml
42
+ - data/images/YARPino.png
43
+ - data/images/bottom-transp.png
44
+ - data/images/bottom.png
45
+ - data/images/logo-icub.png
46
+ - data/images/top-thin-transp.png
47
+ - data/images/top-thin.png
48
+ - data/images/top-transp.png
49
+ - data/images/top.png
50
+ - data/images/yarp-logo.png
51
+ - data/images/yarp-robot-16.png
52
+ - data/images/yarp-robot-48-grayscale-transp.png
53
+ - data/images/yarp-robot-48-transp.png
54
+ - data/images/yarp-robot-64.png
55
+ - data/images/yarp-robot-transp-512.png
56
+ - data/images/yarp-robot-transp_b-512.png
57
+ - pdf/theme-benchmark-en.pdf
58
+ - pdf/theme-benchmark-ja.pdf
59
+ - theme.rb
60
+ homepage: http://theme.rabbit-shocker.org/themes/yarp/
61
+ licenses:
62
+ - CC-BY-SA-3.0
63
+ metadata: {}
64
+ post_install_message:
65
+ rdoc_options: []
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ requirements: []
79
+ rubyforge_project:
80
+ rubygems_version: 2.7.6
81
+ signing_key:
82
+ specification_version: 4
83
+ summary: Rabbit YARP Theme
84
+ test_files: []