parade 0.9.2 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -145,6 +145,17 @@ module Parade
145
145
  ""
146
146
  end
147
147
 
148
+ attr_writer :footer
149
+
150
+ def footer
151
+ footer_erb = ERB.new File.read(@footer || default_footer)
152
+ footer_erb.result(binding)
153
+ end
154
+
155
+ def default_footer
156
+ File.join(File.dirname(__FILE__), "..", "views", "footer.erb")
157
+ end
158
+
148
159
  def resources
149
160
  @resources || []
150
161
  end
@@ -183,10 +194,10 @@ module Parade
183
194
  end
184
195
 
185
196
  # @return [String] HTML representation of the section
186
- def to_html
197
+ def to_html(options = {})
187
198
  slides.map do |section_or_slide|
188
199
  post_renderers.inject(section_or_slide.to_html) do |content,renderer|
189
- renderer.render(content)
200
+ renderer.render(content,options)
190
201
  end
191
202
  end.join("\n")
192
203
  end
@@ -94,15 +94,19 @@ module Parade
94
94
  #
95
95
  # A shortcut to define a CSS resource file within a view template
96
96
  #
97
- def css(filepath)
98
- %{<link rel="stylesheet" href="#{File.join "css", filepath}" type="text/css"/>}
97
+ def css(*filepaths)
98
+ filepaths.map do |filepath|
99
+ %{<link rel="stylesheet" href="#{File.join "css", filepath}" type="text/css"/>}
100
+ end.join("\n")
99
101
  end
100
102
 
101
103
  #
102
104
  # A shortcut to define a Javascript resource file within a view template
103
105
  #
104
- def js(filepath)
105
- %{<script type="text/javascript" src="#{File.join "js", filepath}"></script>}
106
+ def js(*filepaths)
107
+ filepaths.map do |filepath|
108
+ %{<script type="text/javascript" src="#{File.join "js", filepath}"></script>}
109
+ end.join("\n")
106
110
  end
107
111
 
108
112
  def custom_resource(resource_extension)
@@ -126,7 +130,8 @@ module Parade
126
130
 
127
131
  def plugin_css_files
128
132
  self.class.plugin_stylesheet_files.map do |path|
129
- "<style>\n#{File.read(path)}\n</style>"
133
+ content = File.read(path)
134
+ erb :inline_css, locals: { content: content }
130
135
  end.join("\n")
131
136
  end
132
137
 
@@ -140,7 +145,8 @@ module Parade
140
145
 
141
146
  def plugin_js_files
142
147
  self.class.plugin_javascript_files.map do |path|
143
- "<script type='text/javascript'>#{File.read(path)}</script>"
148
+ content = File.read(path)
149
+ erb :inline_js, locals: { content: content }
144
150
  end.join("\n")
145
151
  end
146
152
 
@@ -166,8 +172,12 @@ module Parade
166
172
  presentation.title
167
173
  end
168
174
 
169
- def slides
170
- presentation.to_html
175
+ def slides(options = {})
176
+ presentation.to_html(options)
177
+ end
178
+
179
+ def footer
180
+ presentation.footer
171
181
  end
172
182
 
173
183
  def pause_message
@@ -188,16 +198,19 @@ module Parade
188
198
  # The request for slides is used by the client-side javascript presentation
189
199
  # and returns all the slides HTML.
190
200
  #
201
+ # A hash of params may contain:
202
+ # * height - the current height of the window
203
+ # * width - the current width of the window
191
204
  get "/slides" do
192
- slides
205
+ slides(params)
193
206
  end
194
207
 
195
208
  get "/" do
196
209
  erb :index
197
210
  end
198
211
 
199
- get "/onepage" do
200
- erb :onepage
212
+ get "/print" do
213
+ erb :print
201
214
  end
202
215
 
203
216
  end
@@ -54,10 +54,9 @@ module Parade
54
54
  end
55
55
 
56
56
  #
57
- # @return [Boolean] true if the slide has no content and false if the slide
58
- # has content.
57
+ # @return [Boolean] true if the slide has no content and not intentionly marked blank.
59
58
  def empty?
60
- @content.to_s.strip == ""
59
+ @content.to_s.strip == "" && !content_classes.include?('blank')
61
60
  end
62
61
 
63
62
  #
@@ -20,5 +20,7 @@ module Parade
20
20
  SlidePostRenderers.register Renderers::CommandLineRenderer
21
21
  SlidePostRenderers.register Renderers::ColumnsRenderer.new(css_class: 'columns',
22
22
  html_element: "h2", segments: 12)
23
+ SlidePostRenderers.register Renderers::ColumnsRenderer.new(css_class: 'comparison',
24
+ html_element: "h2", segments: 12)
23
25
 
24
26
  end
@@ -1,3 +1,3 @@
1
1
  module Parade
2
- VERSION = '0.9.2'
2
+ VERSION = '0.10.0'
3
3
  end
@@ -16,7 +16,6 @@
16
16
  body {
17
17
  min-width: 960px;
18
18
  }
19
-
20
19
  /* `Container
21
20
  ----------------------------------------------------------------------------------------------------*/
22
21
 
@@ -27,6 +26,7 @@ body {
27
26
  width: 960px;
28
27
  }
29
28
 
29
+
30
30
  /* `Grid >> Global
31
31
  ----------------------------------------------------------------------------------------------------*/
32
32
 
@@ -3,10 +3,36 @@ Author: Maggie Wachs, maggie@filamentgroup.com
3
3
  Date: September 2008
4
4
  */
5
5
 
6
+ /* REQUIRED STYLES - the menus will only render correctly with these rules */
6
7
 
7
- /* REQUIRED STYLES - the menus will only render correctly with these rules */
8
+ .fg-button {
9
+ clear:left;
10
+ margin:0 4px 40px 20px;
11
+ padding: .4em 1em;
12
+ text-decoration:none !important;
13
+ cursor:pointer;
14
+ position: relative;
15
+ text-align: center;
16
+ zoom: 1;
17
+ }
8
18
 
9
- .fg-menu-container { position: absolute; top:0; left:-999px; padding: .4em; overflow: hidden; }
19
+ .fg-button .ui-icon {
20
+ position: absolute;
21
+ top: 50%;
22
+ margin-top: -8px;
23
+ left: 50%;
24
+ margin-left: -8px;
25
+ }
26
+
27
+ a.fg-button { float:left; }
28
+
29
+ .fg-button-icon-right { padding-right: 2.1em; }
30
+
31
+ .fg-button-icon-right .ui-icon { left: auto; right: .2em; margin-left: 0; }
32
+
33
+ .fg-button.ui-state-loading .ui-icon { background: url(spinner_bar.gif) no-repeat 0 0; }
34
+
35
+ .fg-menu-container { z-index: 2147483647; position: absolute; top:0; left:-999px; padding: .4em; overflow: hidden; }
10
36
  .fg-menu-container.fg-menu-flyout { overflow: visible; }
11
37
 
12
38
  .fg-menu, .fg-menu ul { list-style-type:none; padding: 0; margin:0; }
@@ -17,13 +43,13 @@ Date: September 2008
17
43
  .fg-menu ul { position:absolute; top:0; }
18
44
  .fg-menu ul ul { top:-1px; }
19
45
 
20
- .fg-menu-container.fg-menu-ipod .fg-menu-content,
46
+ .fg-menu-container.fg-menu-ipod .fg-menu-content,
21
47
  .fg-menu-container.fg-menu-ipod .fg-menu-content ul { background: none !important; }
22
48
 
23
49
  .fg-menu.fg-menu-scroll,
24
50
  .fg-menu ul.fg-menu-scroll { overflow: scroll; overflow-x: hidden; }
25
51
 
26
- .fg-menu li { clear:both; float:left; width:100%; margin: 0; padding:0; border: 0; }
52
+ .fg-menu li { clear:both; float:left; width:100%; margin: 0; padding:0; border: 0; }
27
53
  .fg-menu li li { font-size:1em; } /* inner li font size must be reset so that they don't blow up */
28
54
 
29
55
  .fg-menu-flyout ul ul { padding: .4em; }
@@ -41,7 +67,7 @@ Date: September 2008
41
67
  .fg-menu-breadcrumb li.fg-menu-current-crumb { clear: left; float: none; opacity: 1; }
42
68
  .fg-menu-breadcrumb li.fg-menu-current-crumb { padding-top: .2em; }
43
69
 
44
- .fg-menu-breadcrumb a,
70
+ .fg-menu-breadcrumb a,
45
71
  .fg-menu-breadcrumb span { float: left; }
46
72
 
47
73
  .fg-menu-footer a:link,
@@ -55,10 +81,10 @@ Date: September 2008
55
81
  .fg-menu-breadcrumb .fg-menu-prev-list a:visited,
56
82
  .fg-menu-breadcrumb .fg-menu-prev-list a:hover,
57
83
  .fg-menu-breadcrumb .fg-menu-prev-list a:active { background-image: none; text-decoration:none; }
58
-
84
+
59
85
  .fg-menu-breadcrumb .fg-menu-prev-list a { float: left; padding-right: .4em; }
60
86
  .fg-menu-breadcrumb .fg-menu-prev-list a .ui-icon { float: left; }
61
-
87
+
62
88
  .fg-menu-breadcrumb .fg-menu-current-crumb a:link,
63
89
  .fg-menu-breadcrumb .fg-menu-current-crumb a:visited,
64
90
  .fg-menu-breadcrumb .fg-menu-current-crumb a:hover,
@@ -66,7 +92,7 @@ Date: September 2008
66
92
 
67
93
 
68
94
 
69
- /* REQUIRED LINK STYLES: links are "display:block" by default; if the menu options are split into
95
+ /* REQUIRED LINK STYLES: links are "display:block" by default; if the menu options are split into
70
96
  selectable node links and 'next' links, the script floats the node links left and floats the 'next' links to the right */
71
97
 
72
98
  .fg-menu a:link,
@@ -92,12 +118,12 @@ Date: September 2008
92
118
  .fg-menu a span { display:block; cursor:pointer; }
93
119
 
94
120
 
95
- /* SUGGESTED STYLES - for use with jQuery UI Themeroller CSS */
96
-
121
+ /* SUGGESTED STYLES - for use with jQuery UI Themeroller CSS */
122
+
97
123
  .fg-menu-indicator span { float:left; }
98
124
  .fg-menu-indicator span.ui-icon { float:right; }
99
125
 
100
- .fg-menu-content.ui-widget-content,
126
+ .fg-menu-content.ui-widget-content,
101
127
  .fg-menu-content ul.ui-widget-content { border:0; }
102
128
 
103
129
 
@@ -0,0 +1,179 @@
1
+
2
+ /* iPad Landscape */
3
+ @media all and (device-width: 768px) and (device-height: 1024px) and (orientation:landscape) {
4
+ body { width: 1024px; height: 675px; }
5
+ #preso, .slide { width: 1024px; height: 675px; }
6
+ #footer { width: 1005px; }
7
+
8
+ pre.highlight pre, pre.highlight, pre {
9
+ font-size: 20px;
10
+ line-height: 20px;
11
+ }
12
+ }
13
+
14
+ /* iPad Portrait */
15
+ @media all and (device-width: 768px) and (device-height: 1024px) and (orientation:portrait) {
16
+ body { min-width: 768px; }
17
+ #preso, .slide { height: 720px; width: 768px; }
18
+ #footer { width: 755px; }
19
+ h1 { font-size: 3em; }
20
+ h2 { font-size: 2em; }
21
+ h3 { font-size: 1em; }
22
+
23
+ .content > p { font-size: 1.4em; }
24
+ .content ol { font-size: 1.5em; }
25
+ .content > ul { font-size: 2em; }
26
+ .bullets > ul { font-size: 2em; }
27
+ .smbullets > ul { font-size: 1.5em; }
28
+
29
+ .content.columns .grid_12 p, .content.comparison .grid_12 p {
30
+ font-size: 125%;
31
+ }
32
+
33
+ .content.columns .grid_6 p, .content.comparison .grid_6 p {
34
+ font-size: 100%;
35
+ }
36
+
37
+ .content.columns .grid_4 p, .content.comparison .grid_4 p {
38
+ font-size: 75%;
39
+ }
40
+
41
+ pre.highlight pre, pre.highlight, pre {
42
+ font-size: 16px;
43
+ line-height: 16px;
44
+ }
45
+ }
46
+
47
+ /* iPhone Portrait and Landscape */
48
+ @media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
49
+ h1 { font-size: 1em; }
50
+ h2 { font-size: 0.75em; }
51
+ h3 { font-size: 0.5em; }
52
+
53
+ .content > p { font-size: 0.7em; }
54
+ .content ol { font-size: 0.8em; }
55
+ .content > ul { font-size: 1em; }
56
+ .bullets > ul { font-size: 1em; }
57
+ .smbullets > ul { font-size: 0.8em; }
58
+
59
+ .title { padding-top: 5%; }
60
+ .section-header { padding-top: 12%; }
61
+ .content > blockquote { font-size: 100%; }
62
+
63
+ .content.columns .grid_12 p, .content.comparison .grid_12 p {
64
+ font-size: 100%;
65
+ }
66
+
67
+ .content.columns .grid_6 p, .content.comparison .grid_6 p {
68
+ font-size: 75%;
69
+ }
70
+
71
+ .content.columns .grid_4 p, .content.comparison .grid_4 p {
72
+ font-size: 50%;
73
+ }
74
+
75
+ .bullets > ul > li { padding: 5px; }
76
+ .smbullets > ul > li { padding: 5px; }
77
+
78
+ pre.highlight pre, pre.highlight, pre {
79
+ font-size: 12px;
80
+ line-height: 12px;
81
+ }
82
+ }
83
+
84
+ /* iPhone Portrait */
85
+ @media screen and (max-width: 320px) and (orientation:portrait) {
86
+ body { min-width: 320px; }
87
+ #preso, .slide { height: 300px; width: 320px; }
88
+ #preso {
89
+ margin: 0;
90
+ padding: 0;
91
+ width: 320px;
92
+ max-height: 356px;
93
+ margin-left:auto;
94
+ margin-right:auto;
95
+ }
96
+
97
+ #footer {
98
+ background: #eee;
99
+ margin: 0;
100
+ padding: 2px;
101
+ width: 300px;
102
+ height: 20px;
103
+ margin-left:auto;
104
+ margin-right:auto;
105
+ }
106
+
107
+ .slide .center {
108
+ height: 300px;
109
+ width: 320px;
110
+ display: table-cell;
111
+ text-align: center;
112
+ vertical-align: middle;
113
+ }
114
+
115
+ }
116
+
117
+ /* iPhone Landscape */
118
+ @media screen and (max-width: 480px) and (orientation:landscape) {
119
+ body { min-width: 480px; min-height: 300px; height: 320px; }
120
+ #preso, .slide { height: 300px; width: 480px; }
121
+ #preso {
122
+ margin: 0;
123
+ padding: 0;
124
+ height: 320px;
125
+ width: 480px;
126
+ margin-left:auto;
127
+ margin-right:auto;
128
+ }
129
+ #footer {
130
+ background: #eee;
131
+ margin: 0;
132
+ padding: 2px;
133
+ width: 470px;
134
+ height: 20px;
135
+ margin-left:auto;
136
+ margin-right:auto;
137
+ }
138
+
139
+ .slide .center {
140
+ height: 320px;
141
+ width: 480px;
142
+ display: table-cell;
143
+ text-align: center;
144
+ vertical-align: middle;
145
+ }
146
+ }
147
+
148
+
149
+ /* 960 Layout Overrides for Mobile Devices */
150
+
151
+ /* Overrides for iPad and devices */
152
+
153
+ @media all and (device-width: 768px) and (device-height: 1024px) and (orientation:portrait) {
154
+ .container_12 { width: 768px;}
155
+ .container_12 .grid_12 { width: 752px; }
156
+ .container_12 .grid_6 { width: 360px; }
157
+ .container_12 .grid_4 { width: 236px; }
158
+ .container_12 .grid_3 { width: 172px; }
159
+ }
160
+
161
+ /* Overrides for iPhone and devices */
162
+
163
+ @media only screen and (min-device-width : 320px) and (max-device-width : 480px) and (orientation:landscape) {
164
+ .container_12 { width: 480px; }
165
+ .container_12 .grid_12 { width: 480px; }
166
+ .container_12 .grid_6 { width: 220px; }
167
+ .container_12 .grid_4 { width: 140px; }
168
+ .container_12 .grid_3 { width: 100px; }
169
+
170
+ }
171
+
172
+ @media only screen and (min-device-width : 320px) and (max-device-width : 480px) and (orientation:portrait) {
173
+ .container_12 { width: 320px; }
174
+ .container_12 .grid_12 { width: 320px; }
175
+ .container_12 .grid_6 { width: 140px; }
176
+ .container_12 .grid_4 { width: 86px; }
177
+ .container_12 .grid_3 { width: 60px; }
178
+
179
+ }