middleman-presentation-core 0.16.0.alpha

Sign up to get free protection for your applications and to get access to all the features.
Files changed (223) hide show
  1. checksums.yaml +7 -0
  2. data/.rdebugrc +7 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +52 -0
  5. data/.simplecov +25 -0
  6. data/.yardopts +5 -0
  7. data/Guardfile +13 -0
  8. data/LICENSE.software +21 -0
  9. data/Rakefile +200 -0
  10. data/config/license_finder.yml +13 -0
  11. data/cucumber.yml +2 -0
  12. data/doc/licenses/dependencies.csv +55 -0
  13. data/doc/licenses/dependencies.db +0 -0
  14. data/doc/licenses/dependencies.html +1415 -0
  15. data/doc/licenses/dependencies.md +603 -0
  16. data/doc/licenses/dependencies_detailed.csv +190 -0
  17. data/doc/yard/.keep +0 -0
  18. data/features/build_presentation.feature +62 -0
  19. data/features/code_highlighting.feature +43 -0
  20. data/features/components.feature +29 -0
  21. data/features/create_plugin-cli.feature +11 -0
  22. data/features/create_presentation-cli.feature +349 -0
  23. data/features/create_slide-cli.feature +188 -0
  24. data/features/create_slides-templates-cli.feature +114 -0
  25. data/features/create_theme-cli.feature +58 -0
  26. data/features/default_slides.feature +58 -0
  27. data/features/edit_slide-cli.feature +121 -0
  28. data/features/export_presentation-cli.feature +23 -0
  29. data/features/grouping_slides.feature +150 -0
  30. data/features/ignore_slides.feature +103 -0
  31. data/features/init_application-cli.feature +59 -0
  32. data/features/init_predefined_slides.feature +9 -0
  33. data/features/language_detection.feature +0 -0
  34. data/features/list_assets-cli.feature +13 -0
  35. data/features/list_components-cli.feature +13 -0
  36. data/features/list_helpers-cli.feature +13 -0
  37. data/features/list_plugins-cli.feature +13 -0
  38. data/features/list_styles-cli.feature +17 -0
  39. data/features/plugins.feature +63 -0
  40. data/features/presentation.feature +57 -0
  41. data/features/rename_slide-cli.feature +176 -0
  42. data/features/render_slides.feature +76 -0
  43. data/features/show_config-cli.feature +25 -0
  44. data/features/show_footer.feature +14 -0
  45. data/features/show_slide_number.feature +31 -0
  46. data/features/show_support_information-cli.feature +12 -0
  47. data/features/support/aruba.rb +18 -0
  48. data/features/support/ci.rb +3 -0
  49. data/features/support/env.rb +25 -0
  50. data/features/support/fixtures.rb +21 -0
  51. data/features/support/hash.rb +2 -0
  52. data/features/support/reporting.rb +2 -0
  53. data/features/version_number.feature +15 -0
  54. data/fixtures/middleman-presentation-simple_plugin/Rakefile +1 -0
  55. data/fixtures/middleman-presentation-simple_plugin/lib/middleman-presentation-plugin.rb +0 -0
  56. data/fixtures/middleman-presentation-simple_plugin/lib/middleman-presentation-simple_plugin/helpers.rb +13 -0
  57. data/fixtures/middleman-presentation-simple_plugin/lib/middleman-presentation-simple_plugin/plugin.rb +34 -0
  58. data/fixtures/middleman-presentation-simple_plugin/lib/middleman-presentation-simple_plugin/version.rb +8 -0
  59. data/fixtures/middleman-presentation-simple_plugin/lib/middleman-presentation-simple_plugin.rb +11 -0
  60. data/fixtures/middleman-presentation-simple_plugin/middleman-presentation-simple_plugin.gemspec +22 -0
  61. data/fixtures/middleman-presentation-simple_plugin/vendor/assets/stylesheets/test_simple.scss +3 -0
  62. data/lib/middleman-presentation-core/application_config.rb +198 -0
  63. data/lib/middleman-presentation-core/asset.rb +103 -0
  64. data/lib/middleman-presentation-core/asset_component.rb +34 -0
  65. data/lib/middleman-presentation-core/asset_list.rb +84 -0
  66. data/lib/middleman-presentation-core/asset_store.rb +73 -0
  67. data/lib/middleman-presentation-core/assets_loader.rb +95 -0
  68. data/lib/middleman-presentation-core/assets_manager.rb +73 -0
  69. data/lib/middleman-presentation-core/cache.rb +49 -0
  70. data/lib/middleman-presentation-core/cli/base.rb +30 -0
  71. data/lib/middleman-presentation-core/cli/base_group.rb +11 -0
  72. data/lib/middleman-presentation-core/cli/build.rb +13 -0
  73. data/lib/middleman-presentation-core/cli/build_presentation.rb +57 -0
  74. data/lib/middleman-presentation-core/cli/change.rb +13 -0
  75. data/lib/middleman-presentation-core/cli/change_slide.rb +82 -0
  76. data/lib/middleman-presentation-core/cli/create.rb +16 -0
  77. data/lib/middleman-presentation-core/cli/create_plugin.rb +62 -0
  78. data/lib/middleman-presentation-core/cli/create_presentation.rb +300 -0
  79. data/lib/middleman-presentation-core/cli/create_slide.rb +52 -0
  80. data/lib/middleman-presentation-core/cli/create_theme.rb +81 -0
  81. data/lib/middleman-presentation-core/cli/edit.rb +13 -0
  82. data/lib/middleman-presentation-core/cli/edit_slide.rb +49 -0
  83. data/lib/middleman-presentation-core/cli/export.rb +11 -0
  84. data/lib/middleman-presentation-core/cli/export_presentation.rb +55 -0
  85. data/lib/middleman-presentation-core/cli/init.rb +12 -0
  86. data/lib/middleman-presentation-core/cli/init_application.rb +48 -0
  87. data/lib/middleman-presentation-core/cli/init_predefined_slides.rb +31 -0
  88. data/lib/middleman-presentation-core/cli/list.rb +66 -0
  89. data/lib/middleman-presentation-core/cli/reset_thor.rb +18 -0
  90. data/lib/middleman-presentation-core/cli/runner.rb +47 -0
  91. data/lib/middleman-presentation-core/cli/serve.rb +13 -0
  92. data/lib/middleman-presentation-core/cli/serve_presentation.rb +30 -0
  93. data/lib/middleman-presentation-core/cli/shared.rb +51 -0
  94. data/lib/middleman-presentation-core/cli/show.rb +70 -0
  95. data/lib/middleman-presentation-core/comparable_slide.rb +69 -0
  96. data/lib/middleman-presentation-core/component.rb +86 -0
  97. data/lib/middleman-presentation-core/components_manager.rb +96 -0
  98. data/lib/middleman-presentation-core/configuration_file.rb +15 -0
  99. data/lib/middleman-presentation-core/css_class_extracter.rb +41 -0
  100. data/lib/middleman-presentation-core/custom_template.rb +15 -0
  101. data/lib/middleman-presentation-core/erb_template.rb +15 -0
  102. data/lib/middleman-presentation-core/errors.rb +10 -0
  103. data/lib/middleman-presentation-core/existing_slide.rb +92 -0
  104. data/lib/middleman-presentation-core/frontend_component.rb +75 -0
  105. data/lib/middleman-presentation-core/group_template.rb +15 -0
  106. data/lib/middleman-presentation-core/helpers_manager.rb +37 -0
  107. data/lib/middleman-presentation-core/ignore_file.rb +52 -0
  108. data/lib/middleman-presentation-core/liquid_template.rb +15 -0
  109. data/lib/middleman-presentation-core/list.rb +7 -0
  110. data/lib/middleman-presentation-core/locale_configurator.rb +84 -0
  111. data/lib/middleman-presentation-core/logger.rb +8 -0
  112. data/lib/middleman-presentation-core/main.rb +55 -0
  113. data/lib/middleman-presentation-core/markdown_template.rb +15 -0
  114. data/lib/middleman-presentation-core/middleman_environment.rb +108 -0
  115. data/lib/middleman-presentation-core/middleman_extension.rb +12 -0
  116. data/lib/middleman-presentation-core/middleman_step_definitions.rb +131 -0
  117. data/lib/middleman-presentation-core/new_slide.rb +140 -0
  118. data/lib/middleman-presentation-core/overwrite_sass.rb +22 -0
  119. data/lib/middleman-presentation-core/plugin.rb +8 -0
  120. data/lib/middleman-presentation-core/plugin_api.rb +65 -0
  121. data/lib/middleman-presentation-core/plugins_manager.rb +7 -0
  122. data/lib/middleman-presentation-core/predefined_slide_templates_directory.rb +15 -0
  123. data/lib/middleman-presentation-core/presentation_helper.rb +69 -0
  124. data/lib/middleman-presentation-core/register_extension.rb +4 -0
  125. data/lib/middleman-presentation-core/roles/comparable_by_name.rb +24 -0
  126. data/lib/middleman-presentation-core/slide_group.rb +33 -0
  127. data/lib/middleman-presentation-core/slide_list.rb +52 -0
  128. data/lib/middleman-presentation-core/slide_name.rb +61 -0
  129. data/lib/middleman-presentation-core/start.rb +68 -0
  130. data/lib/middleman-presentation-core/step_definitions.rb +238 -0
  131. data/lib/middleman-presentation-core/syntax_highlighter.rb +42 -0
  132. data/lib/middleman-presentation-core/test_helpers.rb +22 -0
  133. data/lib/middleman-presentation-core/transformers/file_keeper.rb +13 -0
  134. data/lib/middleman-presentation-core/transformers/group_slides.rb +34 -0
  135. data/lib/middleman-presentation-core/transformers/ignore_slides.rb +28 -0
  136. data/lib/middleman-presentation-core/transformers/remove_duplicate_slides.rb +32 -0
  137. data/lib/middleman-presentation-core/transformers/sort_slides.rb +13 -0
  138. data/lib/middleman-presentation-core/utils.rb +40 -0
  139. data/lib/middleman-presentation-core/version.rb +8 -0
  140. data/lib/middleman-presentation-core.rb +127 -0
  141. data/locales/de.yml +233 -0
  142. data/locales/en.yml +236 -0
  143. data/middleman-presentation-core.gemspec +40 -0
  144. data/source/slides/01.html.liquid +0 -0
  145. data/spec/asset_component_spec.rb +13 -0
  146. data/spec/asset_list_spec.rb +50 -0
  147. data/spec/asset_spec.rb +45 -0
  148. data/spec/asset_store_spec.rb +61 -0
  149. data/spec/assets_manager_spec.rb +111 -0
  150. data/spec/components_manager_spec.rb +142 -0
  151. data/spec/css_class_extracter_spec.rb +28 -0
  152. data/spec/existing_slide_spec.rb +177 -0
  153. data/spec/frontend_component_spec.rb +94 -0
  154. data/spec/helpers_manager_spec.rb +90 -0
  155. data/spec/ignore_file_spec.rb +75 -0
  156. data/spec/new_slide_spec.rb +155 -0
  157. data/spec/presentation_helper_spec.rb +137 -0
  158. data/spec/shared_examples/.keep +0 -0
  159. data/spec/slide_group_spec.rb +54 -0
  160. data/spec/slide_list_spec.rb +125 -0
  161. data/spec/slide_name_spec.rb +53 -0
  162. data/spec/spec_helper.rb +19 -0
  163. data/spec/support/aruba.rb +53 -0
  164. data/spec/support/ci.rb +20 -0
  165. data/spec/support/environment.rb +18 -0
  166. data/spec/support/filesystem.rb +22 -0
  167. data/spec/support/locale.rb +2 -0
  168. data/spec/support/reporting.rb +2 -0
  169. data/spec/support/rspec.rb +9 -0
  170. data/spec/support/string.rb +2 -0
  171. data/spec/transformers/file_keeper_spec.rb +24 -0
  172. data/spec/transformers/group_slides_spec.rb +44 -0
  173. data/spec/transformers/ignore_slides_spec.rb +64 -0
  174. data/spec/transformers/remove_duplicate_slides_spec.rb +120 -0
  175. data/spec/transformers/sort_slides_spec.rb +17 -0
  176. data/spec/utils_spec.rb +14 -0
  177. data/templates/.bowerrc.tt +4 -0
  178. data/templates/.gitignore +5 -0
  179. data/templates/Gemfile.tt +32 -0
  180. data/templates/LICENSE.presentation +1 -0
  181. data/templates/Rakefile +59 -0
  182. data/templates/bower.json.tt +8 -0
  183. data/templates/bundler_config.tt +6 -0
  184. data/templates/config.rb.tt +2 -0
  185. data/templates/config.yaml.tt +17 -0
  186. data/templates/gitignore.tt +14 -0
  187. data/templates/plugin/%plugin_name%.gemspec.tt +24 -0
  188. data/templates/plugin/.gitignore +13 -0
  189. data/templates/plugin/Gemfile.tt +4 -0
  190. data/templates/plugin/LICENSE.txt.tt +22 -0
  191. data/templates/plugin/README.md.tt +31 -0
  192. data/templates/plugin/Rakefile +1 -0
  193. data/templates/plugin/lib/%plugin_name%/version.rb.tt +8 -0
  194. data/templates/plugin/lib/%plugin_name%.rb.tt +10 -0
  195. data/templates/predefined_slides.d/00_00.html.erb.tt +26 -0
  196. data/templates/predefined_slides.d/00_01.html.md.tt +6 -0
  197. data/templates/predefined_slides.d/999980.html.erb.tt +4 -0
  198. data/templates/predefined_slides.d/999981.html.erb.tt +27 -0
  199. data/templates/predefined_slides.d/999982.html.erb.tt +4 -0
  200. data/templates/presentation_theme/bower.json.tt +20 -0
  201. data/templates/presentation_theme/images/.keep +0 -0
  202. data/templates/presentation_theme/javascripts/%theme_name%.js.tt +0 -0
  203. data/templates/presentation_theme/stylesheets/%theme_name%.scss.tt +9 -0
  204. data/templates/presentation_theme/stylesheets/_fonts.scss.tt +0 -0
  205. data/templates/presentation_theme/stylesheets/_images.scss.tt +5 -0
  206. data/templates/presentation_theme/stylesheets/_theme.scss.tt +251 -0
  207. data/templates/rackup.config.erb +16 -0
  208. data/templates/script/bootstrap +5 -0
  209. data/templates/script/build +3 -0
  210. data/templates/script/export +3 -0
  211. data/templates/script/presentation +3 -0
  212. data/templates/script/slide +3 -0
  213. data/templates/script/start +43 -0
  214. data/templates/slides/custom.md.tt +3 -0
  215. data/templates/slides/erb.tt +5 -0
  216. data/templates/slides/group.tt +3 -0
  217. data/templates/slides/liquid.tt +5 -0
  218. data/templates/slides/markdown.tt +3 -0
  219. data/templates/source/index.html.erb +1 -0
  220. data/templates/source/javascripts/application.js.tt +3 -0
  221. data/templates/source/layout.erb +133 -0
  222. data/templates/source/stylesheets/application.scss.tt +3 -0
  223. metadata +574 -0
@@ -0,0 +1,349 @@
1
+ Feature: Initialize presentation
2
+
3
+ As a presentator
4
+ I want to create a new presentation
5
+ In order to use it
6
+
7
+ Scenario: Initialize with long command
8
+ Given I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
9
+ When I cd to "presentation1"
10
+ Then the file "config.rb" should contain:
11
+ """
12
+ activate :presentation
13
+ """
14
+ And the file "Gemfile" should contain:
15
+ """
16
+ middleman-presentation
17
+ """
18
+ And a file named "bower.json" should exist
19
+ And a file named ".bowerrc" should exist
20
+ And a file named ".gitignore" should exist
21
+ And a file named "source/layout.erb" should exist
22
+ And a file named "source/slides/00_00.html.erb" should exist
23
+ And a file named "source/slides/00_01.html.md" should exist
24
+ And a file named "source/index.html.erb" should exist
25
+ And a file named "source/stylesheets/application.scss" should exist
26
+ And a file named "source/javascripts/application.js" should exist
27
+ And a file named "script/start" should exist
28
+ And a file named "Rakefile" should exist
29
+ And a directory named "source/images" should exist
30
+ And a directory named "vendor/assets/components" should exist
31
+ And the file ".middleman-presentation.yaml" should contain:
32
+ """
33
+ project_id:
34
+ """
35
+ Then a directory named "vendor/assets/components/middleman-presentation-theme-default" should exist
36
+ And the file "source/stylesheets/application.scss" should contain:
37
+ """
38
+ @import 'normalize.css/normalize';
39
+ @import 'highlightjs/styles/zenburn';
40
+ @import 'reveal.js/css/reveal.min';
41
+ @import 'reveal.js/css/theme/template/mixins';
42
+ @import 'reveal.js/css/theme/template/settings';
43
+ @import 'middleman-presentation-helpers/footer/footer';
44
+ @import 'middleman-presentation-helpers/image_gallery/image_gallery';
45
+ @import 'middleman-presentation-helpers/images/images';
46
+ @import 'middleman-presentation-theme-default/stylesheets/middleman-presentation-theme-default';
47
+ """
48
+ And the file "source/javascripts/application.js" should contain:
49
+ """
50
+ //= require jquery/dist/jquery
51
+ //= require reveal.js/js/reveal.min
52
+ //= require reveal.js/lib/js/head.min
53
+ //= require middleman-presentation-helpers/footer/footer
54
+ //= require lightbox2/js/lightbox
55
+ """
56
+
57
+ Scenario: Initialize in test directory
58
+ Given I successfully run `middleman-presentation create presentation test/presentation1 --title "My Presentation"`
59
+ When I cd to "test/presentation1"
60
+ Then the file "source/stylesheets/application.scss" should contain:
61
+ """
62
+ @import 'normalize.css/normalize';
63
+ @import 'highlightjs/styles/zenburn';
64
+ @import 'reveal.js/css/reveal.min';
65
+ @import 'reveal.js/css/theme/template/mixins';
66
+ @import 'reveal.js/css/theme/template/settings';
67
+ @import 'middleman-presentation-helpers/footer/footer';
68
+ @import 'middleman-presentation-helpers/image_gallery/image_gallery';
69
+ @import 'middleman-presentation-helpers/images/images';
70
+ @import 'middleman-presentation-theme-default/stylesheets/middleman-presentation-theme-default';
71
+ """
72
+ And the file "source/javascripts/application.js" should contain:
73
+ """
74
+ //= require jquery/dist/jquery
75
+ //= require reveal.js/js/reveal.min
76
+ //= require reveal.js/lib/js/head.min
77
+ //= require middleman-presentation-helpers/footer/footer
78
+ //= require lightbox2/js/lightbox
79
+ """
80
+
81
+ Scenario: Existing configuration file
82
+ Given a user config file for middleman-presentation with:
83
+ """
84
+ author: TestUser
85
+ company: MyCompany
86
+ email_address: test_user@example.com
87
+ homepage: http://example.com
88
+ presentation_language: en
89
+ speaker: TestUser
90
+ """
91
+ When I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
92
+ When I cd to "presentation1"
93
+ Then the file ".middleman-presentation.yaml" should contain:
94
+ """
95
+ author: TestUser
96
+ """
97
+ Then the file ".middleman-presentation.yaml" should contain:
98
+ """
99
+ company: MyCompany
100
+ """
101
+ Then the file ".middleman-presentation.yaml" should contain:
102
+ """
103
+ email_address: test_user@example.com
104
+ """
105
+ Then the file ".middleman-presentation.yaml" should contain:
106
+ """
107
+ homepage: http://example.com
108
+ """
109
+ Then the file ".middleman-presentation.yaml" should contain:
110
+ """
111
+ speaker: TestUser
112
+ """
113
+
114
+ Scenario: German umlauts, French accents and special chars are not a problem for project id
115
+ When I successfully run `middleman-presentation create presentation presentation1 --title "üöà~?§$%&/()=#!"`
116
+ And I cd to "presentation1"
117
+ And the file ".middleman-presentation.yaml" should contain:
118
+ """
119
+ project_id: uoa
120
+ """
121
+
122
+ Scenario: Use language from configuration file
123
+ Given a user config file for middleman-presentation with:
124
+ """
125
+ presentation_language: 'de'
126
+ """
127
+ When I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
128
+ And I cd to "presentation1"
129
+ Then the file "source/slides/999980.html.erb" should contain:
130
+ """
131
+ Fragen
132
+ """
133
+
134
+ Scenario: Use default language if language in configuration file is an empty string
135
+ Given a user config file for middleman-presentation with:
136
+ """
137
+ presentation_language: ''
138
+ """
139
+ When I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
140
+ And I cd to "presentation1"
141
+ Then the file "source/slides/999980.html.erb" should contain:
142
+ """
143
+ Questions
144
+ """
145
+
146
+ Scenario: Use lang from environment as language in slides
147
+ Given I set the environment variables to:
148
+ | variable | value |
149
+ | LANG | de_DE.UTF-8|
150
+ When I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
151
+ And I cd to "presentation1"
152
+ Then the file "source/slides/999980.html.erb" should contain:
153
+ """
154
+ Fragen
155
+ """
156
+
157
+ Scenario: Use lang from command line as language in slides
158
+ Given I set the environment variables to:
159
+ | variable | value |
160
+ | LANG | de_DE.UTF-8|
161
+ And I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation" --language en`
162
+ When I cd to "presentation1"
163
+ And the file "source/slides/999980.html.erb" should contain:
164
+ """
165
+ Questions
166
+ """
167
+
168
+ Scenario: Ignore case of lang value
169
+ Given I set the environment variables to:
170
+ | variable | value |
171
+ | LANG | de_de.utf-8|
172
+ And I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
173
+ When I cd to "presentation1"
174
+ When I successfully run `env`
175
+ And the file "source/slides/999980.html.erb" should contain:
176
+ """
177
+ Fragen
178
+ """
179
+
180
+ Scenario: Use englisch language in slides based if garbabe in environment variable
181
+ Given I set the environment variables to:
182
+ | variable | value |
183
+ | LANG | asdf |
184
+ And I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
185
+ When I cd to "presentation1"
186
+ And the file "source/slides/999980.html.erb" should contain:
187
+ """
188
+ Questions
189
+ """
190
+
191
+ Scenario: Use englisch language in slides if given garbabe on command line
192
+ Given I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation" --language adsfasdfn`
193
+ When I cd to "presentation1"
194
+ And the file "source/slides/999980.html.erb" should contain:
195
+ """
196
+ Questions
197
+ """
198
+
199
+ Scenario: Use different theme
200
+ Given a user config file for middleman-presentation with:
201
+ """
202
+ theme:
203
+ name: middleman-presentation-theme-fedux_org
204
+ github: maxmeyer/middleman-presentation-theme-fedux_org
205
+ importable_files:
206
+ - stylesheets/middleman-presentation-theme-fedux_org
207
+ """
208
+ And I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
209
+ When I cd to "presentation1"
210
+ Then a directory named "vendor/assets/components/middleman-presentation-theme-fedux_org" should exist
211
+ And the file "source/stylesheets/application.scss" should contain:
212
+ """
213
+ @import 'middleman-presentation-theme-fedux_org/stylesheets/middleman-presentation-theme-fedux_org';
214
+ """
215
+
216
+ Scenario: Fails if bower is not installed
217
+ Given only the executables of gems "middleman-core, middleman-presentation" can be found in PATH
218
+ When I run `middleman-presentation create presentation presentation1 --title "My Presentation"`
219
+ Then the output should contain:
220
+ """
221
+ cannot be found in PATH
222
+ """
223
+
224
+ Scenario: Fails if bower update fails
225
+ Given a file named "~/bin/bower" with mode "0755" and with:
226
+ """
227
+ #!/bin/bash
228
+ echo "Failed" >&2
229
+ exit 1
230
+ """
231
+ And only the executables of gems "middleman-core, middleman-presentation" can be found in PATH
232
+ And I prepend "~/bin:" to environment variable "PATH"
233
+ And I run `middleman-presentation create presentation presentation1 --title "My Presentation"`
234
+ Then the output should contain:
235
+ """
236
+ Failed
237
+ """
238
+
239
+ Scenario: No predefined slides
240
+ When I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation" --no-create-predefined-slides`
241
+ Then a file named "source/slides/00.html.erb" should not exist
242
+ And a file named "source/slides/999980.html.erb" should not exist
243
+ And a file named "source/slides/999981.html.erb" should not exist
244
+ And a file named "source/slides/999982.html.erb" should not exist
245
+
246
+ Scenario: Custom start slide template
247
+ Given a user template named "predefined_slides.d/00.html.erb.tt" with:
248
+ """
249
+ <section>
250
+ <h1>Start</h1>
251
+ </section>
252
+ """
253
+ And I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
254
+ When I cd to "presentation1"
255
+ Then a slide named "00.html.erb" should exist with:
256
+ """
257
+ <section>
258
+ <h1>Start</h1>
259
+ </section>
260
+ """
261
+
262
+ Scenario: Custom questions template
263
+ Given a user template named "predefined_slides.d/999980.html.erb.tt" with:
264
+ """
265
+ <section>
266
+ <h1>Questions? Really</h1>
267
+ </section>
268
+ """
269
+ And I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
270
+ When I cd to "presentation1"
271
+ Then a slide named "999980.html.erb" should exist with:
272
+ """
273
+ <section>
274
+ <h1>Questions? Really</h1>
275
+ </section>
276
+ """
277
+
278
+ Scenario: Custom contact template
279
+ Given a user template named "predefined_slides.d/999981.html.erb.tt" with:
280
+ """
281
+ <section>
282
+ <h1>Contact</h1>
283
+ Me and You
284
+ </section>
285
+ """
286
+ And I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
287
+ When I cd to "presentation1"
288
+ Then a slide named "999981.html.erb" should exist with:
289
+ """
290
+ <section>
291
+ <h1>Contact</h1>
292
+ Me and You
293
+ </section>
294
+ """
295
+
296
+ Scenario: Custom end slide template
297
+ Given a user template named "predefined_slides.d/999982.html.erb.tt" with:
298
+ """
299
+ <section>
300
+ <h1>See you!</h1>
301
+ </section>
302
+ """
303
+ And I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
304
+ When I cd to "presentation1"
305
+ Then a slide named "999982.html.erb" should exist with:
306
+ """
307
+ <section>
308
+ <h1>See you!</h1>
309
+ </section>
310
+ """
311
+
312
+ Scenario: Install external asset
313
+ Given a user config file for middleman-presentation with:
314
+ """
315
+ plugins:
316
+ - middleman-presentation-simple_plugin
317
+ """
318
+ When I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation"`
319
+ And I cd to "presentation1"
320
+ Then a directory named "vendor/assets/components/angular" should exist
321
+ And a directory named "vendor/assets/components/impress.js" should exist
322
+
323
+ Scenario: Change presentation size
324
+ Given I successfully run `middleman-presentation create presentation presentation1 --title "My Presentation" --width 1024 --height 768 --margin 0.5`
325
+ When I cd to "presentation1"
326
+ Then the file ".middleman-presentation.yaml" should contain:
327
+ """
328
+ width: '1024'
329
+ """
330
+ And the file ".middleman-presentation.yaml" should contain:
331
+ """
332
+ height: '768'
333
+ """
334
+ And the file ".middleman-presentation.yaml" should contain:
335
+ """
336
+ margin: '0.5'
337
+ """
338
+
339
+ Scenario: Expand ~
340
+ Given I successfully run `middleman-presentation create presentation ~/presentation1 --title "My Presentation"`
341
+ When I cd to "presentation1"
342
+ Then the file "source/javascripts/application.js" should contain:
343
+ """
344
+ //= require jquery/dist/jquery
345
+ //= require reveal.js/js/reveal.min
346
+ //= require reveal.js/lib/js/head.min
347
+ //= require middleman-presentation-helpers/footer/footer
348
+ //= require lightbox2/js/lightbox
349
+ """
@@ -0,0 +1,188 @@
1
+ Feature: Add new slide
2
+
3
+ As a presentator
4
+ I want to add a new slide
5
+ In order do build it
6
+
7
+ Background:
8
+ Given I use presentation fixture "presentation1" with title "My Presentation"
9
+
10
+ Scenario: Custom Slide
11
+ When I successfully run `middleman-presentation create slide 01`
12
+ Then the following files should exist:
13
+ | source/slides/01.html.md |
14
+
15
+ Scenario: Embedded Ruby Slide
16
+ When I successfully run `middleman-presentation create slide 01.erb`
17
+ Then the following files should exist:
18
+ | source/slides/01.html.erb |
19
+
20
+ Scenario: Markdown Slide
21
+ When I successfully run `middleman-presentation create slide 01.md`
22
+ Then the following files should exist:
23
+ | source/slides/01.html.md |
24
+
25
+ Scenario: Liquid Slide
26
+ When I successfully run `middleman-presentation create slide 01.l`
27
+ Then the following files should exist:
28
+ | source/slides/01.html.liquid |
29
+
30
+ Scenario: Liquid Slide (long file extension)
31
+ When I successfully run `middleman-presentation create slide 01.liquid`
32
+ Then the following files should exist:
33
+ | source/slides/01.html.liquid |
34
+
35
+ Scenario: Markdown Slide (long file extension)
36
+ When I successfully run `middleman-presentation create slide 01.markdown`
37
+ Then the following files should exist:
38
+ | source/slides/01.html.md |
39
+
40
+ Scenario: Open slide with ENV['EDITOR'] after creation
41
+ When I successfully run `middleman-presentation create slide 01.markdown --edit --editor-command echo`
42
+ Then the following files should exist:
43
+ | source/slides/01.html.md |
44
+ And the output should contain:
45
+ """
46
+ 01.html.md
47
+ """
48
+
49
+ Scenario: Create multiple slides
50
+ When I successfully run `middleman-presentation create slide 01 02`
51
+ Then the following files should exist:
52
+ | source/slides/01.html.md |
53
+ | source/slides/02.html.md |
54
+
55
+ Scenario: Edit existing slide with ENV['EDITOR']
56
+ And a slide named "02.html.md" with:
57
+ """
58
+ <section>
59
+ <h1>Headline</h1>
60
+ </section>
61
+ """
62
+ When I successfully run `middleman-presentation create slide 02 --edit --editor-command echo`
63
+ And the output should contain:
64
+ """
65
+ 02.html.md
66
+ """
67
+
68
+ Scenario: Edit non-existing slide with ENV['EDITOR']
69
+ When I successfully run `middleman-presentation create slide 02 --edit --editor-command echo`
70
+ And the output should contain:
71
+ """
72
+ create
73
+ """
74
+ And the output should contain:
75
+ """
76
+ 02.html.md
77
+ """
78
+
79
+ Scenario: Edit mixing existing and non-existing slides with ENV['EDITOR']
80
+ And a slide named "02.html.md" with:
81
+ """
82
+ <section>
83
+ <h1>Headline</h1>
84
+ </section>
85
+ """
86
+ When I successfully run `middleman-presentation create slide 02 03 --edit --editor-command echo`
87
+ And the output should contain:
88
+ """
89
+ 02.html.md
90
+ """
91
+ And the output should contain:
92
+ """
93
+ 03.html.md
94
+ """
95
+
96
+ Scenario: Edit existing multiple slides with ENV['EDITOR']
97
+ And a slide named "02.html.md" with:
98
+ """
99
+ <section>
100
+ <h1>Headline</h1>
101
+ </section>
102
+ """
103
+ And a slide named "03.html.md" with:
104
+ """
105
+ <section>
106
+ <h1>Headline</h1>
107
+ </section>
108
+ """
109
+ When I successfully run `middleman-presentation create slide 02 03 --edit --editor-command echo`
110
+ And the output should contain:
111
+ """
112
+ 02.html.md
113
+ """
114
+ And the output should contain:
115
+ """
116
+ 03.html.md
117
+ """
118
+
119
+ Scenario: Fails on duplicate slide names
120
+ When I run `middleman-presentation create slide 02.erb 02.md 03.erb 03.md 03.liquid`
121
+ And the output should contain:
122
+ """
123
+ Your input will result in duplicate slide file names "02.html.md", "02.html.erb", "03.html.md", "03.html.liquid", "03.html.erb", "03.html.liquid", "03.html.erb", "03.html.md"
124
+ """
125
+
126
+ Scenario: Missing slide name
127
+ When I run `middleman-presentation create slide`
128
+ Then the output should contain:
129
+ """
130
+ No value provided for required arguments 'names'
131
+ """
132
+
133
+ Scenario: Using eruby in editor command
134
+ When I successfully run `middleman-presentation create slide 02 03 --edit --editor-command "echo <%= project_id %>"`
135
+ Then the output should contain:
136
+ """
137
+ my-presentation
138
+ """
139
+
140
+ Scenario: Using eruby in editor command and shell escape
141
+ When I successfully run `middleman-presentation create slide 02 03 --edit --editor-command "echo <%= Shellwords.shellescape(project_id) %>"`
142
+ Then the output should contain:
143
+ """
144
+ my-presentation
145
+ """
146
+
147
+ Scenario: Output information that a slide was created
148
+ When I successfully run `middleman-presentation create slide 01`
149
+ Then the output should contain:
150
+ """
151
+ create slides/01.html.md
152
+ """
153
+
154
+ Scenario: Output information that multiple slides were created
155
+ When I successfully run `middleman-presentation create slide 01 02 03`
156
+ Then the output should contain:
157
+ """
158
+ create slides/01.html.md
159
+ create slides/02.html.md
160
+ create slides/03.html.md
161
+ """
162
+
163
+ Scenario: Output information that a slide already exists
164
+ When I successfully run `middleman-presentation create slide 01`
165
+ When I successfully run `middleman-presentation create slide 01`
166
+ Then the output should contain:
167
+ """
168
+ exist slides/01.html.md
169
+ """
170
+
171
+ Scenario: Output information that multiple slides already exist
172
+ When I successfully run `middleman-presentation create slide 01 02 03`
173
+ When I successfully run `middleman-presentation create slide 01 02 03`
174
+ Then the output should contain:
175
+ """
176
+ exist slides/01.html.md
177
+ """
178
+
179
+ Scenario: Create Group of slides in subfolder
180
+ When I successfully run `middleman-presentation create slide 01namespace:01`
181
+ Then the following files should exist:
182
+ | source/slides/01namespace/01.html.md |
183
+
184
+ Scenario: Create Group with same name as slide
185
+ When I successfully run `middleman-presentation create slide 01:01`
186
+ Then the following files should exist:
187
+ | source/slides/01/01.html.md |
188
+
@@ -0,0 +1,114 @@
1
+ Feature: Use templates for new slides
2
+
3
+ As a presentator
4
+ I want to add a new slide based on a template
5
+ In order do build it
6
+
7
+ Background:
8
+ Given I use presentation fixture "presentation1" with title "My Presentation"
9
+
10
+ Scenario: Project Erb Slide template
11
+ And a project template named "erb.tt" with:
12
+ """
13
+ <section>
14
+ <h1>New Template</h1>
15
+ <h2><%= title %></h2>
16
+ </section>
17
+ """
18
+ When I successfully run `middleman-presentation create slide 01.erb --title "My Title"`
19
+ Then a slide named "01.html.erb" should exist with:
20
+ """
21
+ <section>
22
+ <h1>New Template</h1>
23
+ <h2>My Title</h2>
24
+ </section>
25
+ """
26
+
27
+ Scenario: Project Markdown Slide template
28
+ And a project template named "markdown.tt" with:
29
+ """
30
+ <section>
31
+ # New Template
32
+ ## <%= title %>
33
+ </section>
34
+ """
35
+ When I successfully run `middleman-presentation create slide 01.md --title "My Title"`
36
+ Then a slide named "01.html.md" should exist with:
37
+ """
38
+ <section>
39
+ # New Template
40
+ ## My Title
41
+ </section>
42
+ """
43
+
44
+ Scenario: Project Liquid Slide template
45
+ And a project template named "liquid.tt" with:
46
+ """
47
+ <section>
48
+ <h1>{{ page_title }}</h1>
49
+ <h2><%= title %><h2>
50
+ </section>
51
+ """
52
+ When I successfully run `middleman-presentation create slide 01.liquid --title "My Title"`
53
+ Then a slide named "01.html.liquid" should exist with:
54
+ """
55
+ <section>
56
+ <h1>{{ page_title }}</h1>
57
+ <h2>My Title<h2>
58
+ </section>
59
+ """
60
+
61
+ Scenario: User markdown template
62
+ Given a user template named "markdown.tt" with:
63
+ """
64
+ <section>
65
+ # Hey ya
66
+ </section>
67
+ """
68
+ When I successfully run `middleman-presentation create slide 01.md --title "My Title"`
69
+ Then a slide named "01.html.md" should exist with:
70
+ """
71
+ <section>
72
+ # Hey ya
73
+ </section>
74
+ """
75
+
76
+ Scenario: Custom default template
77
+ When I successfully run `middleman-presentation create slide 01 --title "My Title"`
78
+ Then a slide named "01.html.md" should exist with:
79
+ """
80
+ <section>
81
+ # My Title
82
+ </section>
83
+ """
84
+
85
+ Scenario: Custom user markdown template
86
+ Given a user template named "custom.md.tt" with:
87
+ """
88
+ <section>
89
+ # <%= title %>
90
+ </section>
91
+ """
92
+ When I successfully run `middleman-presentation create slide 01 --title "My Title"`
93
+ Then a slide named "01.html.md" should exist with:
94
+ """
95
+ <section>
96
+ # My Title
97
+ </section>
98
+ """
99
+
100
+ Scenario: Custom user erb template
101
+ Given a user template named "custom.erb.tt" with:
102
+ """
103
+ <section>
104
+ <h1><%= title %></h1>
105
+ </section>
106
+ """
107
+ When I successfully run `middleman-presentation create slide 01 --title "My Title"`
108
+ Then a slide named "01.html.erb" should exist with:
109
+ """
110
+ <section>
111
+ <h1>My Title</h1>
112
+ </section>
113
+ """
114
+