slideoff 0.3 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -6
- data/bin/slideoff +1 -7
- data/lib/slideoff.rb +1 -1
- data/lib/slideoff/config_builder.rb +4 -3
- data/lib/slideoff/presentation.rb +2 -2
- data/lib/slideoff/utils.rb +7 -9
- data/themes/modern/README.md +6 -46
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3342ad11624886342653e6bc66b89512342efc05
|
4
|
+
data.tar.gz: a4b960dedad2fcc6bc6987006a9f72ddce574e3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 539638da63732104be967752c179521a08dffcf6c59b2743e97edf3814872ac2f4499ed0c9b75ec68216d7fff19958453d78ff6e8c76a6be14d5167341d9e193
|
7
|
+
data.tar.gz: 5de90cea3eddc9ab5c7ad7240664c615819de1199bbd64610a3bcfdb172befe5d1df33db2ad96f3a4882e57adc6b0dbcda48e633dcb22eeb33cfcf641cdd73dd
|
data/README.md
CHANGED
@@ -54,7 +54,8 @@ element.
|
|
54
54
|
Override some theme styles by using `style.css` in the presentation directory. Another way is to clone the theme via
|
55
55
|
`slideoff install_theme <git-url>` and make changes there. Be sure to use the correct theme name in `presentation.json`.
|
56
56
|
|
57
|
-
|
57
|
+
Assets are looked up in this order:
|
58
|
+
|
58
59
|
1. `./<asset_name>`
|
59
60
|
1. `.config/slideoff/themes/<theme_name>/<asset_name>`
|
60
61
|
1. `installation_dir/themes/<theme_name>/<asset_name>`
|
@@ -209,11 +210,6 @@ Try it in your example presentation after initialization.
|
|
209
210
|
Found an issue or have a suggestion? Please report it on
|
210
211
|
[Github's issue tracker](http://github.com/DSIW/slideoff/issues).
|
211
212
|
|
212
|
-
If you wants to make a pull request, please check the specs before:
|
213
|
-
|
214
|
-
bundle exec spec/slideoff_spec.rb
|
215
|
-
|
216
|
-
|
217
213
|
## Credits
|
218
214
|
|
219
215
|
Bruno Michel is the guy who made [Slide'em up](https://github.com/nono/slide-em-up) and Scott Chacon is the guy who made
|
data/bin/slideoff
CHANGED
@@ -96,13 +96,7 @@ command [:serve_static] do |c|
|
|
96
96
|
c.flag [:p,:port]
|
97
97
|
|
98
98
|
c.action do |global_options,options,args|
|
99
|
-
|
100
|
-
Slideoff::Utils.serve_static(options[:port], verbose: true)
|
101
|
-
else
|
102
|
-
Dir.chdir(Slideoff::Utils.static_dir) do |dir|
|
103
|
-
Slideoff::Utils.serve_static(options[:port], verbose: true)
|
104
|
-
end
|
105
|
-
end
|
99
|
+
Slideoff::Utils.serve_static(options[:port], verbose: true)
|
106
100
|
end
|
107
101
|
end
|
108
102
|
|
data/lib/slideoff.rb
CHANGED
@@ -11,7 +11,8 @@ module Slideoff
|
|
11
11
|
"theme" => "shower",
|
12
12
|
"duration" => 60,
|
13
13
|
"author" => "Max Mustermann",
|
14
|
-
"pygments_style" => "colorful"
|
14
|
+
"pygments_style" => "colorful",
|
15
|
+
"static_dir" => "static"
|
15
16
|
}
|
16
17
|
SECTION_DEFAULT = {
|
17
18
|
"show_chapter" => true,
|
@@ -27,8 +28,8 @@ module Slideoff
|
|
27
28
|
new_hash.merge!(k => SECTION_DEFAULT.merge(hash))
|
28
29
|
end
|
29
30
|
Dir.chdir(_dir) do
|
30
|
-
infos['css'] = Dir["**/*.css"]
|
31
|
-
infos['js'] = Dir["**/*.js"]
|
31
|
+
infos['css'] = Dir["**/*.css"].sort - Dir["#{DEFAULT["static_dir"]}/**/*.css"]
|
32
|
+
infos['js'] = Dir["**/*.js"].sort - Dir["#{DEFAULT["static_dir"]}/**/*.js"]
|
32
33
|
end
|
33
34
|
ENV["FLICKR_API_KEY"] = infos['flickr_api_key']
|
34
35
|
end
|
data/lib/slideoff/utils.rb
CHANGED
@@ -415,14 +415,14 @@ PageDown / Down / right / l / j | Goto next slide
|
|
415
415
|
path = CONFIG.remote_path
|
416
416
|
mkdir_commands = parents(path).map { |path| "mkdir -vp -m 755 #{path}" }
|
417
417
|
remote_cmd mkdir_commands
|
418
|
-
`scp -r #{File.join(static_dir, "*")} #{CONFIG.remote_host}:#{path}`
|
418
|
+
`scp -r #{File.join(CONFIG.static_dir, "*")} #{CONFIG.remote_host}:#{path}`
|
419
419
|
remote_cmd "chmod -vR o+r #{path}"
|
420
420
|
end
|
421
421
|
|
422
422
|
def generate_static(options = {})
|
423
423
|
fork_server(options) do
|
424
|
-
FileUtils.mkdir_p(static_dir)
|
425
|
-
Dir.chdir(static_dir) do |dir|
|
424
|
+
FileUtils.mkdir_p(CONFIG.static_dir)
|
425
|
+
Dir.chdir(CONFIG.static_dir) do |dir|
|
426
426
|
`wget -E -H -k -nH -p http://127.0.0.1:#{options[:port]}/`
|
427
427
|
File.write('robots.txt', "User-agent: *\nDisallow: /\n")
|
428
428
|
end
|
@@ -430,8 +430,10 @@ PageDown / Down / right / l / j | Goto next slide
|
|
430
430
|
end
|
431
431
|
|
432
432
|
def serve_static(port, options = {})
|
433
|
-
|
434
|
-
|
433
|
+
Dir.chdir(CONFIG.static_dir) do
|
434
|
+
puts "Listening python server on http://0.0.0.0:#{port}" if options[:verbose]
|
435
|
+
`python3 -m http.server #{port}`
|
436
|
+
end
|
435
437
|
end
|
436
438
|
|
437
439
|
def generate_pdf_file(options = {})
|
@@ -459,10 +461,6 @@ PageDown / Down / right / l / j | Goto next slide
|
|
459
461
|
`ssh #{CONFIG.remote_host} "#{Array(cmds).join(';')}"`
|
460
462
|
end
|
461
463
|
|
462
|
-
def self.static_dir
|
463
|
-
"public"
|
464
|
-
end
|
465
|
-
|
466
464
|
def self.convert_to_filename(string)
|
467
465
|
string.downcase.gsub(/[^a-z0-9.-]/, '')
|
468
466
|
end
|
data/themes/modern/README.md
CHANGED
@@ -1,52 +1,12 @@
|
|
1
1
|
# Modern theme
|
2
2
|
|
3
|
-
Theme for [
|
3
|
+
Theme for [slideoff](https://github.com/DSIW/slideoff)
|
4
4
|
|
5
|
-
|
5
|
+
## Installation
|
6
6
|
|
7
|
-
|
7
|
+
1. Run `slideoff install_theme https://github.com/DSIW/slideoff-modern`
|
8
|
+
1. Change `theme` element in your `presentation.json`
|
8
9
|
|
9
|
-
|
10
|
-
1. `git clone url modern`
|
11
|
-
2. `cd modern`
|
12
|
-
2. `sass --update styles:css`
|
13
|
-
2. `mkdir ~/.slide-em-up`
|
14
|
-
3. `cp -r modern ~/.slide-em-up/modern`
|
15
|
-
4. `mkdir ~/presentation`
|
16
|
-
5. `cd ~/presentation`
|
17
|
-
6. `mkdir main`
|
18
|
-
7. `vim main/slides.md`
|
19
|
-
```sh
|
20
|
-
cat > main/slides.md <<EOF
|
21
|
-
!SLIDE
|
22
|
-
# My first slide
|
10
|
+
## Usage
|
23
11
|
|
24
|
-
|
25
|
-
EOF
|
26
|
-
```
|
27
|
-
8. Create presentation.json
|
28
|
-
```sh
|
29
|
-
cat > presentation.json <<EOF
|
30
|
-
{
|
31
|
-
"title": "My first presentation",
|
32
|
-
"theme": "modern",
|
33
|
-
"pygments_style": "github",
|
34
|
-
"duration": 20,
|
35
|
-
"sections": {
|
36
|
-
"main": "Title of my main section"
|
37
|
-
}
|
38
|
-
}
|
39
|
-
EOF
|
40
|
-
```
|
41
|
-
9. `gem install slide-em-up`
|
42
|
-
10. `slide-em-up`
|
43
|
-
11. Open your browser on http://localhost:9000
|
44
|
-
|
45
|
-
# Usage
|
46
|
-
|
47
|
-
```html
|
48
|
-
!SLIDE chapter
|
49
|
-
!SLIDE section
|
50
|
-
!SLIDE shout [up|right]
|
51
|
-
!SLIDE cover [w|h|wh]
|
52
|
-
```
|
12
|
+
See this [README](https://github.com/DSIW/slideoff/blob/master/README.md).
|