slideshow 0.1 → 0.2
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.
- data/lib/slideshow.rb +150 -13
- metadata +17 -9
data/lib/slideshow.rb
CHANGED
@@ -5,6 +5,69 @@ module Slideshow
|
|
5
5
|
|
6
6
|
def Slideshow.create_slideshow( fn )
|
7
7
|
|
8
|
+
|
9
|
+
gradient = <<EOS
|
10
|
+
<svg xmlns="http://www.w3.org/2000/svg">
|
11
|
+
|
12
|
+
<defs>
|
13
|
+
<linearGradient id="dark" x1="0" y1="0" x2="1" y2="1">
|
14
|
+
<stop offset="0" style="stop-color: red"/>
|
15
|
+
<stop offset="1" style="stop-color: black"/>
|
16
|
+
</linearGradient>
|
17
|
+
|
18
|
+
<linearGradient id="dark_reverse" x1="0" y1="0" x2="1" y2="1">
|
19
|
+
<stop offset="0" style="stop-color: black"/>
|
20
|
+
<stop offset="1" style="stop-color: red"/>
|
21
|
+
</linearGradient>
|
22
|
+
|
23
|
+
<linearGradient id="light" x1="0" y1="0" x2="1" y2="1">
|
24
|
+
<stop offset="0" style="stop-color: red"/>
|
25
|
+
<stop offset="1" style="stop-color: orange"/>
|
26
|
+
</linearGradient>
|
27
|
+
|
28
|
+
<linearGradient id="top_bottom" x1="0" y1="0" x2="0" y2="1">
|
29
|
+
<stop offset="0%" style="stop-color: red" />
|
30
|
+
<stop offset="100%" style="stop-color: black" />
|
31
|
+
</linearGradient>
|
32
|
+
|
33
|
+
<linearGradient id="left_right" x1="0" y1="0" x2="1" y2="0">
|
34
|
+
<stop offset="0%" style="stop-color: red" />
|
35
|
+
<stop offset="100%" style="stop-color: orange" />
|
36
|
+
</linearGradient>
|
37
|
+
|
38
|
+
<linearGradient id="repeat" x1="0.4" y1="0.4" x2="0.5" y2="0.5"
|
39
|
+
spreadMethod="repeat">
|
40
|
+
<stop offset="0%" style="stop-color: red" />
|
41
|
+
<stop offset="50%" style="stop-color: orange" />
|
42
|
+
<stop offset="100%" style="stop-color: red" />
|
43
|
+
</linearGradient>
|
44
|
+
|
45
|
+
<radialGradient id="radial">
|
46
|
+
<stop offset="0%" style="stop-color: black" />
|
47
|
+
<stop offset="100%" style="stop-color: red" />
|
48
|
+
</radialGradient>
|
49
|
+
|
50
|
+
|
51
|
+
<radialGradient id="radial_off_center" fx="0.7" fy="0.7" cx="0.5" cy="0.5" r="0.4">
|
52
|
+
<stop offset="0%" style="stop-color: orange" />
|
53
|
+
<stop offset="100%" style="stop-color: red" />
|
54
|
+
</radialGradient>
|
55
|
+
|
56
|
+
<radialGradient id="radial_repeat" fx="0.5" fy="0.5" cx="0.6" cy="0.6" r="0.2"
|
57
|
+
spreadMethod="repeat">
|
58
|
+
<stop offset="0%" style="stop-color: red" />
|
59
|
+
<stop offset="50%" style="stop-color: orange" />
|
60
|
+
<stop offset="100%" style="stop-color: red" />
|
61
|
+
</radialGradient>
|
62
|
+
|
63
|
+
</defs>
|
64
|
+
|
65
|
+
<rect width="100%" height="100%"
|
66
|
+
style="fill: url(#dark) "/>
|
67
|
+
|
68
|
+
</svg>
|
69
|
+
EOS
|
70
|
+
|
8
71
|
header = <<EOS
|
9
72
|
<html>
|
10
73
|
<head>
|
@@ -13,31 +76,97 @@ header = <<EOS
|
|
13
76
|
<meta name="titleselector" content="h1">
|
14
77
|
<meta name="stepselector" content=".step">
|
15
78
|
|
16
|
-
|
79
|
+
<title>Slideshow</title>
|
17
80
|
|
18
81
|
<style type="text/css">
|
19
|
-
|
82
|
+
|
83
|
+
@media screen {
|
84
|
+
.layout { display: none; }
|
85
|
+
|
86
|
+
.banner {
|
87
|
+
display: block;
|
88
|
+
border: green solid thick;
|
89
|
+
padding: 1em;
|
90
|
+
font-family: sans-serif;
|
91
|
+
font-weight: bold;
|
92
|
+
margin-bottom: 2em;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
@media projection {
|
20
97
|
|
21
98
|
body
|
22
99
|
{
|
100
|
+
height: 100%; margin: 0px; padding: 0px;
|
23
101
|
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
|
102
|
+
color: white;
|
103
|
+
opacity: .99;
|
104
|
+
}
|
105
|
+
|
106
|
+
.slide
|
107
|
+
{
|
108
|
+
page-break-after: always;
|
109
|
+
padding-left: 2em;
|
110
|
+
padding-top: 2em;
|
24
111
|
}
|
25
112
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
p, li, td, th { font-size: 18pt; color: black; }
|
113
|
+
.banner
|
114
|
+
{
|
115
|
+
display: none;
|
116
|
+
}
|
31
117
|
|
32
|
-
|
33
|
-
|
118
|
+
.layout
|
119
|
+
{
|
120
|
+
display: block;
|
121
|
+
}
|
34
122
|
|
35
|
-
|
123
|
+
div.background {
|
124
|
+
position: fixed;
|
125
|
+
left: 0px;
|
126
|
+
right: 0px;
|
127
|
+
top: 0px;
|
128
|
+
bottom: 0px;
|
129
|
+
z-index: -1;
|
130
|
+
}
|
131
|
+
|
132
|
+
a:link, a:visited {
|
133
|
+
color: white;
|
134
|
+
}
|
135
|
+
a:hover { background-color: yellow; }
|
136
|
+
|
137
|
+
h1, h2 { font-size: 36pt; }
|
138
|
+
h3 { font-size: 25pt; }
|
139
|
+
p, li, td, th { font-size: 18pt; }
|
140
|
+
|
141
|
+
pre { font-size: 16pt; }
|
142
|
+
|
143
|
+
pre.code { font-size: 16pt;
|
144
|
+
background-color: black;
|
145
|
+
color: white;
|
146
|
+
padding: 5px;
|
147
|
+
border: silver thick groove;
|
148
|
+
-moz-border-radius: 11px;
|
149
|
+
}
|
150
|
+
}
|
151
|
+
|
36
152
|
</style>
|
37
153
|
|
38
154
|
|
39
155
|
</head>
|
40
156
|
<body>
|
157
|
+
|
158
|
+
<div class="layout">
|
159
|
+
<div class="background">
|
160
|
+
<object data="$svgname" width="100%" height="100%">
|
161
|
+
</div>
|
162
|
+
</div>
|
163
|
+
|
164
|
+
<div class="banner">
|
165
|
+
Turn this document into a (PowerPoint/KeyNote-style) slide show pressing F11.
|
166
|
+
(Free <a href="https://addons.mozilla.org/en-US/firefox/addon/4650">FullerScreen</a> Firefox addon required).
|
167
|
+
Learn more at the <a href="http://slideshow.rubyforge.org">Slide Show (S9)</a>
|
168
|
+
RubyForge project site.
|
169
|
+
</div>
|
41
170
|
EOS
|
42
171
|
|
43
172
|
footer = <<EOS
|
@@ -52,8 +181,16 @@ EOS
|
|
52
181
|
|
53
182
|
inname = "#{basename}#{extname}"
|
54
183
|
outname = "#{basename}.html"
|
184
|
+
svgname = "#{basename}.svg"
|
55
185
|
|
56
|
-
puts "Preparing
|
186
|
+
puts "Preparing slideshow theme '#{svgname}'..."
|
187
|
+
|
188
|
+
out = File.new( svgname, "w+")
|
189
|
+
out << gradient
|
190
|
+
out.flush
|
191
|
+
out.close
|
192
|
+
|
193
|
+
puts "Preparing slideshow '#{outname}'..."
|
57
194
|
|
58
195
|
content = ''
|
59
196
|
slide_counter = 0
|
@@ -71,7 +208,7 @@ EOS
|
|
71
208
|
content << "\n\n</div>" if slide_counter > 0
|
72
209
|
|
73
210
|
out = File.new( outname, "w+")
|
74
|
-
out << header
|
211
|
+
out << header.gsub( '$svgname', svgname )
|
75
212
|
out << RedCloth.new( content ).to_html
|
76
213
|
out << footer
|
77
214
|
out.flush
|
@@ -86,7 +223,7 @@ def Slideshow.main
|
|
86
223
|
$options = {}
|
87
224
|
|
88
225
|
opt=OptionParser.new do |opts|
|
89
|
-
opts.banner = "Usage:
|
226
|
+
opts.banner = "Usage: slideshow [options] name"
|
90
227
|
# opts.on( "-s", "--style STYLE", "Select Stylesheet" ) { |s| $options[:style]=s }
|
91
228
|
opts.on_tail( "-h", "--help", "Show this message" ) { puts opts.help; exit }
|
92
229
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slideshow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: "0.
|
4
|
+
version: "0.2"
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
@@ -9,14 +9,22 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-02-
|
13
|
-
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
12
|
+
date: 2008-02-26 00:00:00 -08:00
|
13
|
+
default_executable: slideshow
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: RedCloth
|
17
|
+
version_requirement:
|
18
|
+
version_requirements: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 3.0.0
|
23
|
+
version:
|
16
24
|
description:
|
17
25
|
email: geraldbauer2007@gmail.com
|
18
|
-
executables:
|
19
|
-
|
26
|
+
executables: []
|
27
|
+
|
20
28
|
extensions: []
|
21
29
|
|
22
30
|
extra_rdoc_files: []
|
@@ -45,10 +53,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
45
53
|
version:
|
46
54
|
requirements: []
|
47
55
|
|
48
|
-
rubyforge_project:
|
56
|
+
rubyforge_project: slideshow
|
49
57
|
rubygems_version: 1.0.1
|
50
58
|
signing_key:
|
51
59
|
specification_version: 2
|
52
|
-
summary:
|
60
|
+
summary: Slide Show (S9) - A Free Web Alternative to PowerPoint and KeyNote in Ruby
|
53
61
|
test_files: []
|
54
62
|
|