Skip to content
This repository

pres_dir param and other changes #88

Merged
merged 17 commits into from over 2 years ago

3 participants

Alex Chaffee David Copeland Scott Chacon
Alex Chaffee
Collaborator
alexch commented May 08, 2011

including documentation for new features

Scott Chacon
Owner

I feel stupid - I honestly didn't even know you could do this in markdown.

David Copeland

This will not do what you think. What you want is:

c.desc "Presentation directory"
c.default_value '.'
c.arg_name 'path_to_dir'
c.flag [:pres_dir,:pres-dir] # I like dashes :)
c.action do |global_options,options,args|
  ShowOff.run! :host => options[:h], :port => options[:p].to_i, :pres_dir => options[:pres_dir]
end

What you have works incidentally, but you didn't actually specify a flag named pres_dir so it won't get documented and can't be specified via a command-line option

Collaborator

I didn't want it specified via an option... just as an argument, e.g. "showoff serve foo". It felt right as an argument since we are serving that directory. Is there a reason to make it an option instead? Seemed like just more typing to me.

Also, I figured out CLI better and it up to where it's supposed to be in a later commit: 186bedc#L59R59

I see; I didn't see your later commit. I dunno; my opinion is everything should be an option and that the actual arguments should be reserved for glob-friendly things (which, arguably, don't make sense for showoff anyway, so it's probably moot)

David Copeland

I like this feature, but I'm not sure I would know what it was; what about

c.desc 'JSON file used to drive presentation'

?

Collaborator

sounds good

David Copeland

+1, this is awesome. I have typed :1,$s/^#/<!SLIDE>^V^M/g so many times in vi…

Collaborator

There should also be "showoff slidify" which does that and saves it, but this is good to bootstrap an existing Markdown file. (Suggestions welcome for a better command name :-))

Collaborator

btw, my fork now has code that makes all H1s create a new slide (unless they're the first thing on a slide) --
see c8f9451 and c84e41f
(or wait for me to get around to making a proper pull request)

David Copeland

Most of the CLI documentation is/can be generated. If you run bin/showoff rdoc, it will create showoff.rdoc which is generated docs for all of the command-line arguments and interface. You can just drop that in to replace the existing section and don't have to maintain it by hand.

Alex Chaffee
Collaborator
alexch commented July 20, 2011

ping

plus I've been doing a lot more on my main branch... I'll organize it into branches soon

Scott Chacon schacon merged commit d389688 into from August 08, 2011
Scott Chacon schacon closed this August 08, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
1  .gitignore
@@ -16,6 +16,7 @@ tmtags
16 16
 ## PROJECT::GENERAL
17 17
 coverage
18 18
 rdoc
  19
+doc
19 20
 pkg
20 21
 *.gem
21 22
 .bundle
11  Gemfile
... ...
@@ -1,5 +1,14 @@
1 1
 source :rubygems
2  
-gemspec
  2
+
  3
+gem "sinatra"
  4
+gem "bluecloth"
  5
+gem "nokogiri"
  6
+gem "json"
  7
+gem "gli",">= 1.2.5"
  8
+
  9
+group :development do
  10
+  gem "mg"
  11
+end
3 12
 
4 13
 group :optional do
5 14
   gem "rmagick"
87  README.rdoc
Source Rendered
@@ -7,7 +7,7 @@ hatred in my heart for Keynote and yet it is by far the best in the field.
7 7
 
8 8
 The idea is that you setup your markdown slide files in section subdirectories
9 9
 and then startup the showoff server in that directory.  It will read in your
10  
-showoff.json file for which sections go in which order and then will give
  10
+<tt>showoff.json</tt> file for which sections go in which order and then will give
11 11
 you a URL to present from.
12 12
 
13 13
 It can:
@@ -26,13 +26,14 @@ It might will can:
26 26
 
27 27
 * show a timer - elapsed / remaining
28 28
 * perform simple animations of images moving between keyframes
29  
-* show syncronized, hidden notes on another browser (like an iphone)
  29
+* show synchronized, hidden notes on another browser (like an iphone)
30 30
 * show audience questions / comments (twitter or direct)
31 31
 * let audience members go back / catch up as you talk
32 32
 * let audience members vote on sections (?)
33 33
 * broadcast itself on Bonjour
34 34
 * let audience members download slides, code samples or other supplementary material
35 35
 * let you write on the slide with your mouse, madden-style via canvas
  36
+* automatically resize text to fit screen
36 37
 
37 38
 Some of the nice things are that you can easily version control it, you
38 39
 can easily move sections between presentations, and you can rearrange or
@@ -40,7 +41,9 @@ remove sections easily.
40 41
 
41 42
 = Usage
42 43
 
43  
-ShowOff is meant to be run in a ShowOff formatted repository - that means that it has a showoff.json file and a number of sections (subdirectories) with markdown files for the slides you're presenting.
  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.
44 47
 
45 48
     $ gem install showoff
46 49
     $ git clone (showoff-repo)
@@ -50,11 +53,16 @@ ShowOff is meant to be run in a ShowOff formatted repository - that means that i
50 53
 If you run 'showoff' in the example subdirectory of ShowOff itself, it will 
51 54
 show an example presentation, so you can see what it's like.
52 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
+
53 61
 = Slide Format
54 62
 
55 63
 You can break your slides up into sections of however many subdirectories deep
56 64
 you need.  ShowOff will recursively check all the directories mentioned in
57  
-your showoff.json file for any markdown files (.md).  Each markdown file can
  65
+your <tt>showoff.json</tt> file for any markdown files (.md).  Each markdown file can
58 66
 have any number of slides in it, separating each slide with the '!SLIDE'
59 67
 keyword and optional slide styles.
60 68
 
@@ -77,7 +85,7 @@ the following contents:
77 85
 That represents two slides, the first contains just a large title, and the
78 86
 second is faded into view showing the title and three bullets that are then
79 87
 incrementally shown. In order for ShowOff to see those slides, your
80  
-showoff.json file needs to look something like this:
  88
+<tt>showoff.json</tt> file needs to look something like this:
81 89
 
82 90
     [
83 91
       {"section":"one"}
@@ -147,13 +155,20 @@ The transitions are provided by jQuery Cycle plugin. See http://www.malsup.com/j
147 155
 You can manage the presentation with the following keys:
148 156
 
149 157
 * space, cursor right: next slide
150  
-* cursor left: previous slide
  158
+* shift-space, cursor left: previous slide
151 159
 * d: debug mode
152  
-* c: table of contents (vi)
  160
+* c, t: table of contents (vi)
153 161
 * f: toggle footer
154  
-* z: toggle help
  162
+* z, ?: toggle help
155 163
 * p: toggle preshow
156 164
 
  165
+= Showing plain old markdown
  166
+
  167
+If a markdown file has no !SLIDE keywords, then showoff will treat every line
  168
+beginning with a single hash -- i.e. every H1 -- as a new slide in "bullets"
  169
+style. Remember that you can't specify classes or transitions in this mode,
  170
+and as soon as you add one !SLIDE you need them everywhere.
  171
+
157 172
 = Preshow
158 173
 
159 174
 If you want to show a slideshow while you wait to speak, you can run a preshow.  Add a +_preshow+ directory
@@ -166,7 +181,7 @@ audience in the meantime.  Press 'p' again to stop, or wait until the timer runs
166 181
 
167 182
 To insert custom JavaScript into your presentation you can either place it into
168 183
 a file (with extension .js) into the root directory of your presentation or you
169  
-can embed a <script>-element directly into your slides. This JavaScript will be
  184
+can embed a <+script+> element directly into your slides. This JavaScript will be
170 185
 executed—as usually—as soon as it is loaded.
171 186
 
172 187
 If you want to trigger some JavaScript as soon as a certain page is shown or
@@ -223,7 +238,7 @@ The same applies to the *showoff:prev* event, of course.
223 238
 
224 239
 To insert custom Stylesheets into your presentation you can either place it into
225 240
 a file (with extension .css) into the root directory of your presentation or
226  
-you can embed a <+link+>-element directly into your slides. This stylesheet will
  241
+you can embed a <+link+> element directly into your slides. This stylesheet will
227 242
 be applied as soon as it is loaded.
228 243
 
229 244
 The content generated by the slide is wrapped with a +div+ with the class .+content+ like this.
@@ -311,19 +326,24 @@ added where your cursor was.  Binding this to a keybinding can allow you to add
311 326
 [<tt>help</tt>] Shows list of commands or help for one command
312 327
 [<tt>heroku</tt>] Setup your presentation to serve on Heroku
313 328
 [<tt>github</tt>] Setup your presentation to serve on GitHub Pages
314  
-[<tt>serve</tt>] Serves the showoff presentation in the current directory
  329
+[<tt>serve</tt>] Serves the showoff presentation in the current directory (or a given dir)
315 330
 [<tt>static</tt>] Generate static version of presentation
316 331
 
317  
-=== <tt>add [title]</tt>
  332
+
  333
+== <tt>showoff add [title]</tt>
318 334
 
319 335
 Add a new slide at the end in a given dir
320 336
 
321 337
 *Aliases*
322 338
 * <tt><b>new</b></tt>
323 339
 
324  
-Outputs or creates a new slide.  With -d and -n, a new slide is created in the given dir, numbered to appear as the last slide in that dir (use -u to avoid numbering).  Without those, outputs the slide markdown to stdout (useful for shelling out from your editor). You may also specify a source file to use for a code slide
  340
+Outputs or creates a new slide. With -d and -n, a new slide is created in the given dir, numbered to appear
  341
+as the last slide in that dir (use -u to avoid numbering). Without those, outputs the slide markdown to
  342
+stdout (useful for shelling out from your editor). You may also specify a source file to use for a code
  343
+slide.
  344
+
  345
+=== options for add
325 346
 
326  
-==== Options
327 347
 These options are specified *after* the command.
328 348
 
329 349
 [<tt>-d, --dir=dir</tt>] Slide dir (where to put a new slide file)
@@ -331,7 +351,9 @@ These options are specified *after* the command.
331 351
 [<tt>-s, --source=path to file</tt>] Include code from the given file as the slide body
332 352
 [<tt>-t, --style, --type=valid showoff style/type</tt>] Slide Type/Style <i>( default: <tt>title</tt>)</i>
333 353
 [<tt>-u, --nonumber</tt>] Dont number the slide, use the given name verbatim
334  
-=== <tt>create dir_name</tt>
  354
+
  355
+
  356
+== <tt>showoff create dir_name</tt>
335 357
 
336 358
 Create new showoff presentation
337 359
 
@@ -340,57 +362,68 @@ Create new showoff presentation
340 362
 
341 363
 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.
342 364
 
343  
-==== Options
  365
+=== options for create
  366
+
344 367
 These options are specified *after* the command.
345 368
 
346 369
 [<tt>-d, --slidedir=arg</tt>] sample slide directory name <i>( default: <tt>one</tt>)</i>
347 370
 [<tt>-n, --nosamples</tt>] Dont create sample slides
348  
-=== <tt>help [command]</tt>
  371
+
  372
+
  373
+== <tt>showoff help [command]</tt>
349 374
 
350 375
 Shows list of commands or help for one command
351 376
 
352  
-=== <tt>heroku heroku_name</tt>
  377
+
  378
+== <tt>showoff heroku heroku_name</tt>
353 379
 
354 380
 Setup your presentation to serve on Heroku
355 381
 
356 382
 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.
357 383
 
358  
-=== <tt>github</tt>
  384
+
  385
+== <tt>showoff github</tt>
359 386
 
360 387
 Generates a static version of your site and puts it in a gh-pages branch for static serving on GitHub.
361 388
 
362  
-==== Options
  389
+=== options for github
363 390
 These options are specified *after* the command.
364 391
 
365 392
 [<tt>-f, --force</tt>] force overwrite of existing Gemfile/.gems and config.ru files if they exist
366 393
 [<tt>-g, --dotgems</tt>] Use older-style .gems file instead of bundler-style Gemfile
367 394
 [<tt>-p, --password=arg</tt>] add password protection to your heroku site
368  
-=== <tt>serve </tt>
369 395
 
370  
-Serves the showoff presentation in the current directory
371 396
 
  397
+== <tt>showoff serve </tt>
372 398
 
  399
+Serves the showoff presentation in the current directory
373 400
 
374  
-==== Options
  401
+==== options for serve
375 402
 These options are specified *after* the command.
376 403
 
  404
+[<tt>-f, --pres_file=arg</tt>] Presentation file <i>(default: <tt>showoff.json</tt>)</i>
377 405
 [<tt>-h, --host=arg</tt>] Host or ip to run on <i>( default: <tt>localhost</tt>)</i>
378 406
 [<tt>-p, --port=arg</tt>] Port on which to run <i>( default: <tt>9090</tt>)</i>
379  
-=== <tt>static name</tt>
  407
+
  408
+
  409
+== <tt>showoff static name</tt>
380 410
 
381 411
 Generate static version of presentation
382 412
 
383  
-=== PDF
  413
+
  414
+= PDF
384 415
 Append a "/pdf" to the end of your presentation URL, and a PDF will be generated within the browser. For example,
385 416
 http://localhost:9090/pdf
386 417
 
387  
-=== ZSH completion
  418
+
  419
+= ZSH completion
388 420
 You can complete commands and options in ZSH, by installing a script:
389 421
 
390 422
     mkdir -p $HOME/.zsh/Completion
391 423
     cp script/_showoff $HOME/.zsh/Completion
392 424
     echo 'fpath=(~/.zsh/Completion $fpath)' >> $HOME/.zshrc
393 425
 
  426
+
394 427
 = Real World Usage
395 428
 
396 429
 So far, ShowOff has been used in the following presentations (and many others):
@@ -424,6 +457,8 @@ So far, ShowOff has been used in the following presentations (and many others):
424 457
   http://github.com/nono/Presentations/tree/master/20100703_25_promising_projects_in_50_minutes/
425 458
 * 11th Libre Software Meeting 2010 - Ruby 1.9, The future of Ruby? - Bruno Michel
426 459
   http://github.com/nono/Presentations/tree/master/20100708_RMLL_Ruby_1.9/
  460
+* Railsbridge Open Workshops - Sarah Allen, Sarah Mei, and Alex Chaffee
  461
+  http://github.com/alexch/workshop
427 462
 
428 463
 
429 464
 If you use it for something, please let me know so I can add it.
2  TODO.txt
@@ -13,3 +13,5 @@ TODO
13 13
   - questions / comments system
14 14
   - audience vote-based presentation builder, results live view
15 15
 - simple animations (image from A to B)
  16
+- squeeze-to-fit style
  17
+- extract Version into a separate file, so we can include it in gemspec without pulling in the universe
12  bin/showoff
@@ -56,7 +56,9 @@ command :heroku do |c|
56 56
   end
57 57
 end
58 58
 
59  
-desc 'Serves the showoff presentation in the current directory'
  59
+desc 'Serves the showoff presentation in the specified (or current) directory'
  60
+arg_name "[pres_dir]"
  61
+default_value "."
60 62
 command :serve do |c|
61 63
 
62 64
   c.desc 'Port on which to run'
@@ -65,10 +67,14 @@ command :serve do |c|
65 67
 
66 68
   c.desc 'Host or ip to run on'
67 69
   c.default_value "localhost"
68  
-  c.flag [:h,:host]
  70
+  c.flag [:h,:host]  
  71
+
  72
+  c.desc 'JSON file used to describe presentation'
  73
+  c.default_value "showoff.json"
  74
+  c.flag [:f, :pres_file]
69 75
 
70 76
   c.action do |global_options,options,args|
71  
-    ShowOff.run! :host => options[:h], :port => options[:p].to_i
  77
+    ShowOff.run! :host => options[:h], :port => options[:p].to_i, :pres_file => options[:f], :pres_dir => args[0]
72 78
   end
73 79
 end
74 80
 
14  example/one/slidesA.md
Source Rendered
@@ -14,6 +14,20 @@
14 14
 * a fourth thing
15 15
 * a fifth thing
16 16
 
  17
+<!SLIDE bullets>
  18
+# Third Slide
  19
+
  20
+* Sometimes bullet items
  21
+  * Have sublists
  22
+  * And some sublist items
  23
+    * Have some of their own
  24
+    * And so on
  25
+* But top-level "bullet items" have no bullets
  26
+  * isn't that odd?
  27
+
  28
+Also, sometimes you just want to have plain text sitting in the middle
  29
+of the screen. The quick brown fox jumps over the lazy dog.
  30
+
17 31
 !SLIDE center transition=scrollUp
18 32
 .notes another dark side
19 33
 
27  lib/showoff.rb
@@ -31,26 +31,30 @@
31 31
 
32 32
 class ShowOff < Sinatra::Application
33 33
 
34  
-  Version = VERSION = '0.4.2'
  34
+  Version = VERSION = '0.5.0'
35 35
 
36 36
   attr_reader :cached_image_size
37 37
 
38 38
   set :views, File.dirname(__FILE__) + '/../views'
39 39
   set :public, File.dirname(__FILE__) + '/../public'
40  
-  set :pres_dir, 'example'
41 40
 
42 41
   def initialize(app=nil)
43 42
     super(app)
44  
-    puts dir = File.expand_path(File.join(File.dirname(__FILE__), '..'))
45  
-    if Dir.pwd == dir
46  
-      options.pres_dir = dir + '/example'
  43
+    showoff_dir = File.expand_path(File.join(File.dirname(__FILE__), '..'))
  44
+    if Dir.pwd == showoff_dir
  45
+      options.pres_dir = "#{showoff_dir}/example"
47 46
       @root_path = "."
48 47
     else
49  
-      options.pres_dir = Dir.pwd
  48
+      options.pres_dir ||= Dir.pwd
50 49
       @root_path = ".."
51 50
     end
  51
+    options.pres_dir = File.expand_path(options.pres_dir)
  52
+    if (options.pres_file)
  53
+      puts "Using #{options.pres_file}"
  54
+      ShowOffUtils.presentation_config_file = options.pres_file
  55
+    end
  56
+    puts "Serving presentation from #{options.pres_dir}"
52 57
     @cached_image_size = {}
53  
-    puts options.pres_dir
54 58
     @pres_name = options.pres_dir.split('/').pop
55 59
     require_ruby_files
56 60
   end
@@ -81,6 +85,12 @@ def preshow_files
81 85
     end
82 86
 
83 87
     def process_markdown(name, content, static=false, pdf=false)
  88
+
  89
+      # if there are no !SLIDE markers, then make every H1 define a new slide
  90
+      unless content =~ /^\<?!SLIDE/m
  91
+        content = content.gsub(/^# /m, "<!SLIDE bullets>\n# ")
  92
+      end
  93
+
84 94
       slides = content.split(/^<?!SLIDE/)
85 95
       slides.delete('')
86 96
       final = ''
@@ -101,9 +111,6 @@ def process_markdown(name, content, static=false, pdf=false)
101 111
         # extract id, defaulting to none
102 112
         id = nil
103 113
         content_classes.delete_if { |x| x =~ /^#([\w-]+)/ && id = $1 }
104  
-        puts "id: #{id}" if id
105  
-        puts "classes: #{content_classes.inspect}"
106  
-        puts "transition: #{transition}"
107 114
         # create html
108 115
         md += "<div"
109 116
         md += " id=\"#{id}\"" if id
26  lib/showoff_utils.rb
... ...
@@ -1,5 +1,11 @@
1 1
 class ShowOffUtils
2  
-  SHOWOFF_JSON_FILE = 'showoff.json'
  2
+  def self.presentation_config_file
  3
+    @presentation_config_file ||= 'showoff.json'
  4
+  end
  5
+
  6
+  def self.presentation_config_file=(filename)
  7
+    @presentation_config_file = filename
  8
+  end
3 9
 
4 10
   def self.create(dirname,create_samples,dir='one')
5 11
     Dir.mkdir(dirname) if !File.exists?(dirname)
@@ -16,14 +22,14 @@ def self.create(dirname,create_samples,dir='one')
16 22
       end
17 23
 
18 24
       # create showoff.json
19  
-      File.open(SHOWOFF_JSON_FILE, 'w+') do |f|
  25
+      File.open(ShowOffUtils.presentation_config_file, 'w+') do |f|
20 26
         f.puts "{ \"name\": \"My Preso\", \"sections\": [ {\"section\":\"#{dir}\"} ]}"
21 27
       end
22 28
 
23 29
       if create_samples
24 30
         puts "done. run 'showoff serve' in #{dirname}/ dir to see slideshow"
25 31
       else
26  
-        puts "done. add slides, modify #{SHOWOFF_JSON_FILE} and then run 'showoff serve' in #{dirname}/ dir to see slideshow"
  32
+        puts "done. add slides, modify #{ShowOffUtils.presentation_config_file} and then run 'showoff serve' in #{dirname}/ dir to see slideshow"
27 33
       end
28 34
     end
29 35
   end
@@ -39,7 +45,7 @@ def self.create(dirname,create_samples,dir='one')
39 45
   # password     - String containing password to protect your heroku site; nil means no password protection
40 46
   # use_dot_gems - boolea that, if true, indicates we should use the old, deprecated .gems file instead of Bundler
41 47
   def self.heroku(name,force,password,use_dot_gems)
42  
-    if !File.exists?(SHOWOFF_JSON_FILE)
  48
+    if !File.exists?(ShowOffUtils.presentation_config_file)
43 49
       puts "fail. not a showoff directory"
44 50
       return false
45 51
     end
@@ -181,12 +187,12 @@ def self.add_new_dir(dir)
181 187
     puts "Creating #{dir}..."
182 188
     Dir.mkdir dir
183 189
 
184  
-    showoff_json = JSON.parse(File.read(SHOWOFF_JSON_FILE))
  190
+    showoff_json = JSON.parse(File.read(ShowOffUtils.presentation_config_file))
185 191
     showoff_json["section"] = dir
186  
-    File.open(SHOWOFF_JSON_FILE,'w') do |file|
  192
+    File.open(ShowOffUtils.presentation_config_file,'w') do |file|
187 193
       file.puts JSON.generate(showoff_json)
188 194
     end
189  
-    puts "#{SHOWOFF_JSON_FILE} updated"
  195
+    puts "#{ShowOffUtils.presentation_config_file} updated"
190 196
   end
191 197
 
192 198
   def self.blank?(string)
@@ -275,7 +281,7 @@ def self.read_code(source_file)
275 281
   end
276 282
 
277 283
   def self.showoff_sections(dir = '.')
278  
-    index = File.join(dir, ShowOffUtils::SHOWOFF_JSON_FILE )
  284
+    index = File.join(dir, ShowOffUtils.presentation_config_file)
279 285
     order = nil
280 286
     if File.exists?(index)
281 287
       data = JSON.parse(File.read(index))
@@ -286,12 +292,14 @@ def self.showoff_sections(dir = '.')
286 292
         order = data
287 293
       end
288 294
       order = order.map { |s| s['section'] }
  295
+    else
  296
+      order = ["."] # if there's no showoff.json file, make a boring one
289 297
     end
290 298
     order
291 299
   end
292 300
 
293 301
   def self.showoff_title(dir = '.')
294  
-    index = File.join(dir, ShowOffUtils::SHOWOFF_JSON_FILE )
  302
+    index = File.join(dir, ShowOffUtils.presentation_config_file )
295 303
     order = nil
296 304
     if File.exists?(index)
297 305
       data = JSON.parse(File.read(index))
43  public/css/showoff.css
... ...
@@ -1,5 +1,6 @@
1 1
 @media screen {
2 2
   body {
  3
+			font-size: 100%;
3 4
       font-family: "Gill Sans", Helvetica, Arial, sans-serif;
4 5
       background:#333;
5 6
       overflow:hidden;
@@ -85,6 +86,13 @@
85 86
   }
86 87
 }
87 88
 
  89
+/* plain (non-bullet) text */
  90
+.content > p {
  91
+	font-size: 2em;
  92
+  margin: 1em;
  93
+	text-align: center;
  94
+}
  95
+
88 96
 .center img {
89 97
     display:block;
90 98
     margin-left:auto;
@@ -99,22 +107,31 @@
99 107
   vertical-align: middle;
100 108
 }
101 109
 
102  
-.bullets ul {
103  
-    font-size: 3em;
  110
+.bullets > ul {
  111
+	font-size: 3em;
104 112
 }
105  
-.bullets ul li {
  113
+.bullets > ul > li {
106 114
     text-align: center;
107 115
     padding: 25px;
108 116
 }
109 117
 
110  
-.smbullets ul {
111  
-    font-size: 2em;
  118
+.smbullets > ul {
  119
+    font-size: 2.5em;
112 120
 }
113  
-.smbullets ul li {
  121
+.smbullets > ul > li {
114 122
     text-align: center;
115 123
     padding: 10px;
116 124
 }
117 125
 
  126
+/* nested lists get their bullets back */
  127
+.bullets ul ul {
  128
+  list-style: disc;
  129
+  margin: 10px 100px;
  130
+  padding-left: 40px;
  131
+  text-align: left;
  132
+}
  133
+.bullets ul ul > li { font-size: 80%; }
  134
+
118 135
 .commandline pre {
119 136
     font-size: 2em;
120 137
 }
@@ -138,9 +155,10 @@
138 155
     font-family: monospace;
139 156
 }
140 157
 
141  
-.subsection {
  158
+.subsection h1 {
142 159
     background: #008;
143 160
     color: #fff;
  161
+	padding: .25em;
144 162
 }
145 163
 
146 164
 .small {
@@ -151,13 +169,10 @@
151 169
     font-size: 70%;
152 170
 }
153 171
 
154  
-h1 { font-size: 5em; font-weight: normal; text-align: center;}
155  
-h2 { font-size: 3em; font-weight: normal; text-align: center; }
156  
-h3 { font-size: 2em; font-weight: normal; text-align: center; }
157  
-
158  
-h1, h2, h3 {
159  
-  margin: 0.5em 0;
160  
-}
  172
+h1,h2,h3 { font-weight: normal; text-align: center; margin: 0.5em 0; }
  173
+h1 { font-size: 5em; }
  174
+h2 { font-size: 3em; }
  175
+h3 { font-size: 2em; }
161 176
 
162 177
 pre { margin-left: 40px; font-size: 2.8em; }
163 178
 
0  public/js/fg.menu.js 100755 → 100644
File mode changed
16  public/js/showoff.js
@@ -326,7 +326,7 @@ function keyDown(event)
326 326
 		return true;
327 327
 	}
328 328
 
329  
-	if (key == 13){
  329
+	if (key == 13) {
330 330
 		if (gotoSlidenum > 0) {
331 331
 			debug('go to ' + gotoSlidenum);
332 332
 			slidenum = gotoSlidenum - 1;
@@ -351,10 +351,14 @@ function keyDown(event)
351 351
 	{
352 352
 		shiftKeyActive = true;
353 353
 	}
  354
+
354 355
 	if (key == 32) // space bar
355 356
 	{
356  
-		if (shiftKeyActive) { prevStep() }
357  
-		else				{ nextStep() }
  357
+		if (shiftKeyActive) {
  358
+			prevStep()
  359
+		} else {
  360
+			nextStep()
  361
+		}
358 362
 	}
359 363
 	else if (key == 68) // 'd' for debug
360 364
 	{
@@ -380,7 +384,7 @@ function keyDown(event)
380 384
 	{
381 385
 		$('#navmenu').toggle().trigger('click')
382 386
 	}
383  
-	else if (key == 90) // z for help
  387
+	else if (key == 90 || key == 191) // z or ? for help
384 388
 	{
385 389
 		$('#help').toggle()
386 390
 	}
@@ -515,7 +519,7 @@ var preshow_timerRunning = false;
515 519
 var preshow_current = 0;
516 520
 var preshow_images;
517 521
 var preshow_imagesTotal = 0;
518  
-var preshow_des;
  522
+var preshow_des = null;
519 523
 
520 524
 function runPreShow() {
521 525
 	if(preshow_running) {
@@ -571,7 +575,7 @@ function startPreShow() {
571 575
 function addPreShowTips() {
572 576
 	time = secondsToTime(preshow_secondsLeft)
573 577
 	$('#preshow_timer').text(time + ' to go-time')
574  
-	var des = preshow_des[tmpImg.attr("ref")]
  578
+	var des = preshow_des && preshow_des[tmpImg.attr("ref")]
575 579
 	if(des) {
576 580
 		$('#tips').show()
577 581
 		$('#tips').text(des)
10  views/index.erb
@@ -50,14 +50,16 @@
50 50
 
51 51
 <div id="help">
52 52
   <table>
  53
+    <tr><td class="key">z, ?</td><td>toggle help (this)</td></tr>
53 54
     <tr><td class="key">space, &rarr;</td><td>next slide</td></tr>
54  
-    <tr><td class="key">&larr;</td><td>previous slide</td></tr>
55  
-    <tr><td class="key">d</td><td>debug mode</td></tr>
  55
+    <tr><td class="key">shift-space, &larr;</td><td>previous slide</td></tr>
  56
+    <tr><td class="key">d</td><td>toggle debug mode</td></tr>
56 57
     <tr><td class="key">## &lt;ret&gt;</td><td>go to slide #</td></tr>
57  
-    <tr><td class="key">c</td><td>table of contents (vi)</td></tr>
  58
+    <tr><td class="key">c, t</td><td>table of contents (vi)</td></tr>
58 59
     <tr><td class="key">f</td><td>toggle footer</td></tr>
59 60
     <tr><td class="key">r</td><td>reload slides</td></tr>
60  
-    <tr><td class="key">z</td><td>toggle help (this)</td></tr>
  61
+    <tr><td class="key">n</td><td>toggle notes</td></tr>
  62
+    <tr><td class="key">p</td><td>run preshow</td></tr>
61 63
   </table>
62 64
 </div>
63 65
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.