slideoff 0.3 → 0.3.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a50c9f4b9fb5933f3b718b4cb7caf0d7f01fdca9
4
- data.tar.gz: c0e85071f700e4a6bf231965401ce202de73751d
3
+ metadata.gz: 3342ad11624886342653e6bc66b89512342efc05
4
+ data.tar.gz: a4b960dedad2fcc6bc6987006a9f72ddce574e3a
5
5
  SHA512:
6
- metadata.gz: 41639965b9d4ea7e04852eefc93a64c84abba6175e77866d66c68397b559e6b627e438849dbe7ca1285263011aba24209c28f4eebabdbf73bf13addb32f4b9f4
7
- data.tar.gz: cda24d0ee6c9ce12cfa6a9fad72a3ed8aa7d725003b1ab496d0d938b615c69de62a6660c09e2b820693d49679aa5c38f248f7b57a985a6c8bff1c0de4ea641a6
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
- Asset lookup in this order:
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
- if File.basename(Dir.pwd) =~ /^static/
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,5 +11,5 @@ module Slideoff
11
11
  autoload :FlickrAPI, "slideoff/flickr_api"
12
12
 
13
13
  CONFIG = ConfigBuilder.new(Dir.pwd)
14
- VERSION = "0.3"
14
+ VERSION = "0.3.1"
15
15
  end
@@ -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
@@ -64,8 +64,8 @@ module Slideoff
64
64
  end
65
65
  t.title = title
66
66
  Dir.chdir(t.dir) do
67
- t.css = Dir["**/*.css"]
68
- t.js = Dir["**/*.js"]
67
+ t.css = Dir["**/*.css"].sort
68
+ t.js = Dir["**/*.js"].sort
69
69
  end
70
70
  end
71
71
  end
@@ -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
- puts "Listening python server on http://0.0.0.0:#{port}" if options[:verbose]
434
- `python3 -m http.server #{port}`
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
@@ -1,52 +1,12 @@
1
1
  # Modern theme
2
2
 
3
- Theme for [slide-em-up](https://github.com/nono/slide-em-up)
3
+ Theme for [slideoff](https://github.com/DSIW/slideoff)
4
4
 
5
- This theme is based on [Bright Theme](https://github.com/shower/bright).
5
+ ## Installation
6
6
 
7
- # Installation
7
+ 1. Run `slideoff install_theme https://github.com/DSIW/slideoff-modern`
8
+ 1. Change `theme` element in your `presentation.json`
8
9
 
9
- 0. `cd /tmp`
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
- * First bullet point
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).
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slideoff
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - DSIW