parade 0.9.2 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +15 -0
  2. data/README.md +77 -53
  3. data/bin/parade +3 -2
  4. data/lib/parade/commands/html_output.rb +1 -0
  5. data/lib/parade/commands/static_html.rb +1 -1
  6. data/lib/parade/helpers/template_generator.rb +13 -12
  7. data/lib/parade/parsers/dsl.rb +8 -0
  8. data/lib/parade/renderers/update_image_paths.rb +20 -17
  9. data/lib/parade/section.rb +13 -2
  10. data/lib/parade/server.rb +24 -11
  11. data/lib/parade/slide.rb +2 -3
  12. data/lib/parade/slide_post_renderers.rb +2 -0
  13. data/lib/parade/version.rb +1 -1
  14. data/lib/public/css/960.css +1 -1
  15. data/lib/public/css/fg.menu.css +37 -11
  16. data/lib/public/css/{theme → jquery-ui}/images/ui-bg_diagonals-small_100_f0efea_40x40.png +0 -0
  17. data/lib/public/css/{theme → jquery-ui}/images/ui-bg_flat_35_f0f0f0_40x100.png +0 -0
  18. data/lib/public/css/{theme → jquery-ui}/images/ui-bg_glass_55_fcf0ba_1x400.png +0 -0
  19. data/lib/public/css/{theme → jquery-ui}/images/ui-bg_glow-ball_25_2e2e28_600x600.png +0 -0
  20. data/lib/public/css/{theme → jquery-ui}/images/ui-bg_highlight-soft_100_f0efea_1x100.png +0 -0
  21. data/lib/public/css/{theme → jquery-ui}/images/ui-bg_highlight-soft_25_327E04_1x100.png +0 -0
  22. data/lib/public/css/{theme → jquery-ui}/images/ui-bg_highlight-soft_25_5A9D1A_1x100.png +0 -0
  23. data/lib/public/css/{theme → jquery-ui}/images/ui-bg_highlight-soft_95_ffedad_1x100.png +0 -0
  24. data/lib/public/css/{theme → jquery-ui}/images/ui-bg_inset-soft_22_3b3b35_1x100.png +0 -0
  25. data/lib/public/css/{theme → jquery-ui}/images/ui-icons_808080_256x240.png +0 -0
  26. data/lib/public/css/{theme → jquery-ui}/images/ui-icons_8DC262_256x240.png +0 -0
  27. data/lib/public/css/{theme → jquery-ui}/images/ui-icons_cd0a0a_256x240.png +0 -0
  28. data/lib/public/css/{theme → jquery-ui}/images/ui-icons_e7e6e4_256x240.png +0 -0
  29. data/lib/public/css/{theme → jquery-ui}/images/ui-icons_eeeeee_256x240.png +0 -0
  30. data/lib/public/css/{theme → jquery-ui}/images/ui-icons_ffffff_256x240.png +0 -0
  31. data/lib/public/css/{theme → jquery-ui}/ui.accordion.css +0 -0
  32. data/lib/public/css/{theme → jquery-ui}/ui.all.css +0 -0
  33. data/lib/public/css/{theme → jquery-ui}/ui.base.css +0 -0
  34. data/lib/public/css/{theme → jquery-ui}/ui.core.css +0 -0
  35. data/lib/public/css/{theme → jquery-ui}/ui.datepicker.css +0 -0
  36. data/lib/public/css/{theme → jquery-ui}/ui.dialog.css +0 -0
  37. data/lib/public/css/{theme → jquery-ui}/ui.progressbar.css +0 -0
  38. data/lib/public/css/{theme → jquery-ui}/ui.resizable.css +0 -0
  39. data/lib/public/css/{theme → jquery-ui}/ui.slider.css +0 -0
  40. data/lib/public/css/{theme → jquery-ui}/ui.tabs.css +0 -0
  41. data/lib/public/css/{theme → jquery-ui}/ui.theme.css +0 -0
  42. data/lib/public/css/mobile.css +179 -0
  43. data/lib/public/css/print.css +16 -0
  44. data/lib/public/css/slide_formats.css +188 -0
  45. data/lib/public/css/themes/archetect.css +19 -217
  46. data/lib/public/css/themes/default.css +86 -0
  47. data/lib/public/css/themes/hack.css +51 -277
  48. data/lib/public/css/themes/merlot.css +20 -375
  49. data/lib/public/css/themes/slate.css +19 -184
  50. data/lib/public/js/hammer.js +1330 -0
  51. data/lib/public/js/parade-mobile.js +4 -0
  52. data/lib/public/js/parade.js +32 -34
  53. data/lib/views/footer.erb +5 -0
  54. data/lib/views/header.erb +12 -10
  55. data/lib/views/help.erb +18 -0
  56. data/lib/views/index.erb +6 -33
  57. data/lib/views/navigation.erb +10 -0
  58. data/lib/views/pdf.erb +8 -2
  59. data/lib/views/{onepage.erb → print.erb} +8 -2
  60. metadata +67 -68
  61. data/lib/public/css/onepage.css +0 -62
  62. data/lib/public/css/parade.css +0 -448
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NjNhNWQwYjM4NjFkMmVmMTRiY2MyZTJiMjIwZjQ2OWJiYjcxNmNmYg==
5
+ data.tar.gz: !binary |-
6
+ MTBkM2E3OTA5NmY0ODBhMGM3NDViZjk0M2NlYmNjNTA5ODQ1NGY4NA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ Y2M5MjcyYTg4OWQyNDQ1MmNkNGJlZGNlNTljMTM0NDUwMTU5YWVmODFiNTA4
10
+ ZTlhNGMwZWJlOTcwNzI1NDQ5OGMxZjM4OGRjOTc2OWEyZjQwYmQ4NzllMzlj
11
+ NTljMmRjOTA3YzhjMGQ4MGM2ZWQwMDg5YTE5MTZiNDNkYmE2ZjA=
12
+ data.tar.gz: !binary |-
13
+ OGE1Yjg2ZDgzNmVjZTVhZWU3OTBkNzY1YmU5NTQ3ZWE3ODhhNzhkZDc5MDlj
14
+ ODIzZWJiNGE4ZTc3YjFmYjYwZDdhMTc5MDU1M2U4YTk3NGRjOGFmN2E0M2I3
15
+ OTViNmY2MmYwYjE5NDc0MjA0MTcxODk3NmFjNTA5OWExNDlhMjg=
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Parade Presentation Software
2
2
 
3
- Parade is a Sinatra web app that reads serves up markdown files in a
4
- presentation format. Parade can serve a directory or be configured to run with
5
- a simple configuration file.
3
+ Parade is an open source presentation software that consists of a Sinatra web
4
+ app that serves up markdown files in a presentation format. Parade can serve a
5
+ directory or be configured to run with a simple configuration file.
6
6
 
7
7
  ## Comparison Vs PowerPoint / Keynote
8
8
 
@@ -10,7 +10,7 @@ Parade is easily out-done by professional presentation software packages as
10
10
  far as out-of-the-box style and design. However, there are benefits that
11
11
  Parade has over presentational software:
12
12
 
13
- ### The Good
13
+ ### Highlights
14
14
 
15
15
  * Markdown backed data
16
16
 
@@ -21,34 +21,34 @@ Parade has over presentational software:
21
21
  * Syntax Highlighting
22
22
 
23
23
  > Using GitHub flavored markdown, code fences will automatically be
24
- syntax highlighted making it incredibly easy to integrate code samples
24
+ syntax highlighted, making it incredibly easy to integrate code samples.
25
25
 
26
26
  * Code Execution
27
27
 
28
- > Slides are able to provide execution and show results for JavaScript,
29
- and Coffeescript live within the browser. Allowing for live
28
+ > Slides are able to provide execution and show results for JavaScript
29
+ and Coffeescript live within the browser. This allows for live
30
30
  demonstrations of code.
31
31
 
32
32
  * Web
33
33
 
34
- > The system is simply a website which allows for a lot of possibilities
34
+ >Slide presentations are basically websites -- they run in your browser from your desktop. This allows for a wide range of possibilities for customization and expandability.
35
35
 
36
- ### The Ugly
36
+ * Basic Templating and Color Schemes
37
37
 
38
- * Lack of style
38
+ > Several templates and color scheme options have been provided to help you get started. While Parade does not currently provide anything near the variety of many other presentation packages, it is well-suited for basic presentations.
39
39
 
40
- > Most presentation packages are going to provide for you better templates
40
+ * Design Flexibility (pros and cons)
41
41
 
42
- * Speed of Layout and Animation
42
+ > Unless you're skilled in CSS/Animations, you will likely have a harder
43
+ time creating presentations with as much polish as other programs provide. However, this approach also makes Parade incredibly flexible if you do understand CSS/Animations.
43
44
 
44
- > Unless you're skills are great with CSS/Animations, you are likely going
45
- to have a harder time creating presentations with as much polish.
45
+
46
+ ### Works In Progress
46
47
 
47
48
  * Resizing
48
49
 
49
- > Currently the presentation system can change gradual sizes, but is not
50
- very capable of growing well to the full resolution of current presentation
51
- resolution.
50
+ > Currently, the presentation system can change gradual sizes, but does not
51
+ have true full screen mode.
52
52
 
53
53
  # Installation and Usage
54
54
 
@@ -62,9 +62,9 @@ $ gem install parade
62
62
  $ parade
63
63
  ```
64
64
 
65
- By default running parade with start a presentation from the current working
66
- directory. It will find all markdown files, `**/*.md`, within the directory
67
- and create a presentation out of them.
65
+ By default, running parade starts a presentation from the current working
66
+ directory. It finds all markdown files, `**/*.md`, within the directory
67
+ and creates a presentation out of them.
68
68
 
69
69
  > By default parade will split slides along lines that start with a single `#`
70
70
 
@@ -73,16 +73,16 @@ and create a presentation out of them.
73
73
 
74
74
  You can manage the presentation with the following keys:
75
75
 
76
- > ### *space* or *cursor right*
76
+ > ### *space* or *cursor right* or *cursor down*
77
77
  >
78
78
  > Advance to the next slide or advance the next incremental bullet point
79
79
  or show the end result of the code execution.
80
80
  >
81
- > ### *shift-space* or *cursor left*
81
+ > ### *shift-space* or *cursor left* or *cursor up*
82
82
  >
83
83
  > Move to the previous slide
84
84
  >
85
- > ### *z* or *?*
85
+ > ### *h* or *?*
86
86
  >
87
87
  > Toggle help
88
88
  >
@@ -90,18 +90,14 @@ or show the end result of the code execution.
90
90
  >
91
91
  > Toggle footer (which shows slide count of total slides, percentage)
92
92
  >
93
- > ### *d*
94
- >
95
- > Toggle DEBUG information
96
- >
97
93
  > ### *c* or *t*
98
94
  >
99
95
  > Toggle the display of the Table of Contents
100
96
  >
101
- > ### *p*
97
+ > ### Visit "http://localhost:9090/print"
98
+ >
99
+ > Visiting this URL will generate a single page presentation that is printable
102
100
  >
103
- > Toggle pre-show
104
-
105
101
 
106
102
  ### Serving a specific directory
107
103
 
@@ -109,12 +105,12 @@ or show the end result of the code execution.
109
105
  $ parade [directory]
110
106
  ```
111
107
 
112
- This will start a presentation from the specified directory. Again, finding all
108
+ This will start a presentation from the specified directory, finding all
113
109
  markdown files contained within the directories or sub-directories.
114
110
 
115
111
  ### Serving specific files
116
112
 
117
- To include certain files, specify an order, duplicate slides, you will need to
113
+ To include certain files, specify an order, or duplicate slides, you will need to
118
114
  define a `parade` file. Within that file, you may define specific files,
119
115
  specific folders, and the order of the presentation.
120
116
 
@@ -124,12 +120,12 @@ slides "intro.md"
124
120
  section "directory_name"
125
121
  ```
126
122
 
127
- > **slides** and **section** are exactly the same, however you may choose to
128
- use one over the other depending of you are mentioning a specific file of
123
+ > **slides** and **section** are exactly the same. However, you may choose to
124
+ use one over the other depending on if you are mentioning a specific file of
129
125
  slides or a directory which could contain another `parade` or be considered
130
126
  a section.
131
127
 
132
- You can so define sub sections with a title and slides or additional sections.
128
+ You can also define sub-sections with a title and slides or additional sections.
133
129
 
134
130
  ```ruby
135
131
 
@@ -152,12 +148,12 @@ end
152
148
 
153
149
  ### Separator: **#**
154
150
 
155
- Slides are simply markdown format. As stated previously, slides will be
156
- separated along the `#`elements within your document.
151
+ Slides are simply markdown format. Slides will be separated along
152
+ the `#`elements within your document.
157
153
 
158
154
  ### Separator: !SLIDE
159
155
 
160
- Relying on the `#` as a separator is not always ideal. So you may alternatively
156
+ Relying on the `#` as a separator is not always ideal. Alternatively, you can
161
157
  use the `!SLIDE` separator. This also provides you with the ability to define
162
158
  additional metadata with your slides and presentation.
163
159
 
@@ -261,25 +257,28 @@ All remaining single terms are added as css classes to the slide's `div`.
261
257
 
262
258
  Parade defines a number of special CSS classes:
263
259
 
260
+ > ### title
261
+ > places the content closer to the center of the page
262
+ >
264
263
  > ### center
265
264
  > centers images on a slide
266
265
  >
267
- > ### full-page
268
- > allows an image to take up the whole slide
266
+ > ### title-and-content
267
+ > places the title at the top and the content is left-aligned below it.
268
+ >
269
+ > ### section-header
270
+ > similar to a `title` class except it is a litle further down the page.
269
271
  >
270
272
  > ### bullets
271
273
  > sizes and separates bullets properly (fits up to 5, generally)
272
274
  >
273
- > ### columns
275
+ > ### columns / comparison
274
276
  >
275
277
  > creates columns for every `##` markdown element in your slides (up to 4)
276
278
  >
277
279
  > ### smbullets
278
280
  > sizes and separates more bullets (smaller, closer together)
279
281
  >
280
- > ### subsection
281
- > creates a different background for titles
282
- >
283
282
  > ### command
284
283
  > monospaces h1 title slides
285
284
  >
@@ -287,22 +286,21 @@ Parade defines a number of special CSS classes:
287
286
  > for pasted commandline sections (needs leading '$' for commands, then
288
287
  > output on subsequent lines)
289
288
  >
290
- > ### code
291
- > monospaces everything on the slide
292
- >
293
289
  > ### incremental
294
290
  > can be used with 'bullets' and 'commandline' styles, will incrementally
295
291
  > update elements on arrow key rather than switch slides
296
292
  >
297
- > ### small
298
- > make all slide text 80%
299
- >
300
- > ### smaller
301
- > make all slide text 70%
293
+ > ### text-size-(percentage)
294
+ > make all slide text size from 70% up to 150%, by percent increments of
295
+ > ten. E.G.: text-size-150, text-size-120, text-size-90, text-size-70.
302
296
  >
303
297
  > ### execute
304
298
  > on Javascript and Coffeescript highlighted code slides, you can
305
299
  > click on the code to execute it and display the results on the slide
300
+ >
301
+ > ### blank
302
+ > a slide without content is removed unless you specify that the slide is
303
+ > blank.
306
304
 
307
305
 
308
306
  # Presentation Customization
@@ -330,6 +328,32 @@ end
330
328
  * merlot
331
329
  * slate
332
330
 
331
+ ### Customized Footer
332
+
333
+ The presentation has the following default footer:
334
+
335
+ ```html
336
+ <div id="footer">
337
+ <span id="slideInfo"></span>
338
+ <span id="debugInfo"></span>
339
+ <span id="notesInfo"></span>
340
+ </div>
341
+ ```
342
+
343
+ You can override the default footer of the presentation by specifying a file path to a customized footer.
344
+
345
+ ```ruby
346
+ title "My Presentation"
347
+
348
+ footer "custom_footer.erb"
349
+
350
+ section "Introduction" do
351
+ slides "intro.md"
352
+ end
353
+ ```
354
+
355
+ This example will load a file named `customer_footer.erb` within your presentation directory.
356
+
333
357
  ## Loading Custom CSS and JavaScript
334
358
 
335
359
  By default Parade will load most CSS and JavaScript it finds within the the
@@ -508,7 +532,7 @@ Shows list of commands or help for one command
508
532
 
509
533
  Create new parade presentation
510
534
 
511
- This command helps start a new parade presentation by setting up the proper directory structure for you. It takes the directory name you would like parade to create for you.
535
+ This command helps start a new parade presentation by setting up the proper directory structure for you. It takes the directory name you would like Parade to create for you.
512
536
 
513
537
  > ### Options
514
538
  >
data/bin/parade CHANGED
@@ -54,9 +54,10 @@ command [:s,:serve,:server] do |c|
54
54
  puts "
55
55
  -------------------------
56
56
 
57
- yourr Parade presentation is now starting up.
57
+ Your Parade presentation is now starting up.
58
58
 
59
- To view it plainly, visit [ #{url} ]
59
+ To view it visit [ #{url} ]
60
+ To view a printable version [ #{url}/print ]
60
61
 
61
62
  -------------------------
62
63
 
@@ -36,6 +36,7 @@ module Parade
36
36
 
37
37
  template_options = { 'erb_template_file' => File.join(default_view_path, "#{options['template']}.erb"),
38
38
  'custom_asset_path' => root_path,
39
+ 'presentation' => root_node,
39
40
  'slides' => root_node.to_html }
40
41
 
41
42
  render_template template_options
@@ -16,7 +16,7 @@ module Parade
16
16
  end
17
17
 
18
18
  def generate(options)
19
- options.merge!('template' => 'onepage')
19
+ options.merge!('template' => 'print')
20
20
 
21
21
  html_generator = HtmlOutput.new
22
22
  html_content = html_generator.generate(options)
@@ -28,8 +28,8 @@ module Parade
28
28
  #
29
29
  # @param [String] filepath the filepath to the javascript file
30
30
  # @return [String] HTML content that is inlined javascript data
31
- def js(filepath)
32
- js_template(filepath).render
31
+ def js(*filepaths)
32
+ filepaths.map {|filepath| js_template(filepath).render }.join("\n")
33
33
  end
34
34
 
35
35
  #
@@ -38,8 +38,8 @@ module Parade
38
38
  # @param [String] filepath the filepath to the stylesheet file
39
39
  # @return [String] HTML content that is inlined stylesheet data
40
40
  #
41
- def css(filepath)
42
- css_template(filepath).render
41
+ def css(*filepaths)
42
+ filepaths.map {|filepath| css_template(filepath).render }.join("\n")
43
43
  end
44
44
 
45
45
  def custom_css_files
@@ -50,12 +50,12 @@ module Parade
50
50
  end
51
51
  end
52
52
 
53
- def custom_js_files
54
- if custom_asset_path
55
- Dir.glob("#{custom_asset_path}**/*.js").map do |path|
56
- js_template(path).render
57
- end.join("\n")
58
- end
53
+ #
54
+ # This helper method is called within the header to return the theme specified
55
+ # by the preseation
56
+ #
57
+ def theme_css
58
+ css("themes/#{presentation.theme}.css") if presentation.theme
59
59
  end
60
60
 
61
61
  #
@@ -78,14 +78,15 @@ module Parade
78
78
  template_file = ERB.new File.read(erb_template_file)
79
79
  template_file.result(binding)
80
80
  end
81
+
81
82
  end
82
83
 
83
84
  #
84
85
  # Generate inline CSS assets. Using CssParser it is able to traverse imports
85
86
  # to ensure all CSS is inlined within the document.
86
- #
87
+ #
87
88
  # Also embeds all images contained within the CSS into the inlined CSS.
88
- #
89
+ #
89
90
  class CSSTemplateGenerator < TemplateGenerator
90
91
  include Helpers::EncodeImage
91
92
 
@@ -101,6 +101,14 @@ module Parade
101
101
  current_section.theme = theme_name
102
102
  end
103
103
 
104
+ #
105
+ # Sets the current sections footer to the specified template file
106
+ # @note this will only work at the top level section of the presentation
107
+ #
108
+ def footer(footer_name)
109
+ current_section.footer = File.join(options[:current_path], footer_name)
110
+ end
111
+
104
112
  def pause_message(message)
105
113
  current_section.pause_message = message
106
114
  end
@@ -26,47 +26,50 @@ module Parade
26
26
  end
27
27
 
28
28
  def render(content,options = {})
29
+ # puts "UpdateImagePaths: #{options}"
29
30
  render_root_path = options[:root_path] || root_path || "."
30
31
 
31
32
  content.gsub(/img src=["'](?!https?:\/\/)\/?([^\/].*?)["']/) do |image_source|
32
33
  image_name = Regexp.last_match(1)
33
-
34
+
34
35
  html_image_path = File.join("/","image",image_name)
35
36
  updated_image_source = %{img src="#{html_image_path}"}
36
37
 
37
38
  html_asset_path = File.join(render_root_path,image_name)
38
- width, height = get_image_size(html_asset_path)
39
+ width, height = get_image_size(html_asset_path,options)
39
40
  updated_image_source << %( width="#{width}" height="#{height}") if width and height
40
41
 
41
42
  updated_image_source
42
43
  end
43
44
  end
44
45
 
45
- def get_image_size(path) ; end
46
+ def get_image_size(path,options={}) ; end
46
47
 
47
48
  if defined?(Magick)
48
49
 
49
- def get_image_size(path)
50
- unless cached_image_size.key?(path)
50
+ def get_image_size(path,options={})
51
+ image = Magick::Image.ping(path).first
52
+ # image = Magick::Image.read(path).first
53
+ # # don't set a size for svgs so they can expand to fit their container
54
+ if image.mime_type == 'image/svg+xml'
55
+ [nil, nil]
56
+ else
51
57
 
52
- image = Magick::Image.ping(path).first
58
+ final_width = image.columns
59
+ final_height = image.rows
53
60
 
54
- # # don't set a size for svgs so they can expand to fit their container
55
- if image.mime_type == 'image/svg+xml'
56
- cached_image_size[path] = [nil, nil]
57
- else
58
- cached_image_size[path] = [image.columns, image.rows]
61
+ if !options[:width].nil? && image.columns.to_i > options[:width].to_i
62
+ final_width = (options[:width].to_f - 100) / image.columns * image.columns
59
63
  end
60
64
 
61
- end
62
- cached_image_size[path]
63
- end
65
+ if !options[:height].nil? && image.rows.to_i > options[:height].to_i
66
+ final_height = (options[:height].to_f - 100) / image.rows * image.rows
67
+ end
64
68
 
65
- def cached_image_size
66
- @cached_image_size ||= {}
69
+ [final_width, final_height]
70
+ end
67
71
  end
68
72
 
69
-
70
73
  end
71
74
 
72
75
  end