showoff 0.7.0 → 0.9.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/README.rdoc +53 -475
  3. data/Rakefile +17 -18
  4. data/bin/showoff +29 -7
  5. data/lib/commandline_parser.rb +1 -1
  6. data/lib/showoff/version.rb +3 -0
  7. data/lib/showoff.rb +600 -91
  8. data/lib/showoff_utils.rb +110 -4
  9. data/public/css/disconnected-large.png +0 -0
  10. data/public/css/disconnected.png +0 -0
  11. data/public/css/fast.png +0 -0
  12. data/public/css/grippy-close.png +0 -0
  13. data/public/css/grippy.png +0 -0
  14. data/public/css/onepage.css +6 -0
  15. data/public/css/pace.png +0 -0
  16. data/public/css/paceMarker.png +0 -0
  17. data/public/css/presenter.css +333 -43
  18. data/public/css/sh_style.css +15 -0
  19. data/public/css/showoff.css +373 -48
  20. data/public/css/slow.png +0 -0
  21. data/public/css/spinner.gif +0 -0
  22. data/public/css/tipsy.css +26 -0
  23. data/public/favicon.ico +0 -0
  24. data/public/js/jquery.parsequery.min.js +2 -0
  25. data/public/js/jquery.tipsy.js +260 -0
  26. data/public/js/onepage.js +2 -3
  27. data/public/js/presenter.js +384 -33
  28. data/public/js/sh_lang/sh_gherkin.js +112 -0
  29. data/public/js/sh_lang/sh_gherkin.min.js +1 -0
  30. data/public/js/sh_lang/sh_ini.js +87 -0
  31. data/public/js/sh_lang/sh_ini.min.js +87 -0
  32. data/public/js/sh_lang/sh_puppet.js +182 -0
  33. data/public/js/sh_lang/sh_puppet.min.js +182 -0
  34. data/public/js/sh_lang/sh_puppet_output.js +22 -0
  35. data/public/js/sh_lang/sh_puppet_output.min.js +22 -0
  36. data/public/js/sh_lang/sh_shell.min.js +1 -0
  37. data/public/js/showoff.js +423 -51
  38. data/views/404.erb +19 -0
  39. data/views/download.erb +36 -0
  40. data/views/header.erb +35 -25
  41. data/views/header_mini.erb +22 -0
  42. data/views/index.erb +46 -1
  43. data/views/onepage.erb +35 -14
  44. data/views/presenter.erb +63 -21
  45. data/views/stats.erb +73 -0
  46. metadata +170 -131
  47. data/public/css/960.css +0 -653
  48. data/public/css/pdf.css +0 -12
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5b74b0bccf334e9ec1cc0d1f63e78920dbb09ac7
4
+ data.tar.gz: 6821752697b1c41013d5723ac3be01b4e6d8a30b
5
+ SHA512:
6
+ metadata.gz: 4fe62f61ad47dcf4718b1c33229d2c10b9367d9ed2f823338876279924506bf441296308f8b8f382823764747d1dfb0121baf6b9fc5307424728a199655b0779
7
+ data.tar.gz: 3756465ce5712780bd916c1eff7f54bcfe47928f6f67bbcaa93fc5c38ff712a392e4997936dd8549efde0ac718d6cb8171226bfd627056f9c22315493dc2f845
data/README.rdoc CHANGED
@@ -5,462 +5,48 @@ presentation. It is sort of like a Keynote web app engine - think S5 +
5
5
  Slidedown. I am using it to do all my talks in 2010, because I have a deep
6
6
  hatred in my heart for Keynote and yet it is by far the best in the field.
7
7
 
8
- The idea is that you setup your markdown slide files in section subdirectories
9
- and then startup the showoff server in that directory. It will read in your
10
- <tt>showoff.json</tt> file for which sections go in which order and then will give
11
- you a URL to present from.
12
-
13
- It can:
14
-
15
- * show simple text
16
- * show images
17
- * show syntax highlighted code
18
- * bullets with incremental advancing
19
- * re-enact command line interactions
20
- * call up a menu of sections/slides at any time to jump around
21
- * execute Javascript, Coffeescript or Ruby live and display results
22
- * do simple transitions (instant, fade, slide in)
23
- * show a pre-show slideshow while you wait to start
24
-
25
- It might will can:
26
-
27
- * show a timer - elapsed / remaining
28
- * perform simple animations of images moving between keyframes
29
- * show synchronized, hidden notes on another browser (like an iphone)
30
- * show audience questions / comments (twitter or direct)
31
- * let audience members go back / catch up as you talk
32
- * let audience members vote on sections (?)
33
- * broadcast itself on Bonjour
34
- * let audience members download slides, code samples or other supplementary material
35
- * let you write on the slide with your mouse, madden-style via canvas
36
- * automatically resize text to fit screen [see Alex's shrink.js]
37
-
38
- Some of the nice things are that you can easily version control it, you
39
- can easily move sections between presentations, and you can rearrange or
40
- remove sections easily.
41
-
42
- = Usage
43
-
44
- ShowOff is meant to be run in a ShowOff formatted repository - that means that
45
- it has a <tt>showoff.json</tt> file and a number of sections (subdirectories) with
46
- markdown files for the slides you're presenting.
47
-
48
- $ gem install showoff
49
- $ git clone (showoff-repo)
50
- $ cd (showoff-repo)
51
- $ showoff serve
52
-
53
- If you run 'showoff' in the example subdirectory of ShowOff itself, it will
54
- show an example presentation, so you can see what it's like.
55
-
56
- You can also run 'showoff serve' inside a section subdirectory. If there is no
57
- <tt>showoff.json</tt> file then it will make its best guess, creating a presentation
58
- from all `.md` files in alphabetical order in the given (or current)
59
- directory.
60
-
61
- = Slide Format
62
-
63
- You can break your slides up into sections of however many subdirectories deep
64
- you need. ShowOff will recursively check all the directories mentioned in
65
- your <tt>showoff.json</tt> file for any markdown files (.md). Each markdown file can
66
- have any number of slides in it, separating each slide with the '!SLIDE'
67
- keyword and optional slide styles.
68
-
69
- For example, if you run 'showoff create my_new_pres' it will create a new
70
- starter presentation for you with one .md file at one/slide.md which will have
71
- the following contents:
72
-
73
- !SLIDE
74
-
75
- # My Presentation #
76
-
77
- !SLIDE bullets incremental transition=fade
78
-
79
- # Bullet Points #
80
-
81
- * first point
82
- * second point
83
- * third point
84
-
85
- That represents two slides, the first contains just a large title, and the
86
- second is faded into view showing the title and three bullets that are then
87
- incrementally shown. In order for ShowOff to see those slides, your
88
- <tt>showoff.json</tt> file needs to look something like this:
89
-
90
- {
91
- "name": "Something",
92
- "description": "Example Presentation",
93
- "sections": [
94
- {"section":"one"}
95
- ]
96
- }
97
-
98
- If you have multiple sections in your talk, you can make this json array
99
- include all the sections you want to show in which order you want to show
100
- them.
101
-
102
- Instead of a hash, you can use a plain string as an entry in the `sections`
103
- section of `showoff.json`.
104
-
105
- And if that plain string starts with '#' then it is interpreted not as a
106
- filename, but as markdown. This is used for inserting interstitial slides
107
- or notes -- for instance, Alex Chaffee's
108
- [Ruby Notes](http://github.com/alexch/ruby_notes)
109
- uses it to insert lab instructions between lecture slide sections, which may
110
- vary from venue to venue.
111
-
112
- If you want to keep the ability to emit an HTML document from your
113
- Markdown source file -- say, for a TextMate preview or a GitHub rendering
114
- -- you can use angle brackets around the `!SLIDE` keyword and styles, e.g.
115
-
116
- <!SLIDE bullets incremental transition=fade>
117
-
118
- Some useful styles for each slide are:
119
-
120
- * center - centers images on a slide
121
- * full-page - allows an image to take up the whole slide
122
- * bullets - sizes and separates bullets properly (fits up to 5, generally)
123
- * smbullets - sizes and separates more bullets (smaller, closer together)
124
- * subsection - creates a different background for titles
125
- * command - monospaces h1 title slides
126
- * commandline - for pasted commandline sections (needs leading '$' for commands, then output on subsequent lines)
127
- * code - monospaces everything on the slide
128
- * incremental - can be used with 'bullets' and 'commandline' styles, will incrementally update elements on arrow key rather than switch slides
129
- * small - make all slide text 80%
130
- * smaller - make all slide text 70%
131
- * execute - on Javascript, Coffeescript and Ruby highlighted code slides, you can click on the code to execute it and display the results on the slide
132
-
133
- Check out the example directory included to see examples of most of these.
134
-
135
- Transitions can be supplied through the use of transition=tname on the !SLIDE
136
- definition, where tname is one of the following supported transitions:
137
-
138
- * blindX
139
- * blindY
140
- * blindZ
141
- * cover
142
- * curtainX
143
- * curtainY
144
- * fade
145
- * fadeZoom
146
- * growX
147
- * growY
148
- * none (this is the default)
149
- * scrollUp
150
- * scrollDown
151
- * scrollLeft
152
- * scrollRight
153
- * scrollHorz
154
- * scrollVert
155
- * shuffle
156
- * slideX
157
- * slideY
158
- * toss
159
- * turnUp
160
- * turnDown
161
- * turnLeft
162
- * turnRight
163
- * uncover
164
- * wipe
165
- * zoom
166
-
167
- The transitions are provided by jQuery Cycle plugin. See http://www.malsup.com/jquery/cycle/browser.html to view the effects and http://www.malsup.com/jquery/cycle/adv2.html for how to add custom effects.
168
-
169
- You can manage the presentation with the following keys:
170
-
171
- * space, cursor right: next slide
172
- * shift-space, cursor left: previous slide
173
- * d: debug mode
174
- * c, t: table of contents (vi)
175
- * f: toggle footer
176
- * z, ?: toggle help
177
- * p: toggle preshow
178
-
179
- = Showing plain old markdown
180
-
181
- If a markdown file has no !SLIDE keywords, then showoff will treat every line
182
- beginning with a single hash -- i.e. every H1 -- as a new slide in "bullets"
183
- style. Remember that you can't specify classes or transitions in this mode,
184
- and as soon as you add one !SLIDE you need them everywhere.
185
-
186
- = Preshow
187
-
188
- If you want to show a slideshow while you wait to speak, you can run a preshow. Add a +_preshow+ directory
189
- to your project (I use a symlink, so I don't have to add all the images into Git), put a bunch of images in the +_preshow+ directory and optionally add a +preshow+.+json+ file that provides descriptions for any of the images.
190
- If you then press 'p' at the beginning of your presentation, it will prompt you for a number of minutes until
191
- you start. Then it will count down the time until then, flipping through your pictures to entertain the
192
- audience in the meantime. Press 'p' again to stop, or wait until the timer runs out.
193
-
194
- = Custom JavaScript
195
-
196
- To insert custom JavaScript into your presentation you can either place it into
197
- a file (with extension .js) into the root directory of your presentation or you
198
- can embed a <+script+> element directly into your slides. This JavaScript will be
199
- executed—as usually—as soon as it is loaded.
200
-
201
- If you want to trigger some JavaScript as soon as a certain page is shown or
202
- when you switch to the next or previous slide, you can bind a callback to a
203
- custom event:
204
-
205
- * *showoff:show* will be triggered as soon as you enter a page
206
- * *showoff:next* will be triggered when you switch to the next page
207
- * *showoff:prev* will be triggered when you switch to the previous page
208
-
209
- These events are triggered on the "div.content" child of the slide, so you must
210
- add a custom and unique class to your SLIDE to identify it:
211
-
212
- !SLIDE custom_and_unique_class
213
- # 1st Example h1
214
- <script>
215
- // bind to custom event
216
- $(".custom_and_unique_class").bind("showoff:show", function (event) {
217
- // animate the h1
218
- var h1 = $(event.target).find("h1");
219
- h1.delay(500)
220
- .slideUp(300, function () { $(this).css({textDecoration: "line-through"}); })
221
- .slideDown(300);
222
- });
223
- </script>
224
-
225
- This will bind an event handler for *showoff:show* to your slide. The
226
- h1-element will be animated, as soon as this event is triggered on that slide.
227
-
228
- If you bind an event handler to the custom events *showoff:next* or
229
- *showoff:prev*, you can prevent the default action (that is switching to the
230
- appropriate slide) by calling *event.preventDefault()*:
231
-
232
- !SLIDE prevent_default
233
- # 2nd Example h1
234
- <script>
235
- $(".prevent_default").bind("showoff:next", function (event) {
236
- var h1 = $(event.target).find("h1");
237
- if (h1.css("text-decoration") === "none") {
238
- event.preventDefault();
239
- h1.css({textDecoration: "line-through"})
240
- }
241
- });
242
- </script>
243
-
244
- This will bind an event handler for *showoff:next* to your slide. When you press
245
- the right arrow key the first time, the h1-element will be decorated. When you
246
- press the right array key another time, you will switch to the next slide.
247
-
248
- The same applies to the *showoff:prev* event, of course.
249
-
250
-
251
- = Custom Stylesheets
252
-
253
- To insert custom Stylesheets into your presentation you can either place it into
254
- a file (with extension .css) into the root directory of your presentation or
255
- you can embed a <+link+> element directly into your slides. This stylesheet will
256
- be applied as soon as it is loaded.
257
-
258
- The content generated by the slide is wrapped with a +div+ with the class .+content+ like this.
259
-
260
- <div ref="intro/01_slide/1" class="content" style="margin-top: 210px;">
261
- <h1>jQuery &amp; Sinatra</h1>
262
- <h2>A Classy Combination</h2>
263
- </div>
264
-
265
- This makes the .+content+ tag a perfect place to add additional styling if that
266
- is your preference. An example of adding some styling is here.
267
-
268
- .content {
269
- color: black;
270
- font-family: helvetica, arial;
271
- }
272
- h1, h2 {
273
- color: rgb(79, 180, 226);
274
- font-family: Georgia;
275
- }
276
- .content::after {
277
- position: absolute;
278
- right: 120px;
279
- bottom: 120px;
280
- content: url(jay_small.png);
281
- }
282
-
283
- Note that the example above uses CSS3 styling with ::+after+ and the +content+
284
- -attribute to add an image to the slides.
285
-
286
- = Language highlighting
287
-
288
- Showoff uses {shjs}[http://shjs.sourceforge.net/] to highlight code blocks.
289
- If you begin a code block with three @-signs followed by a
290
- {programming language name}[http://shjs.sourceforge.net/doc/documentation.html],
291
- that line will be stripped and the rest of the block will become sparkly
292
- and colorful.
293
-
294
- @@@ ruby
295
- 10.times { puts "Whee!" }
296
-
297
- = Custom Ruby Files
298
-
299
- If you want to have executable Ruby code on your slides you must set the
300
- environment variable ENV['SHOWOFF_EVAL_RUBY']. This can be done with
301
-
302
- export SHOWOFF_EVAL_RUBY=1
303
-
304
- or
305
-
306
- # On Heroku
307
- heroku config:add SHOWOFF_EVAL_RUBY=1
308
-
309
-
310
- If you need supporting libraries when you evaluate the code. You can do this by
311
- putting Ruby files (*.rb) into the root directory of the presentation then they
312
- will be required when the presentation loads.
313
-
314
- = Editor integration
315
-
316
- The "add slide" feature can allow you to add the necessary boilerplate from your editor. If you are using vim, you can
317
-
318
- !showoff add -t code Check This Code
319
-
320
- And your buffer will get
321
-
322
- !SLIDE
323
- # Check This Code #
324
- @@@ Ruby
325
- code_here()
326
-
327
- added where your cursor was. Binding this to a keybinding can allow you to add new slides quickly.
328
-
329
- = Command Line Interface
330
-
331
- showoff command_name [command-specific options] [--] arguments...
332
-
333
- * Use the command +help+ to get a summary of commands
334
- * Use the command <tt>help command_name</tt> to get a help for +command_name+
335
- * Use <tt>--</tt> to stop command line argument processing; useful if your arguments have dashes in them
336
-
337
- == Commands
338
- [<tt>add</tt>] Add a new slide at the end in a given dir
339
- [<tt>create</tt>] Create new showoff presentation
340
- [<tt>help</tt>] Shows list of commands or help for one command
341
- [<tt>heroku</tt>] Setup your presentation to serve on Heroku
342
- [<tt>github</tt>] Setup your presentation to serve on GitHub Pages
343
- [<tt>serve</tt>] Serves the showoff presentation in the current directory (or a given dir)
344
- [<tt>static</tt>] Generate static version of presentation
345
-
346
-
347
- == <tt>showoff add [title]</tt>
348
-
349
- Add a new slide at the end in a given dir
350
-
351
- *Aliases*
352
- * <tt><b>new</b></tt>
353
-
354
- Outputs or creates a new slide. With -d and -n, a new slide is created in the given dir, numbered to appear
355
- as the last slide in that dir (use -u to avoid numbering). Without those, outputs the slide markdown to
356
- stdout (useful for shelling out from your editor). You may also specify a source file to use for a code
357
- slide.
358
-
359
- === options for add
360
-
361
- These options are specified *after* the command.
362
-
363
- [<tt>-d, --dir=dir</tt>] Slide dir (where to put a new slide file)
364
- [<tt>-n, --name=basename</tt>] Slide name (name of the new slide file)
365
- [<tt>-s, --source=path to file</tt>] Include code from the given file as the slide body
366
- [<tt>-t, --style, --type=valid showoff style/type</tt>] Slide Type/Style <i>( default: <tt>title</tt>)</i>
367
- [<tt>-u, --nonumber</tt>] Dont number the slide, use the given name verbatim
368
-
369
-
370
- == <tt>showoff create dir_name</tt>
371
-
372
- Create new showoff presentation
373
-
374
- *Aliases*
375
- * <tt><b>init</b></tt>
376
-
377
- This command helps start a new showoff presentation by setting up the proper directory structure for you. It takes the directory name you would like showoff to create for you.
378
-
379
- === options for create
380
-
381
- These options are specified *after* the command.
382
-
383
- [<tt>-d, --slidedir=arg</tt>] sample slide directory name <i>( default: <tt>one</tt>)</i>
384
- [<tt>-n, --nosamples</tt>] Dont create sample slides
385
-
386
-
387
- == <tt>showoff help [command]</tt>
388
-
389
- Shows list of commands or help for one command
390
-
391
-
392
- == <tt>showoff heroku heroku_name</tt>
393
-
394
- Setup your presentation to serve on Heroku
395
-
396
- Creates the Gemfile and config.ru file needed to push a showoff pres to heroku. It will then run heroku create for you to register the new project on heroku and add the remote for you. Then all you need to do is commit the new created files and run git push heroku to deploy.
397
-
398
-
399
- == <tt>showoff github</tt>
400
-
401
- Generates a static version of your site and puts it in a gh-pages branch for static serving on GitHub.
402
-
403
- === options for github
404
- These options are specified *after* the command.
405
-
406
- [<tt>-f, --force</tt>] force overwrite of existing Gemfile/.gems and config.ru files if they exist
407
- [<tt>-g, --dotgems</tt>] Use older-style .gems file instead of bundler-style Gemfile
408
- [<tt>-p, --password=arg</tt>] add password protection to your heroku site
409
-
410
-
411
- == <tt>showoff serve </tt>
412
-
413
- Serves the showoff presentation in the current directory
414
-
415
- ==== options for serve
416
- These options are specified *after* the command.
417
-
418
- [<tt>-f, --pres_file=arg</tt>] Presentation file <i>(default: <tt>showoff.json</tt>)</i>
419
- [<tt>-h, --host=arg</tt>] Host or ip to run on <i>( default: <tt>localhost</tt>)</i>
420
- [<tt>-p, --port=arg</tt>] Port on which to run <i>( default: <tt>9090</tt>)</i>
421
-
422
-
423
- == <tt>showoff static name</tt>
424
-
425
- Generate static version of presentation
426
-
427
- = PDF Output
428
-
429
- Showoff can produce a PDF version of your presentation. To do this, you must install a few things first:
430
-
431
- gem install pdfkit
432
-
433
- You'll then need to install a version of wkhtmltopdf available at the {wkhtmltopdf repo}[http://code.google.com/p/wkhtmltopdf/wiki/compilation] (or brew install wkhtmltopdf on a mac) and make sure that +wkhtmltopdf+ is in your path:
434
-
435
- export $PATH="/location/to/my/wkhtmltopdf/0.9.9:$PATH"
436
-
437
-
438
-
439
- Then restart showoff, and navigate to <tt>/pdf</tt> (e.g. http://localhost/pdf) of your presentation and a PDF will be generated with the browser.
440
-
441
- = Completion
442
-
443
- == ZSH completion
444
- You can complete commands and options in ZSH, by installing a script:
445
-
446
- mkdir -p $HOME/.zsh/Completion
447
- cp script/_showoff $HOME/.zsh/Completion
448
- echo 'fpath=(~/.zsh/Completion $fpath)' >> $HOME/.zshrc
449
-
450
- == <tt>bash</tt> completion
451
-
452
- You can complete commands for showoff by putting the following in your <tt>.bashrc</tt> (or whatever
453
- you use when starting <tt>bash</tt>):
454
-
455
- complete -F get_showoff_commands
456
- function get_showoff_commands()
457
- {
458
- if [ -z $2 ] ; then
459
- COMPREPLY=(`showoff help -c`)
460
- else
461
- COMPREPLY=(`showoff help -c $2`)
462
- fi
463
- }
8
+ Showoff allows you to author your presentation slides in Markdown, then organize
9
+ them with a <tt>showoff.json</tt> file. This file also contains metadata about
10
+ the presentation, such as the title, any password protection, etc.
11
+
12
+ Then you just run <tt>showoff serve</tt> in the presentation directory and open
13
+ a browser window.
14
+
15
+ Showoff's capabilities include:
16
+
17
+ * Display content on slides including:
18
+ * formatted text and images
19
+ * syntax highlighted code
20
+ * bullets with incremental advancing
21
+ * simple slide transitions (instant, fade, slide in)
22
+ * replayed command line interactions
23
+
24
+ * Live presenter tools:
25
+ * presenter view that display notes, tree representation of presentation, and other tools
26
+ * execute Javascript, Coffeescript or Ruby live and display results
27
+ * show a pre-show slideshow while you wait to start
28
+ * let audience members download slides, code samples or other supplementary material
29
+ * show a timer - elapsed / remaining
30
+ * show synchronized, hidden notes on another browser (like an iphone)
31
+
32
+ * Live audience tools:
33
+ * audience can pull up the presentation on their own browsers
34
+ * call up a menu of sections/slides at any time to jump around
35
+ * independent navigation so that audience members can go back / catch up as you talk
36
+ * allow viewers to set their view of the presentation to track the presenter's
37
+ * allow the audience to provide pace feedback and ask questions of the presenter
38
+ * allow the audience to provide contend feedback on the material
39
+
40
+ * Content creation and distribution functionality:
41
+ * generate supplemental material based on slide tags
42
+ * generate printed versions of the presentation including handout notes
43
+ * password protect any URL path to keep control over different views of content
44
+ * Automatically generate a Table of Contents
45
+
46
+ Due to it being plain text, you can easily version control it, you can easily move
47
+ sections between presentations, and you can rearrange or remove sections easily.
48
+
49
+ Please see the documentation in <tt>./documentation</tt> for further information.
464
50
 
465
51
  = Real World Usage
466
52
 
@@ -501,18 +87,13 @@ So far, ShowOff has been used in the following presentations (and many others):
501
87
  http://github.com/alexch/workshop
502
88
  * SDRuby Lightning Talk - Readable Regexps - Ian Young
503
89
  https://github.com/iangreenleaf/sdruby-lightningtalk-tregexp
90
+ * Disney HTML5 Summit 2011 - Polyfills: Shims and Shivs - Josh Dzielak
91
+ https://github.com/dzello/shims_and_shivs
92
+ * All PuppetLabs training from Summer 2012 on and many internal & external presentations
504
93
 
505
94
 
506
95
  If you use it for something, please let me know so I can add it.
507
96
 
508
- = Editor Support
509
-
510
- * TextMate Bundle - Showoff.tmdbundle - Dr Nic Williams
511
- http://github.com/drnic/Showoff.tmbundle
512
-
513
- * Emacs major-mode - showoff-mode - Nick Parker
514
- http://github.com/developernotes/showoff-mode
515
-
516
97
  = Future Plans
517
98
 
518
99
  I really want this to evolve into a dynamic presentation software server,
@@ -524,6 +105,14 @@ talk that was given, or all the available slides, plus supplementary
524
105
  material. And I want the presenter (me) to be able to push each
525
106
  presentation to Heroku or GitHub pages for archiving super easily.
526
107
 
108
+ Potential future capabilities might include:
109
+
110
+ * perform simple animations of images moving between keyframes
111
+ * let audience members vote on sections (?)
112
+ * broadcast itself on Bonjour
113
+ * let you write on the slide with your mouse, madden-style via canvas
114
+ * automatically resize text to fit screen [see Alex's shrink.js]
115
+
527
116
  = Why Not S5 or Slidy or Slidedown?
528
117
 
529
118
  S5 and Slidy are really cool, and I was going to use them, but mainly I wanted
@@ -534,17 +123,6 @@ also like the idea of having interactive presentation system and didn't need
534
123
  half the features of S5/Slidy (style based print view, auto-scaling, themes,
535
124
  etc).
536
125
 
537
- = Requirements
538
-
539
- * Ruby (duh)
540
- * Sinatra (and thus Rack)
541
- * BlueCloth
542
- * Nokogiri
543
- * json
544
- * GLI gem
545
- * Firefox or Chrome to present
546
- * PDFKit (optional, for generating PDF of presentation) https://github.com/jdpace/PDFKit
547
-
548
126
  = Contributing
549
127
 
550
128
  See the CONTRIB.txt file for how to contribute to this project
data/Rakefile CHANGED
@@ -1,27 +1,26 @@
1
- require 'rake/testtask'
2
-
3
- begin
4
- require 'mg'
5
- rescue LoadError
6
- abort "Please `gem install mg`"
1
+ desc "Build HTML documentation"
2
+ task :doc do
3
+ system("rdoc --main README.rdoc README.rdoc documentation/*.rdoc")
7
4
  end
8
5
 
9
- MG.new("showoff.gemspec")
10
-
11
- #
12
- # Tests
13
- #
6
+ desc "Run tests"
7
+ task :test do
8
+ require 'rake/testtask'
14
9
 
15
- task :default => :test
10
+ Rake::TestTask.new do |t|
11
+ t.libs << 'lib'
12
+ t.pattern = 'test/**/*_test.rb'
13
+ t.verbose = false
14
+ end
16
15
 
17
- desc "Run tests"
18
- task :turn do
19
16
  suffix = "-n #{ENV['TEST']}" if ENV['TEST']
20
17
  sh "turn test/*_test.rb #{suffix}"
21
18
  end
22
19
 
23
- Rake::TestTask.new do |t|
24
- t.libs << 'lib'
25
- t.pattern = 'test/**/*_test.rb'
26
- t.verbose = false
20
+ begin
21
+ require 'mg'
22
+ MG.new("showoff.gemspec")
23
+ rescue LoadError
24
+ puts "'gem install mg' to get helper gem publishing tasks. (optional)"
27
25
  end
26
+
data/bin/showoff CHANGED
@@ -2,12 +2,18 @@
2
2
 
3
3
  $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
4
  require 'showoff'
5
+ require 'showoff/version'
5
6
  require 'rubygems'
6
7
  require 'gli'
7
8
 
8
- include GLI
9
+ # Support GLI and GLI2
10
+ if GLI::VERSION.to_f > 1
11
+ include GLI::App
12
+ else
13
+ include GLI
14
+ end
9
15
 
10
- version ShowOff::Version
16
+ version SHOWOFF_VERSION
11
17
 
12
18
  desc 'Create new showoff presentation'
13
19
  arg_name 'dir_name'
@@ -98,8 +104,8 @@ command :serve do |c|
98
104
  c.flag [:p,:port]
99
105
 
100
106
  c.desc 'Host or ip to run on'
101
- c.default_value "localhost"
102
- c.flag [:h,:host]
107
+ c.default_value "0.0.0.0"
108
+ c.flag [:h,:host]
103
109
 
104
110
  c.desc 'JSON file used to describe presentation'
105
111
  c.default_value "showoff.json"
@@ -107,7 +113,14 @@ command :serve do |c|
107
113
 
108
114
  c.action do |global_options,options,args|
109
115
 
110
- url = "http://#{options[:h]}:#{options[:p].to_i}"
116
+ # This is gross. A serious revamp in config file parsing is due.
117
+ config = JSON.parse(File.read(options[:f]))
118
+ if Gem::Version.new(config['version']) > Gem::Version.new(SHOWOFF_VERSION) then
119
+ raise "This presentation requires Showoff version #{config['version']} or greater."
120
+ end
121
+
122
+ host = options[:h] == '0.0.0.0' ? 'localhost' : options[:h]
123
+ url = "http://#{host}:#{options[:p].to_i}"
111
124
  puts "
112
125
  -------------------------
113
126
 
@@ -120,7 +133,12 @@ To run it from presenter view, go to: [ #{url}/presenter ]
120
133
  -------------------------
121
134
 
122
135
  "
123
- ShowOff.run! :host => options[:h], :port => options[:p].to_i, :pres_file => options[:f], :pres_dir => args[0], :verbose => options[:verbose]
136
+ ShowOff.run! :host => options[:h],
137
+ :port => options[:p].to_i,
138
+ :pres_file => options[:f],
139
+ :pres_dir => args[0],
140
+ :verbose => options[:verbose],
141
+ :bind => options[:h]
124
142
  end
125
143
  end
126
144
 
@@ -185,4 +203,8 @@ on_error do |exception|
185
203
  true
186
204
  end
187
205
 
188
- exit GLI.run(ARGV)
206
+ if GLI::VERSION.to_f > 1
207
+ exit run(ARGV)
208
+ else
209
+ exit GLI.run(ARGV)
210
+ end