showoff 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. data/LICENSE +20 -0
  2. data/README.txt +92 -25
  3. data/bin/showoff +14 -1
  4. data/lib/showoff.rb +13 -4
  5. data/lib/showoff_utils.rb +98 -0
  6. data/public/css/fg.menu.css +0 -0
  7. data/public/css/theme/images/ui-bg_diagonals-small_100_f0efea_40x40.png +0 -0
  8. data/public/css/theme/images/ui-bg_flat_35_f0f0f0_40x100.png +0 -0
  9. data/public/css/theme/images/ui-bg_glass_55_fcf0ba_1x400.png +0 -0
  10. data/public/css/theme/images/ui-bg_glow-ball_25_2e2e28_600x600.png +0 -0
  11. data/public/css/theme/images/ui-bg_highlight-soft_100_f0efea_1x100.png +0 -0
  12. data/public/css/theme/images/ui-bg_highlight-soft_25_327E04_1x100.png +0 -0
  13. data/public/css/theme/images/ui-bg_highlight-soft_25_5A9D1A_1x100.png +0 -0
  14. data/public/css/theme/images/ui-bg_highlight-soft_95_ffedad_1x100.png +0 -0
  15. data/public/css/theme/images/ui-bg_inset-soft_22_3b3b35_1x100.png +0 -0
  16. data/public/css/theme/images/ui-icons_808080_256x240.png +0 -0
  17. data/public/css/theme/images/ui-icons_8DC262_256x240.png +0 -0
  18. data/public/css/theme/images/ui-icons_cd0a0a_256x240.png +0 -0
  19. data/public/css/theme/images/ui-icons_e7e6e4_256x240.png +0 -0
  20. data/public/css/theme/images/ui-icons_eeeeee_256x240.png +0 -0
  21. data/public/css/theme/images/ui-icons_ffffff_256x240.png +0 -0
  22. data/public/css/theme/ui.accordion.css +0 -0
  23. data/public/css/theme/ui.all.css +0 -0
  24. data/public/css/theme/ui.base.css +0 -0
  25. data/public/css/theme/ui.core.css +0 -0
  26. data/public/css/theme/ui.datepicker.css +0 -0
  27. data/public/css/theme/ui.dialog.css +0 -0
  28. data/public/css/theme/ui.progressbar.css +0 -0
  29. data/public/css/theme/ui.resizable.css +0 -0
  30. data/public/css/theme/ui.slider.css +0 -0
  31. data/public/css/theme/ui.tabs.css +0 -0
  32. data/public/css/theme/ui.theme.css +0 -0
  33. data/public/js/jTypeWriter.js +0 -0
  34. data/public/js/showoff.js +7 -4
  35. data/views/index.erb +11 -1
  36. metadata +14 -2
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Scott Chacon
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.txt CHANGED
@@ -2,12 +2,12 @@ ShowOff Presentation Software
2
2
  =============================
3
3
 
4
4
  ShowOff is a Sinatra web app that reads simple configuration files for a
5
- presentation. It is sort of like a Keynote web app engine. I am using it
6
- to do all my talks in 2010, because I have a deep hatred in my heart for
7
- Keynote and yet it is by far the best in the field.
5
+ presentation. It is sort of like a Keynote web app engine - think S5 +
6
+ Slidedown. I am using it to do all my talks in 2010, because I have a deep
7
+ hatred in my heart for Keynote and yet it is by far the best in the field.
8
8
 
9
- The idea is that you setup your slide files in section subdirectories and
10
- then startup the showoff server in that directory. It will read in your
9
+ The idea is that you setup your markdown slide files in section subdirectories
10
+ and then startup the showoff server in that directory. It will read in your
11
11
  showoff.json file for which sections go in which order and then will give
12
12
  you a URL to present from.
13
13
 
@@ -29,47 +29,114 @@ It might will can:
29
29
  * show audience questions / comments (twitter or direct)
30
30
  * let audience members go back / catch up as you talk
31
31
  * let audience members vote on sections (?)
32
- * broadcast itself on Bonjour
32
+ * broadcast itself on Bonjour
33
33
  * let audience members download slides, code samples or other supplementary material
34
34
 
35
- Some of the nice things are that you can easily version control it, you
36
- can easily move sections between presentations, and you can rearrange or
37
- remove sections easily.
35
+ Some of the nice things are that you can easily version control it, you
36
+ can easily move sections between presentations, and you can rearrange or
37
+ remove sections easily.
38
38
 
39
39
  Usage
40
40
  ====================
41
41
 
42
- To try ShowOff, clone this repo and run ./bin/showoff, which will start
43
- up the Sinatra server and serve the examples/ directory. Eventually this
44
- will be gemified and you can run it in any ShowOff directory.
42
+ ShowOff is meant to be run in a ShowOff formatted repository - that means that
43
+ it has a showoff.json file and a number of sections (subdirectories) with markdown files for the slides you're presenting.
44
+
45
+ $ gem install showoff
46
+ $ git clone (showoff-repo)
47
+ $ cd (showoff-repo)
48
+ $ showoff serve
49
+
50
+ If you run 'showoff' in the ShowOff directory itself, it will show an example
51
+ presentation from the 'example' subdirectory, so you can see what it's like.
52
+
53
+ Slide Format
54
+ ====================
55
+
56
+ You can break your slides up into sections of however many subdirectories deep
57
+ you need. ShowOff will recursively check all the directories mentioned in
58
+ your showoff.json file for any markdown files (.md). Each markdown file can
59
+ have any number of slides in it, seperating each slide with the '!SLIDE'
60
+ keyword and optional slide styles.
61
+
62
+ For example, if you run 'showoff create my_new_pres' it will create a new
63
+ starter presentation for you with one .md file at one/slide.md which will have
64
+ the following contents:
65
+
66
+ !SLIDE
67
+
68
+ # My Presentation #
69
+
70
+ !SLIDE bullets incremental
71
+
72
+ # Bullet Points #
73
+
74
+ * first point
75
+ * second point
76
+ * third point
77
+
78
+ That represents two slides, one with just a large title and one with three
79
+ bullets that are incrementally updated when the slide is shown. In order for
80
+ ShowOff to see those slides, your showoff.json file needs to look something
81
+ like this:
82
+
83
+ [
84
+ {"section":"one"}
85
+ ]
86
+
87
+ If you have multiple sections in your talk, you can make this json array
88
+ include all the sections you want to show in which order you want to show
89
+ them.
90
+
91
+ Some useful styles for each slide are:
92
+
93
+ * center - centers images on a slide
94
+ * bullets - sizes and seperates bullets properly (fits up to 5, generally)
95
+ * smbullets - sizes and seperates more bullets (smaller, closer together)
96
+ * subsection - creates a different background for titles
97
+ * command - monospaces h1 title slides
98
+ * commandline - for pasted commandline sections
99
+ (needs leading '$' for commands, then output on subsequent lines)
100
+ * code - monospaces everything on the slide
101
+ * incremental - can be used with 'bullets' and 'commandline' styles,
102
+ will incrementally update elements on arrow key rather than switch slides
103
+ * small - make all slide text 80%
104
+ * smaller - make all slide text 70%
105
+
106
+ Check out the example directory included to see examples of most of these.
107
+
108
+ You can manage the presentation with the following keys:
109
+
110
+ * space, cursor right: next slide
111
+ * cursor left: previous slide
112
+ * d: debug mode
113
+ * c: table of contents (vi)
114
+ * f: toggle footer
115
+ * z: toggle help
45
116
 
46
117
  Real World Usage
47
118
  ====================
48
119
 
49
- So far, showoff has been used in the following presentations:
120
+ So far, ShowOff has been used in the following presentations:
50
121
 
51
- * LinuxConf.au 2010 - Wrangling Git - Scott Chacon
122
+ * LinuxConf.au 2010 - Wrangling Git - Scott Chacon
52
123
  http://github.com/schacon/showoff-wrangling-git
53
124
 
54
- If you use it for something, please let me know.
125
+ * SF Ruby Meetup - Resque! - Chris Wanstrath
126
+ http://github.com/defunkt/ruby-meetup-resque
127
+
128
+ If you use it for something, please let me know so I can add it.
55
129
 
56
130
  Future Plans
57
131
  ====================
58
132
 
59
- Right now it comes with an example presentation (my LinuxConf.au talk)
60
- that will probably change or go away at some point. I would like this
61
- to eventually be a general tool rather than having the presentation in
62
- the showoff repo. Eventually. So you would install showoff as a gem
63
- and then have just the presentation as your git repo (or whatever) and
64
- run 'showoff' in the repo to start the presentation.
65
-
66
133
  I really want this to evolve into a dynamic presentation software server,
67
- that gives the audience a lot of interaction into the presentation -
134
+ that gives the audience a lot of interaction into the presentation -
68
135
  helping them decide dynamically what the content of the presentation is,
69
136
  ask questions without interupting the presenter, etc. I want the audience
70
137
  to be able to download a dynamically generated PDF of either the actual
71
- talk that was given, or all the available slides, plus supplementary
72
- material. And I want the presenter (me) to be able to push each
138
+ talk that was given, or all the available slides, plus supplementary
139
+ material. And I want the presenter (me) to be able to push each
73
140
  presentation to Heroku or GitHub pages for archiving super easily.
74
141
 
75
142
  Why Not S5 or Slidy or Slidedown?
data/bin/showoff CHANGED
@@ -2,4 +2,17 @@
2
2
 
3
3
  $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
4
  require 'showoff'
5
- ShowOff.run! :host => 'localhost', :port => 9090
5
+ command = ARGV[0]
6
+
7
+ case command
8
+ when 'create'
9
+ ShowOffUtils.create
10
+ when 'add'
11
+ ShowOffUtils.add_slide
12
+ when 'heroku'
13
+ ShowOffUtils.heroku
14
+ when 'serve'
15
+ ShowOff.run! :host => 'localhost', :port => 9090
16
+ else
17
+ ShowOffUtils.help
18
+ end
data/lib/showoff.rb CHANGED
@@ -2,6 +2,7 @@ require 'rubygems'
2
2
  require 'sinatra/base'
3
3
  require 'json'
4
4
  require 'nokogiri'
5
+ require 'showoff_utils'
5
6
 
6
7
  begin
7
8
  require 'rdiscount'
@@ -36,6 +37,14 @@ class ShowOff < Sinatra::Application
36
37
  files
37
38
  end
38
39
 
40
+ def css_files
41
+ Dir.glob("#{options.pres_dir}/*.css").map { |path| File.basename(path) }
42
+ end
43
+
44
+ def js_files
45
+ Dir.glob("#{options.pres_dir}/*.js").map { |path| File.basename(path) }
46
+ end
47
+
39
48
  def process_markdown(name, content)
40
49
  slides = content.split('!SLIDE')
41
50
  slides.delete('')
@@ -111,10 +120,10 @@ class ShowOff < Sinatra::Application
111
120
  erb :index
112
121
  end
113
122
 
114
- get '/image/*' do
115
- img_file = params[:splat].join('/')
116
- img = File.join(options.pres_dir, img_file)
117
- send_file img
123
+ get %r{(?:image|file)/(.*)} do
124
+ path = params[:captures].first
125
+ full_path = File.join(options.pres_dir, path)
126
+ send_file full_path
118
127
  end
119
128
 
120
129
  get '/slides' do
@@ -0,0 +1,98 @@
1
+ class ShowOffUtils
2
+
3
+ def self.create
4
+ dirname = ARGV[1]
5
+ return help('create') if !dirname
6
+ Dir.mkdir(dirname) if !File.exists?(dirname)
7
+ Dir.chdir(dirname) do
8
+ # create section
9
+ Dir.mkdir('one')
10
+
11
+ # create markdown file
12
+ File.open('one/slide.md', 'w+') do |f|
13
+ f.puts "!SLIDE"
14
+ f.puts "# My Presentation #"
15
+ f.puts
16
+ f.puts "!SLIDE bullets incremental"
17
+ f.puts "# Bullet Points #"
18
+ f.puts
19
+ f.puts "* first point"
20
+ f.puts "* second point"
21
+ f.puts "* third point"
22
+ end
23
+
24
+ # create showoff.json
25
+ File.open('showoff.json', 'w+') do |f|
26
+ f.puts '[ {"section":"one"} ]'
27
+ end
28
+
29
+ # print help
30
+ puts "done. run 'showoff serve' in #{dirname}/ dir to see slideshow"""
31
+ end
32
+ end
33
+
34
+ def self.heroku
35
+ name = ARGV[1]
36
+ return help('heroku') if !name
37
+ if !File.exists?('showoff.json')
38
+ puts "fail. not a showoff directory"
39
+ return false
40
+ end
41
+ # create .gems file
42
+ File.open('.gems', 'w+') do |f|
43
+ f.puts "bluecloth"
44
+ f.puts "nokogiri"
45
+ f.puts "showoff"
46
+ end if !File.exists?('.gems')
47
+
48
+ # create config.ru file
49
+ File.open('config.ru', 'w+') do |f|
50
+ f.puts 'require "showoff"'
51
+ f.puts 'ShowOff.run!'
52
+ end if !File.exists?('config.ru')
53
+
54
+ `heroku create #{name}`
55
+
56
+ puts "herokuized. run something like this to launch your heroku presentation:
57
+
58
+ $ git add .gems config.ru
59
+ $ git commit -m 'herokuized'
60
+ $ git push heroku master
61
+ "
62
+ end
63
+
64
+ def self.help(verb = nil)
65
+ verb = ARGV[1] if !verb
66
+ case verb
67
+ when 'heroku'
68
+ puts <<-HELP
69
+ usage: showoff heroku (heroku-name)
70
+
71
+ creates the .gems file and config.ru file needed to push a showoff pres to
72
+ heroku. it will then run 'heroku create' for you to register the new project
73
+ on heroku and add the remote for you. then all you need to do is commit the
74
+ new created files and run 'git push heroku' to deploy.
75
+
76
+ HELP
77
+ when 'create'
78
+ puts <<-HELP
79
+ usage: showoff create (directory)
80
+
81
+ this command helps start a new showoff presentation by setting up the
82
+ proper directory structure for you. it takes the directory name you would
83
+ like showoff to create for you.
84
+
85
+ HELP
86
+ else
87
+ puts <<-HELP
88
+ usage: showoff (command)
89
+
90
+ commands:
91
+ serve serves a showoff presentation from the current directory
92
+ create generates a new showoff presentation layout
93
+ heroku sets up your showoff presentation to push to heroku
94
+ HELP
95
+ end
96
+ end
97
+
98
+ end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/public/js/showoff.js CHANGED
@@ -77,7 +77,7 @@ function showFirstSlide() {
77
77
  showSlide()
78
78
  }
79
79
 
80
- function showSlide() {
80
+ function showSlide(back_step) {
81
81
  if(slidenum < 0) {
82
82
  slidenum = 0
83
83
  return
@@ -96,8 +96,11 @@ function showSlide() {
96
96
  var mar_top = (0.5 * parseFloat($("#preso").height())) - (0.5 * parseFloat(slide_height))
97
97
  $("#preso > .slide").css('margin-top', mar_top)
98
98
 
99
- // determine if there are incremental bullets to show
100
- determineIncremental()
99
+ if(!back_step) {
100
+ // determine if there are incremental bullets to show
101
+ // unless we are moving backward
102
+ determineIncremental()
103
+ }
101
104
  }
102
105
 
103
106
  function determineIncremental()
@@ -169,7 +172,7 @@ function keyDown(event)
169
172
  else if (key == 37) // Left arrow
170
173
  {
171
174
  slidenum--
172
- showSlide()
175
+ showSlide(true) // We show the slide fully loaded
173
176
  }
174
177
  else if (key == 39) // Right arrow
175
178
  {
data/views/index.erb CHANGED
@@ -21,6 +21,16 @@
21
21
  <link type="text/css" href="/css/theme/ui.all.css" media="screen" rel="stylesheet" />
22
22
  <link type="text/css" href="/css/sh_style.css" rel="stylesheet" >
23
23
 
24
+
25
+
26
+ <% css_files.each do |css_file| %>
27
+ <link rel="stylesheet" href="file/<%= css_file %>" type="text/css"/>
28
+ <% end %>
29
+
30
+ <% js_files.each do |js_file| %>
31
+ <script type="text/javascript" src="/file/<%= js_file %>"></script>
32
+ <% end %>
33
+
24
34
  <script type="text/javascript">
25
35
  $(function(){
26
36
  setupPreso()
@@ -41,7 +51,7 @@
41
51
  <tr><td class="key">d</td><td>debug mode</td></tr>
42
52
  <tr><td class="key">c</td><td>table of contents (vi)</td></tr>
43
53
  <tr><td class="key">f</td><td>toggle footer</td></tr>
44
- <tr><td class="key">x</td><td>toggle help (this)</td></tr>
54
+ <tr><td class="key">z</td><td>toggle help (this)</td></tr>
45
55
  </table>
46
56
  </div>
47
57
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: showoff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Chacon
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-21 00:00:00 +13:00
12
+ date: 2010-01-26 00:00:00 +13:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -42,6 +42,16 @@ dependencies:
42
42
  - !ruby/object:Gem::Version
43
43
  version: "0"
44
44
  version:
45
+ - !ruby/object:Gem::Dependency
46
+ name: json
47
+ type: :runtime
48
+ version_requirement:
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: "0"
54
+ version:
45
55
  description: " ShowOff is a Sinatra web app that reads simple configuration files for a\n presentation. It is sort of like a Keynote web app engine. I am using it\n to do all my talks in 2010, because I have a deep hatred in my heart for\n Keynote and yet it is by far the best in the field.\n\n The idea is that you setup your slide files in section subdirectories and\n then startup the showoff server in that directory. It will read in your\n showoff.json file for which sections go in which order and then will give \n you a URL to present from.\n"
46
56
  email: schacon@gmail.com
47
57
  executables:
@@ -53,8 +63,10 @@ extra_rdoc_files: []
53
63
  files:
54
64
  - README.txt
55
65
  - Rakefile
66
+ - LICENSE
56
67
  - bin/showoff
57
68
  - lib/showoff.rb
69
+ - lib/showoff_utils.rb
58
70
  - views/index.erb
59
71
  - public/css/fg.menu.css
60
72
  - public/css/sh_style.css