-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththeme.rb
More file actions
87 lines (76 loc) · 2.76 KB
/
theme.rb
File metadata and controls
87 lines (76 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Copyright (C) 2012-2025 Sutou Kouhei <kou@clear-code.com>
#
# License: GPLv3+, GFDL, CC BY-SA 3.0 and/or CC BY-SA 4.0
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
@clear_code_font_family ||= nil
@font_family =
@clear_code_font_family ||
find_font_family("MotoyaLMaru") ||
find_font_family("モトヤLマルベリ") ||
@font_family
@title_slide_title_font_size ||= @x_large_font_size * 0.75
@slide_logo_image = "clear-code-headline-background.png"
include_theme("clear-blue")
@icon_images = ["clear-code-icon.png"]
# include_theme("icon")
@lightning_talk_proc_name = "lightning-clear-code"
@lightning_talk_as_large_as_possible = true
include_theme("lightning-talk-toolkit")
include_theme("title-on-image-toolkit")
match(Slide) do |slides|
slides.each do |slide|
if slide.lightning_talk? and
slide.body.elements.collect {|element| element.class} != [Image]
slide.lightning_talk
elsif slide.title_on_image? and slide["enable-title-on-image"] != "false"
slide.headline.padding_top = @space
slide.headline.padding_bottom = @space
params = {}
slide.title_on_image(params)
end
end
end
match(Slide, Body) do |bodies|
bodies.each do |body|
if body.elements.collect {|element| element.class} == [Paragraph]
body.elements.each do |element|
have_align_tag = false
have_align_tag = true if element.have_tag?("left")
have_align_tag = true if element.have_tag?("right")
element.horizontal_centering = true unless have_align_tag
next if body.slide["as-large-as-possible"] == "false"
if element.have_tag?("as-large-as-possible")
element.as_large_as_possible("one-paragraph")
elsif element.text.size < 50 or element.elements.any? {|e| e.is_a?(Note)}
element.prop_set("size", @x_large_font_size)
else
element.prop_set("size", @large_font_size)
end
end
end
body.margin_left *= 0.7
body.margin_right *= 0.7
end
end
match("**", CustomTag) do |tags|
tags.each do |tag|
case tag.name
when "center"
if tag.parent.parent.elements.any? {|element| element.is_a?(Image)}
tag.parent.margin_bottom *= 10
end
end
end
end