Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme for RubyKaigi 2024 #160

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions data/rabbit/image/rubykaigi-2024-images/property.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@category = N_("Image")
@title = N_("RubyKaigi 2024 image")
@abstract = N_("Images related to RubyKaigi 2024")
@description = N_("Provides images related to RubyKaigi 2024. They are licensed under CC BY 4.0 by RubyKaigi 2024 Team.")
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# empty theme to add load path to images in the directory.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions lib/rabbit/theme/rubykaigi-2024/property.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@category = N_("Theme")
@title = N_("RubyKaigi 2024")
@description = N_("RubyKaigi 2024 theme")
162 changes: 162 additions & 0 deletions lib/rabbit/theme/rubykaigi-2024/rubykaigi-2024.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
add_image_path("rubykaigi-2024-images")

# puts font_families.sort
@xxx_large_font_size = screen_size(8 * Pango::SCALE)
@xx_large_font_size = screen_size(7 * Pango::SCALE)
@x_large_font_size = screen_size(6 * Pango::SCALE)
@large_font_size = screen_size(5 * Pango::SCALE)
@normal_font_size = screen_size(4 * Pango::SCALE)
@small_font_size = screen_size(3 * Pango::SCALE)
@x_small_font_size = screen_size(2.5 * Pango::SCALE)
@xx_small_font_size = screen_size(2 * Pango::SCALE)

@font_family = find_font_family('Poppins')
@monospace_font_family = 'Courier Prime'
@title_font_family = find_font_family('Dela Gothic One')

# colors
yellow = "#ffeb00"
light_yellow = "#fffef5"
red = "#ff3f46"
pink = "#ffc2de"
blue = "#2994ff"
sky_blue = "#98ffff"
green = "#80f142"
yellow_green = "#ccff00"
black = "#000000"
white = "#ffffff"

@default_headline_line_color = red
@default_headline_line_width = 2
@default_headline_line_expand = true

@default_emphasis_color = red
@default_emphasis_level2_color = "#ffffff"

set_graffiti_color red
set_graffiti_line_width 5

@space = screen_y(1)

@image_slide_number_start_flag_color = blue
@image_slide_number_goal_flag_color = red

@preformatted_fill_color = light_yellow
@preformatted_frame_color = sky_blue
@preformatted_frame_width = 3
@slide_background_image = 'slide_background.png'
include_theme("slide-background-image")

@title_slide_background_image = 'title_background.png'
include_theme("title-slide-background-image")

@item_image_1 = 'bullet-point-36.png'
@item_image_2 = 'bullet-point-32.png'
@item_image_3 = 'bullet-point-28.png'

include_theme('default')

match TitleSlide do |slides|
slides.margin_left = 850
slides.margin_right = 50
slides.prop_set("foreground", black)
slides.prop_set "style", "normal"
end
match TitleSlide, Title do |title|
title.margin_top = -10
title.prop_set "size", @xxx_large_font_size
title.prop_set "font-family", @title_font_family
title.prop_set "weight", "normal"
title.prop_set "foreground", red
end
match TitleSlide, Subtitle do |subtitle|
subtitle.margin_top = 50
subtitle.prop_set "size", @large_font_size
subtitle.prop_set "font-family", @title_font_family
subtitle.prop_set "weight", "normal"
subtitle.prop_set "foreground", blue
end
match TitleSlide, Author do |author|
author.margin_top = 50
author.prop_set "size", @normal_font_size
author.prop_set "font-family", @title_font_family
author.prop_set "weight", "normal"
author.prop_set "foreground", black
end
match TitleSlide, Institution do |i|
i.prop_set "size", @small_font_size
end

match(Slide, HeadLine) do |heads|
heads.margin_top = 0
heads.prop_set "size", @large_font_size
set_font_family(heads)
end

match(Slide) do |slides|
slides.margin_left = 50
slides.margin_right = 50
slides.prop_set("foreground", black)
end

slide_body = [Slide, Body]
item_list_item = [ItemList, ItemListItem]

indent = 50

match(*(slide_body + (item_list_item * 1))) do |items|
name = "item1"
items.delete_pre_draw_proc_by_name(name)
items.delete_post_draw_proc_by_name(name)
draw_image_mark(items, @item_image_1, name, indent: indent)
end

match(*(slide_body + (item_list_item * 2))) do |items|
name = "item2"
items.delete_pre_draw_proc_by_name(name)
items.delete_post_draw_proc_by_name(name)
draw_image_mark(items, @item_image_2, name, indent: indent)
end

match(*(slide_body + (item_list_item * 3))) do |items|
name = "item3"
items.delete_pre_draw_proc_by_name(name)
items.delete_post_draw_proc_by_name(name)
draw_image_mark(items, @item_image_3, name, indent: indent)
end

enum_list_item = [EnumList, EnumListItem]

match(*(slide_body + enum_list_item + item_list_item)) do |items|
name = "enum-item1"
items.delete_pre_draw_proc_by_name(name)
items.delete_post_draw_proc_by_name(name)
draw_image_mark(items, @item_image_1, name, indent: indent)
end

match(*(slide_body + enum_list_item + (item_list_item * 2))) do |items|
name = "enum-item2"
items.delete_pre_draw_proc_by_name(name)
items.delete_post_draw_proc_by_name(name)
draw_image_mark(items, @item_image_2, name, indent: indent)
end

# Chapter
match Slide do |slides|
slides.each do |slide|
if slide.match?(/sub_chapter/)
slide.horizontal_centering = true
elsif slide.match?(/chapter/)
set_font_family slide, @title_font_family
slide.horizontal_centering = true
elsif slide.match?(/cite/)
slide.prop_set "foreground", black
slide.horizontal_centering = true
end
end
end

match("**", PreformattedBlock) do |block|
block.prop_set("foreground", black)
end

39 changes: 39 additions & 0 deletions sample/rubykaigi-2024.rab
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
= Your Awesome Title

: subtitle
Subtitle Goes So Cool
: author
Your Name
: institution
Your Institution
: allotted-time
30m
: theme
rubykaigi-2024

= About slide size

The resolution of the projectors in NAHArt (the venue of RubyKaigi 2024) is ((*1920 x 1200*)) (16:10).

So this theme is optimized when you specify the size like below:

# enscript sh
bundle exec rabbit --size=1920,1200 your_slide.rab

= Fonts

You need to install the follows:

* (({Dela Gothic One})) for title page
* (({Poppins})) for content pages
* (({Courier Prime})) for monospace (code block)

= Items

* Item
* Item
* Item
* Item
* Item
* item

Loading