slideshow 0.9.10 → 0.9.11
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/Rakefile +2 -2
- data/lib/slideshow.rb +1 -1
- data/lib/slideshow/helpers/background_helper.rb +32 -6
- data/lib/slideshow/helpers/syntax/sh_helper.rb +1 -1
- data/lib/slideshow/opts.rb +1 -1
- metadata +12 -12
data/Rakefile
CHANGED
data/lib/slideshow.rb
CHANGED
@@ -9,17 +9,43 @@ def gradient_from_headers( *args )
|
|
9
9
|
# to define gradient (see http://slideshow.rubyforge.org/themes.html for predefined themes)
|
10
10
|
|
11
11
|
theme = headers[ :gradient_theme ]
|
12
|
-
colors = headers[ :gradient_colors ].split(
|
12
|
+
colors = headers[ :gradient_colors ].split(' ') # colors as space separated all-in-one string
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
buf = ""
|
15
|
+
|
16
|
+
if theme == 'diagonal'
|
17
|
+
buf << "linear-gradient( top left, #{colors.join(', ')} )"
|
18
|
+
elsif theme == 'top-bottom'
|
19
|
+
buf << "linear-gradient( top, #{colors.join(', ')} )"
|
20
|
+
elsif theme == 'left-right'
|
21
|
+
buf << "linear-gradient( left, #{colors.join(', ')} )"
|
22
|
+
elsif theme == 'repeat'
|
23
|
+
buf << "repeating-linear-gradient( -60deg, "
|
24
|
+
# quick and dirty hack - for now repeat colors 10 times
|
25
|
+
9.times { buf << "#{colors.join(', ')}, " }
|
26
|
+
buf << "#{colors.join(', ')} )"
|
27
|
+
elsif theme == 'radial'
|
28
|
+
buf << "radial-gradient( #{colors.join(', ')} )"
|
29
|
+
elsif theme == 'radial-off-center'
|
30
|
+
buf << "radial-gradient( 70% 70%, ellipse, #{colors.join(', ')} )"
|
31
|
+
elsif theme == 'radial-repeat'
|
32
|
+
buf << "repeating-radial-gradient( 60% 60%, ellipse, "
|
33
|
+
# quick and dirty hack - for now repeat colors 10 times
|
34
|
+
9.times { buf << "#{colors.join(', ')}, " }
|
35
|
+
buf << "#{colors.join(', ')} )"
|
36
|
+
else
|
37
|
+
buf << "linear-gradient( #{colors.join(', ')} )"
|
38
|
+
puts "warning: unknown gradient themes #{theme} - falling back to default"
|
39
|
+
end
|
19
40
|
|
20
41
|
# todo: add value for headers to puts
|
21
42
|
puts " Adding CSS for gradient background style rule using headers..."
|
22
43
|
content_for( :css, <<-EOS )
|
44
|
+
/****
|
45
|
+
* generated by gradient_from_headers helper
|
46
|
+
* gradient-theme: #{theme}
|
47
|
+
* gradient-colors: #{colors.join(' ')}
|
48
|
+
*/
|
23
49
|
.slide { background-image: -webkit-#{buf};
|
24
50
|
background-image: -mozilla-#{buf};
|
25
51
|
background-image: -ms-#{buf};
|
@@ -8,7 +8,7 @@ module Slideshow
|
|
8
8
|
|
9
9
|
def sh_worker( code, opts )
|
10
10
|
|
11
|
-
lang = opts.fetch( :lang, SH_LANG )
|
11
|
+
lang = opts.fetch( :lang, headers.get( 'code-language', SH_LANG ))
|
12
12
|
line_numbers_value = opts.fetch( :line_numbers, headers.get( 'code-line-numbers', SH_LINE_NUMBERS ))
|
13
13
|
line_numbers = (line_numbers_value =~ /true|yes|on/i) ? true : false
|
14
14
|
|
data/lib/slideshow/opts.rb
CHANGED
@@ -101,7 +101,7 @@ class Opts
|
|
101
101
|
:footer => '',
|
102
102
|
:subfooter => '',
|
103
103
|
:gradient_theme => 'diagonal',
|
104
|
-
:gradient_colors => 'red
|
104
|
+
:gradient_colors => 'red orange',
|
105
105
|
|
106
106
|
:code_engine => 'sh', # SyntaxHighligher (sh) | ultraviolet (uv) | coderay (cr)
|
107
107
|
:code_txmt => 'false', # Text Mate Hyperlink for Source?
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slideshow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 45
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 11
|
10
|
+
version: 0.9.11
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Gerald Bauer
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-02-
|
18
|
+
date: 2012-02-21 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -26,12 +26,12 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
29
|
+
hash: 37
|
30
30
|
segments:
|
31
31
|
- 4
|
32
|
-
-
|
33
|
-
-
|
34
|
-
version: 4.
|
32
|
+
- 2
|
33
|
+
- 9
|
34
|
+
version: 4.2.9
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id001
|
37
37
|
- !ruby/object:Gem::Dependency
|
@@ -42,12 +42,12 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
hash:
|
45
|
+
hash: 33
|
46
46
|
segments:
|
47
47
|
- 0
|
48
|
-
-
|
49
|
-
-
|
50
|
-
version: 0.
|
48
|
+
- 13
|
49
|
+
- 5
|
50
|
+
version: 0.13.5
|
51
51
|
type: :runtime
|
52
52
|
version_requirements: *id002
|
53
53
|
- !ruby/object:Gem::Dependency
|