middleman-presentation 0.15.8 → 0.16.0.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +31 -4
- data/Rakefile +8 -3
- data/bin/middleman-presentation +9 -1
- data/bin/mp +9 -1
- data/lib/middleman-presentation.rb +1 -71
- data/middleman-presentation.gemspec +7 -20
- metadata +14 -357
- data/.gitignore +0 -33
- data/.rdebugrc +0 -7
- data/.rspec +0 -5
- data/.simplecov +0 -8
- data/.travis.yml +0 -8
- data/.yardopts +0 -5
- data/CONTRIBUTING.md +0 -44
- data/Gemfile +0 -49
- data/Gemfile.lock +0 -328
- data/Guardfile +0 -13
- data/LICENSE.software +0 -21
- data/README.md +0 -608
- data/RELEASE_NOTES.md +0 -36
- data/config/license_finder.yml +0 -13
- data/config/rubocop/exclude.yml +0 -25
- data/config/rubocop/include.yml +0 -142
- data/cucumber.yml +0 -2
- data/doc/licenses/dependencies.csv +0 -55
- data/doc/licenses/dependencies.db +0 -0
- data/doc/licenses/dependencies.html +0 -1415
- data/doc/licenses/dependencies.md +0 -603
- data/doc/licenses/dependencies_detailed.csv +0 -190
- data/features/create_presentation-cli.feature +0 -312
- data/features/create_theme-cli.feature +0 -62
- data/features/grouping_slides.feature +0 -116
- data/features/ignore_slides.feature +0 -86
- data/features/image_gallery.feature +0 -58
- data/features/init_application-cli.feature +0 -91
- data/features/init_predefined_slides.feature +0 -13
- data/features/presentation.feature +0 -113
- data/features/show_config-cli.feature +0 -27
- data/features/show_style-cli.feature +0 -21
- data/features/show_support_information-cli.feature +0 -12
- data/features/slide-cli.feature +0 -311
- data/features/step_definitions.rb +0 -135
- data/features/support/ci.rb +0 -3
- data/features/support/env.rb +0 -19
- data/features/support/reporting.rb +0 -2
- data/features/version_number.feature +0 -18
- data/fixtures/images/image01.png +0 -0
- data/fixtures/images/image02.png +0 -0
- data/lib/middleman-presentation/cli/create.rb +0 -14
- data/lib/middleman-presentation/cli/create_presentation.rb +0 -308
- data/lib/middleman-presentation/cli/create_theme.rb +0 -77
- data/lib/middleman-presentation/cli/init.rb +0 -34
- data/lib/middleman-presentation/cli/reset_thor.rb +0 -18
- data/lib/middleman-presentation/cli/runner.rb +0 -18
- data/lib/middleman-presentation/cli/show.rb +0 -37
- data/lib/middleman-presentation/commands/presentation.rb +0 -23
- data/lib/middleman-presentation/commands/slide.rb +0 -86
- data/lib/middleman-presentation/commands/style.rb +0 -29
- data/lib/middleman-presentation/comparable_slide.rb +0 -69
- data/lib/middleman-presentation/css_class_extracter.rb +0 -41
- data/lib/middleman-presentation/custom_template.rb +0 -11
- data/lib/middleman-presentation/erb_template.rb +0 -11
- data/lib/middleman-presentation/existing_slide.rb +0 -133
- data/lib/middleman-presentation/extension.rb +0 -12
- data/lib/middleman-presentation/file_extensions.rb +0 -60
- data/lib/middleman-presentation/frontend_component.rb +0 -82
- data/lib/middleman-presentation/group_template.rb +0 -11
- data/lib/middleman-presentation/helpers.rb +0 -11
- data/lib/middleman-presentation/helpers/images.rb +0 -38
- data/lib/middleman-presentation/helpers/slides.rb +0 -31
- data/lib/middleman-presentation/helpers/tests.rb +0 -13
- data/lib/middleman-presentation/ignore_file.rb +0 -52
- data/lib/middleman-presentation/liquid_template.rb +0 -11
- data/lib/middleman-presentation/logger.rb +0 -8
- data/lib/middleman-presentation/main.rb +0 -40
- data/lib/middleman-presentation/markdown_template.rb +0 -11
- data/lib/middleman-presentation/new_slide.rb +0 -145
- data/lib/middleman-presentation/predefined_slide_templates_directory.rb +0 -11
- data/lib/middleman-presentation/presentation_config.rb +0 -48
- data/lib/middleman-presentation/slide_group.rb +0 -38
- data/lib/middleman-presentation/slide_list.rb +0 -46
- data/lib/middleman-presentation/transformers/file_keeper.rb +0 -13
- data/lib/middleman-presentation/transformers/group_slides.rb +0 -34
- data/lib/middleman-presentation/transformers/ignore_slides.rb +0 -28
- data/lib/middleman-presentation/transformers/remove_duplicate_slides.rb +0 -32
- data/lib/middleman-presentation/transformers/sort_slides.rb +0 -13
- data/lib/middleman-presentation/version.rb +0 -8
- data/locales/de.yml +0 -9
- data/locales/en.yml +0 -18
- data/script/bootstrap +0 -11
- data/script/ci +0 -3
- data/spec/css_class_extracter_spec.rb +0 -28
- data/spec/existing_slide_spec.rb +0 -158
- data/spec/frontend_resource_spec.rb +0 -87
- data/spec/ignore_file_spec.rb +0 -74
- data/spec/new_slide_spec.rb +0 -136
- data/spec/shared_examples/.keep +0 -0
- data/spec/slide_group_spec.rb +0 -69
- data/spec/slide_list_spec.rb +0 -90
- data/spec/spec_helper.rb +0 -19
- data/spec/support/ci.rb +0 -20
- data/spec/support/environment.rb +0 -18
- data/spec/support/filesystem.rb +0 -22
- data/spec/support/reporting.rb +0 -2
- data/spec/support/rspec.rb +0 -9
- data/spec/support/string.rb +0 -2
- data/spec/transformers/file_keeper_spec.rb +0 -23
- data/spec/transformers/group_slides_spec.rb +0 -44
- data/spec/transformers/ignore_slides_spec.rb +0 -64
- data/spec/transformers/remove_duplicate_slides_spec.rb +0 -120
- data/spec/transformers/sort_slides_spec.rb +0 -17
- data/templates/.bowerrc.tt +0 -4
- data/templates/.gitignore +0 -5
- data/templates/LICENSE.presentation +0 -1
- data/templates/Rakefile +0 -59
- data/templates/bower.json.tt +0 -8
- data/templates/config.yaml.tt +0 -41
- data/templates/data/config.yml.tt +0 -9
- data/templates/data/metadata.yml.tt +0 -77
- data/templates/predefined_slides.d/00.html.erb.tt +0 -23
- data/templates/predefined_slides.d/999980.html.erb.tt +0 -4
- data/templates/predefined_slides.d/999981.html.erb.tt +0 -21
- data/templates/predefined_slides.d/999982.html.erb.tt +0 -3
- data/templates/presentation_theme/bower.json.tt +0 -20
- data/templates/presentation_theme/images/.keep +0 -0
- data/templates/presentation_theme/javascripts/%theme_name%.js.tt +0 -0
- data/templates/presentation_theme/stylesheets/%theme_name%.scss.tt +0 -9
- data/templates/presentation_theme/stylesheets/_fonts.scss.tt +0 -0
- data/templates/presentation_theme/stylesheets/_images.scss.tt +0 -5
- data/templates/presentation_theme/stylesheets/_theme.scss.tt +0 -251
- data/templates/script/bootstrap +0 -5
- data/templates/script/build +0 -3
- data/templates/script/export +0 -34
- data/templates/script/presentation +0 -3
- data/templates/script/slide +0 -3
- data/templates/script/start +0 -43
- data/templates/slides/custom.md.tt +0 -3
- data/templates/slides/erb.tt +0 -5
- data/templates/slides/group.tt +0 -3
- data/templates/slides/liquid.tt +0 -5
- data/templates/slides/markdown.tt +0 -3
- data/templates/source/index.html.erb +0 -1
- data/templates/source/javascripts/application.js.tt +0 -3
- data/templates/source/layout.erb +0 -89
- data/templates/source/stylesheets/application.scss.tt +0 -3
data/Guardfile
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
# A sample Guardfile
|
3
|
-
# More info at https://github.com/guard/guard#readme
|
4
|
-
|
5
|
-
# Add files and commands to this file, like the example:
|
6
|
-
# watch(%r{file/path}) { `command(s)` }
|
7
|
-
#
|
8
|
-
guard :shell do
|
9
|
-
watch(%r{^source/slides/.+\.(?:erb|html)}) do
|
10
|
-
$stderr.puts 'Running middleman'
|
11
|
-
system('bundle exec middleman build')
|
12
|
-
end
|
13
|
-
end
|
data/LICENSE.software
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2014 maxmeyer
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
data/README.md
DELETED
@@ -1,608 +0,0 @@
|
|
1
|
-
# middleman-presentation
|
2
|
-
|
3
|
-
[![Build Status](https://travis-ci.org/maxmeyer/middleman-presentation.png?branch=master)](https://travis-ci.org/maxmeyer/middleman-presentation)
|
4
|
-
[![Coverage Status](https://coveralls.io/repos/maxmeyer/middleman-presentation/badge.png?branch=master)](https://coveralls.io/r/maxmeyer/middleman-presentation?branch=master)
|
5
|
-
[![Gem Version](https://badge.fury.io/rb/middleman-presentation.svg)](http://badge.fury.io/rb/middleman-presentation)
|
6
|
-
|
7
|
-
This project helps you to build wonderful presentations based on
|
8
|
-
[HTML](http://www.w3.org/html/) and JavaScript. The JavaScript-part is powered
|
9
|
-
by [`reveal.js`](https://github.com/hakimel/reveal.js), a great framework to
|
10
|
-
build HTML-/JavaScript-presentations. The infrastructure behind
|
11
|
-
`middleman-presentation` is powered by `middleman`, a flexible static site
|
12
|
-
generator which also offers a live preview of your presentation.
|
13
|
-
|
14
|
-
To get started with `middleman-presentation` you should know a little bit about
|
15
|
-
HTML, JavaScript, reveal.js and [Ruby](https://www.ruby-lang.org/en).
|
16
|
-
`middleman-presentation` will then help you wherever it can to make your life
|
17
|
-
easy with presentations.
|
18
|
-
|
19
|
-
Why you would like to use `middleman-presentation` instead of pure `reveal.js`?
|
20
|
-
|
21
|
-
* It provides helper-commands for recurring tasks, e.g. create new
|
22
|
-
presentations, create new slides, editing slides
|
23
|
-
* It separates data (slides) from style (theme) by using bower + sprockets
|
24
|
-
* It supports a lot of template languages, e.g. Markdown, Erb, Liquid
|
25
|
-
* It provides templates, but give you the freedom to define your own ones
|
26
|
-
* It can be extended by using ruby
|
27
|
-
|
28
|
-
## Installation
|
29
|
-
|
30
|
-
### Gem
|
31
|
-
|
32
|
-
Install via rubygems
|
33
|
-
|
34
|
-
gem install middleman-presentation
|
35
|
-
|
36
|
-
Or add this line to your middleman application's Gemfile:
|
37
|
-
|
38
|
-
gem 'middleman-presentation'
|
39
|
-
|
40
|
-
And then execute:
|
41
|
-
|
42
|
-
$ bundle
|
43
|
-
|
44
|
-
### External Dependencies
|
45
|
-
|
46
|
-
**Nodejs**
|
47
|
-
|
48
|
-
Please install [`nodejs`](https://github.com/joyent/node). It is required by
|
49
|
-
`bower` - see [bower](#bower_install)-section below. It is recommended to
|
50
|
-
install it via [package
|
51
|
-
manager](https://github.com/joyent/node/wiki/installing-node.js-via-package-manager).
|
52
|
-
|
53
|
-
It is recommended to configure the path where global packages are installed.
|
54
|
-
That ensures that you do not need to install global packages as `root`.
|
55
|
-
|
56
|
-
1. Create `.npmrc`
|
57
|
-
|
58
|
-
```bash
|
59
|
-
# Change <user> to your user
|
60
|
-
prefix = /home/<user>/.local/share/npm
|
61
|
-
|
62
|
-
# If you need to use a coporate proxy, add those lines as well.
|
63
|
-
# Be careful `https-proxy` needs use a `http`-url, not a `https`-one
|
64
|
-
# proxy = http://localhost:3128
|
65
|
-
# https-proxy = http://localhost:3128
|
66
|
-
```
|
67
|
-
|
68
|
-
2. Make executables of nodejs-packages available via PATH
|
69
|
-
|
70
|
-
Add `npm`-bin dir to your PATH-variable via `.bashrc`, `.zshrc` or whatever
|
71
|
-
initialization-script your shell uses.
|
72
|
-
|
73
|
-
```bash
|
74
|
-
export PATH=~/.local/share/npm/bin:$PATH
|
75
|
-
```
|
76
|
-
|
77
|
-
**Bower**
|
78
|
-
<a name="bower_install"></a>
|
79
|
-
|
80
|
-
You also need to install [`bower`](http://www.bower.io). It is used to install
|
81
|
-
the assets (CSS-, JavaScript-files etc.).
|
82
|
-
|
83
|
-
```bash
|
84
|
-
npm install -g bower
|
85
|
-
```
|
86
|
-
|
87
|
-
**JavaScript Engine**
|
88
|
-
|
89
|
-
Make sure you've got a javascript engine installed. Please follow the
|
90
|
-
instructions found [here](https://github.com/sstephenson/execjs). I do not add
|
91
|
-
this as a runtime-dependency to this gem. So it is your choice what engine you want to
|
92
|
-
use.
|
93
|
-
|
94
|
-
## Release Notes
|
95
|
-
|
96
|
-
You find the release notes [here](RELEASE_NOTES.md) or on
|
97
|
-
[github](https://github.com/maxmeyer/middleman-presentation/blob/master/RELEASE_NOTES.md).
|
98
|
-
|
99
|
-
## Supported rubies
|
100
|
-
|
101
|
-
* MRI >= 2.1.x
|
102
|
-
|
103
|
-
## Find help
|
104
|
-
|
105
|
-
* This [README.md](README.m)
|
106
|
-
* A good [tutorial](http://htmlcheats.com/reveal-js/reveal-js-tutorial-reveal-js-for-beginners/) tutorial about `reveal.js`
|
107
|
-
* The [documentation](https://github.com/hakimel/reveal.js/) of `reveal.js`
|
108
|
-
* The [documentation](http://middlemanapp.com/) of `middleman`
|
109
|
-
|
110
|
-
## Getting Started
|
111
|
-
|
112
|
-
### Initialize middleman presentation globally
|
113
|
-
|
114
|
-
To create a global configuration file for `middleman-presentation` you need to
|
115
|
-
run the following command:
|
116
|
-
|
117
|
-
```bash
|
118
|
-
middleman-presentation init application
|
119
|
-
```
|
120
|
-
|
121
|
-
This will create a configuration file at
|
122
|
-
`$HOME/.config/middleman/presentation/presentations.yaml`. The configuration options
|
123
|
-
given there will be used for all presentations created with
|
124
|
-
`middleman-presentation`. After running the command on a pristine system it
|
125
|
-
will contain the defaults.
|
126
|
-
|
127
|
-
Please run `cat $HOME/.config/middleman/presentation/presentations.yaml` to view them.
|
128
|
-
|
129
|
-
### Initialize presentation
|
130
|
-
|
131
|
-
This gem provides a helper to start a new presentatio from scratch. The given
|
132
|
-
options below need to be given on command line.
|
133
|
-
|
134
|
-
```bash
|
135
|
-
# long
|
136
|
-
middleman-presentation create presentation --title "my title" --speaker "Me"
|
137
|
-
|
138
|
-
#short
|
139
|
-
middleman-presentation create --title "my title" --speaker "Me"
|
140
|
-
```
|
141
|
-
|
142
|
-
The presentation helper provides a lot of more options. Use the help command to
|
143
|
-
get an overview. If you want to switch the language for generated slides use
|
144
|
-
the `--language`-switch.
|
145
|
-
|
146
|
-
```bash
|
147
|
-
bundle exec middleman help presentation
|
148
|
-
```
|
149
|
-
|
150
|
-
### Start your presentation
|
151
|
-
|
152
|
-
To start your presentation use the `start`-script. It opens the presentation in
|
153
|
-
your browser and starts `middleman`. After `middleman` has started you just
|
154
|
-
need to reload the presentation in the browser.
|
155
|
-
|
156
|
-
```bash
|
157
|
-
# Short
|
158
|
-
script/start
|
159
|
-
|
160
|
-
# Long
|
161
|
-
bundle exec middleman server
|
162
|
-
```
|
163
|
-
|
164
|
-
### Add new slide
|
165
|
-
|
166
|
-
**MAKE SURE YOU NEVER EVER GIVE TWO SLIDES THE SAME BASENAME**, eg. 01.html.erb
|
167
|
-
and 01.html.md. This will not work with `middleman`.
|
168
|
-
|
169
|
-
To add a new slide you can use the `slide`-helper.
|
170
|
-
|
171
|
-
```bash
|
172
|
-
bundle exec middleman slide <name>
|
173
|
-
```
|
174
|
-
|
175
|
-
It is recommended to use a number as name greater than `00`, e.g. `01`. If you
|
176
|
-
leave out the file extension the `slide`-helper will create a Markdown-slide by
|
177
|
-
default. If you want to overwrite this, please create a custom-slide-template -
|
178
|
-
see [Custom Templates](#custom_templates) for more information.
|
179
|
-
|
180
|
-
```bash
|
181
|
-
bundle exec middleman slide 01
|
182
|
-
```
|
183
|
-
|
184
|
-
If you enter duplicate slide names, e.g. "02.md" and "02.erb", the
|
185
|
-
`slide`-command will fail. It is not possible to serve files with the same base
|
186
|
-
name - e.g. "02" - via `middleman`.
|
187
|
-
|
188
|
-
```bash
|
189
|
-
bundle exec middleman slide 02.md 02.erb
|
190
|
-
# => will fail
|
191
|
-
```
|
192
|
-
|
193
|
-
If you prefer another template language you can provide that information as
|
194
|
-
part of the slide name. Today only `embedded ruby`, `markdown` and `liquid`-templates are supported.
|
195
|
-
|
196
|
-
```bash
|
197
|
-
# embedded ruby
|
198
|
-
bundle exec middleman slide 01.erb
|
199
|
-
|
200
|
-
# markdown
|
201
|
-
bundle exec middleman slide 01.md
|
202
|
-
bundle exec middleman slide 01.markdown
|
203
|
-
|
204
|
-
# liquid
|
205
|
-
bundle exec middleman slide 01.l
|
206
|
-
bundle exec middleman slide 01.liquid
|
207
|
-
```
|
208
|
-
|
209
|
-
To set a title for the slide use the `--title`-switch.
|
210
|
-
|
211
|
-
```bash
|
212
|
-
bundle exec middleman slide 01 --title 'my Title'
|
213
|
-
```
|
214
|
-
|
215
|
-
If you want to create multiple slides at once, this is possible to. Just ask
|
216
|
-
`middleman-presentation` to do this.
|
217
|
-
|
218
|
-
```bash
|
219
|
-
bundle exec middleman slide 01 02 03
|
220
|
-
```
|
221
|
-
|
222
|
-
There are some more options available. Please use the `help`-command to get an
|
223
|
-
overview.
|
224
|
-
|
225
|
-
```bash
|
226
|
-
bundle exec middleman help slide
|
227
|
-
```
|
228
|
-
|
229
|
-
Both provide the possibility to change the port where middleman should listen
|
230
|
-
on. Use `-h` check on available options.
|
231
|
-
|
232
|
-
### Edit slide
|
233
|
-
|
234
|
-
To edit the slide after creating it use the `--edit`-switch. It uses the
|
235
|
-
`$EDITOR`-environment variable and falls back to `vim`.
|
236
|
-
|
237
|
-
```bash
|
238
|
-
bundle exec middleman slide 01 --edit
|
239
|
-
```
|
240
|
-
|
241
|
-
If you want to edit an alread created slide, you can use the
|
242
|
-
`slide`-command as well. It creates slides if they do not exist and opens them
|
243
|
-
in your favorit editor (ENV['EDITOR']) if they already exist.
|
244
|
-
|
245
|
-
In some cases you might want to use a different editor-command. To change the
|
246
|
-
editor used or the arguments used, you can run `middleman-presentation` with
|
247
|
-
the `--editor-command`-switch.
|
248
|
-
|
249
|
-
```bash
|
250
|
-
bundle exec middleman slide --edit --editor-command "nano" 01 02 03
|
251
|
-
```
|
252
|
-
|
253
|
-
The `editor-command`-string is also parsed by Erubis which makes the data
|
254
|
-
available in `metadata.yml` accessible to you. You can use this to start a vim server
|
255
|
-
with the presentation's project id as server name. This can be handy if you work more
|
256
|
-
or less simultaneously on diffent presentations. To make the use of the project
|
257
|
-
id as server name more stable you should use [`Shellwords.shellescape`](http://www.ruby-doc.org/stdlib-2.1.2/libdoc/shellwords/rdoc/Shellwords.html#method-c-shellescape).
|
258
|
-
|
259
|
-
```bash
|
260
|
-
bundle exec middleman slide --edit --editor-command "vim --servername <%= Shellwords.shellescape(project_id) %> --remote-tab 2>/dev/null" 01 02 03
|
261
|
-
```
|
262
|
-
|
263
|
-
### Remove a slide
|
264
|
-
|
265
|
-
If you remove a slide while `middleman` is showing the presentation, you might
|
266
|
-
experience some weird errors. Please restart `middleman` after you removed a
|
267
|
-
slide and everything will be fine again.
|
268
|
-
|
269
|
-
### Export presentation
|
270
|
-
|
271
|
-
If you need to export the presentation, you can use the `export`-script. It
|
272
|
-
creates tar-file in `<root>/pkg/<presentation_directory_name>.tar.gz`.
|
273
|
-
|
274
|
-
```bash
|
275
|
-
script/export
|
276
|
-
# => Creates tar-file in <root>/pkg/<presentation_directory_name>.tar.gz
|
277
|
-
```
|
278
|
-
|
279
|
-
## Reuse existing presentation
|
280
|
-
|
281
|
-
*Bootstrap*
|
282
|
-
|
283
|
-
Bootstrap the presentation environment.
|
284
|
-
|
285
|
-
```bash
|
286
|
-
script/bootstrap
|
287
|
-
# => Installs all needed software components
|
288
|
-
```
|
289
|
-
|
290
|
-
*Start presentation*
|
291
|
-
|
292
|
-
To start your presentation use the `start`-script.
|
293
|
-
|
294
|
-
```bash
|
295
|
-
script/start
|
296
|
-
```
|
297
|
-
|
298
|
-
### Ignore slides
|
299
|
-
|
300
|
-
*Introduction*
|
301
|
-
|
302
|
-
Sometimes you may want to slides to be available in the filesystem, but not
|
303
|
-
part of your presentation. To make this possible you can use the
|
304
|
-
`.slidesignore`-file. If you prefer a different name, change the
|
305
|
-
configuration-option `:slides_ignore_file`.
|
306
|
-
|
307
|
-
*Patterns*
|
308
|
-
|
309
|
-
Every line is a regular expression checked against the file names of existing
|
310
|
-
slides. To "unignore" particular slides, you can prefix your pattern with "!".
|
311
|
-
|
312
|
-
```config
|
313
|
-
# ignore all slides ending with *.md
|
314
|
-
.*\.md
|
315
|
-
# unignore 01.html.md
|
316
|
-
!01.html.md
|
317
|
-
```
|
318
|
-
|
319
|
-
|
320
|
-
## Creating slides
|
321
|
-
|
322
|
-
### Introduction
|
323
|
-
|
324
|
-
You need to decide if you want to create slides in pure HTML or if you want to
|
325
|
-
use [`Markdown`](http://daringfireball.net/projects/markdown/syntax). It's up
|
326
|
-
to you to make your choice. In most cases you should get along with `Markdown`
|
327
|
-
☺. From version `0.6.0` onwards
|
328
|
-
[`kramdown`](http://kramdown.gettalong.org/syntax.html) is used to parsed
|
329
|
-
Markdown. because it supports "Attribute List Definitions" which can be used,
|
330
|
-
to provide HTML-attributes to Markdown-elements. Something similar to what
|
331
|
-
[reveal.js](https://github.com/hakimel/reveal.js/#element-attributes) does.
|
332
|
-
|
333
|
-
### Grouping Slides
|
334
|
-
<a name="grouping_slides"></a>
|
335
|
-
|
336
|
-
`reveal.js` has a feature called "vertical slides". You can use this to add
|
337
|
-
"additional" slides to your presentation to add some auxiliary information.
|
338
|
-
To use this feature you need to place slides grouped together in a directory.
|
339
|
-
|
340
|
-
```
|
341
|
-
# Single slide without namespace
|
342
|
-
01.html.erb
|
343
|
-
|
344
|
-
# Group "02_hello" of three slides namespace by 02_hello
|
345
|
-
02_hello/01.html.erb
|
346
|
-
02_hello/02.html.erb
|
347
|
-
02_hello/03.html.erb
|
348
|
-
|
349
|
-
# Group "03_world" of two slides namespace by 03_world
|
350
|
-
03_world/01.html.erb
|
351
|
-
03_world/02.html.erb
|
352
|
-
```
|
353
|
-
|
354
|
-
If you prefer to use the `slide`-command to create your slides, you can create a
|
355
|
-
namespaced slide by using the following synatx:
|
356
|
-
|
357
|
-
```
|
358
|
-
bundle exec middleman slide 02_hello:01
|
359
|
-
```
|
360
|
-
|
361
|
-
Those commands will create a directory named `02_hello` and a file named `01.html.erb`.
|
362
|
-
|
363
|
-
## Use external resources
|
364
|
-
|
365
|
-
I encourage you to use `bower` to make external resources within your presentation
|
366
|
-
available. This works fine together with the asset pipeline `middleman` uses:
|
367
|
-
[sprockets](https://github.com/sstephenson/sprockets). Just add resources to
|
368
|
-
your (existing) `bower.json` and make yourself comfortable with bower:
|
369
|
-
http://bower.io/. Reference the resources from within your
|
370
|
-
`javascripts/application.js` and/or
|
371
|
-
`stylesheets/application.scss`
|
372
|
-
|
373
|
-
By using `bower` for external resources you can better separate the slide
|
374
|
-
content from your styles.
|
375
|
-
|
376
|
-
If you created your presentation using the `middleman-presentation`-command,
|
377
|
-
files named "bower.json" and ".bowerrc" should exist. Within "bower.json" you
|
378
|
-
define the dependencies of your presentation. The last one can be used to tell
|
379
|
-
bower where to store the downloaded components.
|
380
|
-
|
381
|
-
To reference your assets you should use helpers. There are helpers avaiable for
|
382
|
-
Ruby-code and for Sass-code.
|
383
|
-
|
384
|
-
* `asset_path(type, name)`, `asset_url(type, name)`:
|
385
|
-
|
386
|
-
To reference an arbitrary type you can use the both *ruby* helpers mentioned above. To
|
387
|
-
reference a JavaScript-file use `asset_path(:js,
|
388
|
-
'<component>/<path>/<file>.js')`.
|
389
|
-
|
390
|
-
* `font-path(name)`, `font-url(name)`, `image-path(name)`, `image-url(name)`:
|
391
|
-
|
392
|
-
The helpers above can be used to reference assets in Sass-files. You need to
|
393
|
-
provide name to reference the asset, e.g.
|
394
|
-
`font-path('<component>/<path>/<file>.ttf')`.
|
395
|
-
|
396
|
-
To import Css- and Sass-files you should use the `@import`-command. To import
|
397
|
-
JavaScript-files from JavaScript-files you should use the `//=
|
398
|
-
require`-command.
|
399
|
-
|
400
|
-
Please see [sass](http://sass-lang.com/documentation/file.SASS_REFERENCE.html)
|
401
|
-
and [sprockets](https://github.com/sstephenson/sprockets) for more information
|
402
|
-
about that topic.
|
403
|
-
|
404
|
-
## Creating themes
|
405
|
-
|
406
|
-
To create your own theme for `middleman-presentation`, you should use the
|
407
|
-
`theme`-command. It will create a new directory in the current directory
|
408
|
-
(`$PWD`) based on the name for the template, e.g. `new_theme`.
|
409
|
-
|
410
|
-
```
|
411
|
-
cd my_presentation
|
412
|
-
middleman-presentation create theme new_theme
|
413
|
-
```
|
414
|
-
|
415
|
-
Or if you want to get a more or less empty stylesheet, run it with
|
416
|
-
`--clean-css`.
|
417
|
-
|
418
|
-
```
|
419
|
-
cd my_presentation
|
420
|
-
middleman-presentation create theme new_theme --clean-css
|
421
|
-
```
|
422
|
-
|
423
|
-
After that a directory `new_theme` exists with some sub-directories:
|
424
|
-
|
425
|
-
* `javascripts`: Javascript-file go here
|
426
|
-
* `stylesheets`: Stylesheets (CSS, SCSS, ..) go here
|
427
|
-
* `images`: Image go here
|
428
|
-
|
429
|
-
To use your newly created files you need to modify the
|
430
|
-
`middleman-presentation`-configuration file and add the following yaml-snippet
|
431
|
-
to the file - see [Configuration](#configuration) for more about the
|
432
|
-
`middleman-presentation`-configuration file.
|
433
|
-
|
434
|
-
```yaml
|
435
|
-
theme:
|
436
|
-
name: new_theme
|
437
|
-
github: <github_account>/<repository>
|
438
|
-
javascripts:
|
439
|
-
- javascripts/<name>
|
440
|
-
stylesheets:
|
441
|
-
- stylesheets/<name>
|
442
|
-
```
|
443
|
-
|
444
|
-
If you prefer to learn by example, look at the default-theme at
|
445
|
-
[github](https://github.com/maxmeyer/middleman-presentation-theme-default).
|
446
|
-
|
447
|
-
To give you an overview about all css-classes used within templates, issue the
|
448
|
-
`style`-command. This will print every available css-class to style existing
|
449
|
-
templates. Each of those classes is prefixed with `mp-`.
|
450
|
-
|
451
|
-
```bash
|
452
|
-
middleman-presentation show style
|
453
|
-
# => mp-speaker
|
454
|
-
# => [...]
|
455
|
-
```
|
456
|
-
|
457
|
-
## Creating slide templates
|
458
|
-
|
459
|
-
### Normal slide templates
|
460
|
-
|
461
|
-
<a name="normal_slide_templates"></a>
|
462
|
-
|
463
|
-
To create slides using the `slide`-command templates are used. They are written in
|
464
|
-
Eruby (erb). For a good documentation about Eruby see the [Erubis User
|
465
|
-
Guide](http://www.kuwata-lab.com/erubis/users-guide.html). Since `0.11.4`. you
|
466
|
-
can have your own templates which overwrite the default templates.
|
467
|
-
|
468
|
-
You can store those templates in different directories. They are read in the
|
469
|
-
given order.
|
470
|
-
|
471
|
-
1. presentation local templates (`<presentation root>/templates/<template>`)
|
472
|
-
2. user local templates (`~/.config/middleman/presentation/templates/<template>`, `~/.middleman/presentation/templates/<template>`)
|
473
|
-
3. system local templates (`/etc/middleman/presentation/templates/<template>`)
|
474
|
-
|
475
|
-
|
476
|
-
There are four different templates available:
|
477
|
-
|
478
|
-
* Erb (`erb.tt`): Templates for generating `Erb`-slides
|
479
|
-
* Markdown (`markdown.tt`): Templates for generating `markdown`-slides
|
480
|
-
* Liquid (`liquid.tt`): Templates for generating `liquid`-slides
|
481
|
-
* Group (`group.tt`): Templates for groups of slides - see [Grouping Slides](#grouping_slides).
|
482
|
-
|
483
|
-
### Custom slide templates
|
484
|
-
|
485
|
-
<a name="custom_templates"></a>
|
486
|
-
|
487
|
-
Addiontionlly users can define one `custom`-slide-template. It's file extension
|
488
|
-
is used for the resulting slide. Given a template `custom.erb.tt` it becomes
|
489
|
-
`01.html.erb` when running `middleman slide 01`.
|
490
|
-
|
491
|
-
You may need to add the
|
492
|
-
template parser-gem to your `Gemfile` and require it in your `config.rb`.
|
493
|
-
|
494
|
-
**Example**
|
495
|
-
|
496
|
-
Given you want to create a presentation local custom slide template with haml
|
497
|
-
as template language. The created slides should automatically get `.haml` as
|
498
|
-
file extension. First you need to create the template directory.
|
499
|
-
|
500
|
-
```bash
|
501
|
-
# Switch to the directory containing your presentation
|
502
|
-
cd my_presentation
|
503
|
-
|
504
|
-
# Create template directory
|
505
|
-
mkdir -p templates
|
506
|
-
```
|
507
|
-
|
508
|
-
Next you need to create the template itself using your favourite template
|
509
|
-
language. If you want to use information like the presentation title, don't forget the
|
510
|
-
template itself is parsed by `Erubis` before it is stored as slide in the file
|
511
|
-
system.
|
512
|
-
|
513
|
-
*templates/custom.haml.tt*:
|
514
|
-
|
515
|
-
```
|
516
|
-
%section
|
517
|
-
%h1 Site Title
|
518
|
-
%h2 <%%= title %>
|
519
|
-
```
|
520
|
-
|
521
|
-
After writing the file to the filesystem you can use it with the
|
522
|
-
`slide`-command to create slide by running the following code.
|
523
|
-
|
524
|
-
```bash
|
525
|
-
# => creates source/slides/01.html.haml
|
526
|
-
bundle exec middleman slide 01
|
527
|
-
```
|
528
|
-
|
529
|
-
If you have more than one "custom"-template the first is one used. The order is
|
530
|
-
based on file name.
|
531
|
-
|
532
|
-
### Predefined slide templates
|
533
|
-
|
534
|
-
There are four predefined slide templates available:
|
535
|
-
|
536
|
-
* Start slide
|
537
|
-
* Slide name: `00.html.erb.tt`
|
538
|
-
* Questions slide
|
539
|
-
* Slide name: `999980.html.erb.tt`
|
540
|
-
* Contact slide
|
541
|
-
* Slide name: `999981.html.erb.tt`
|
542
|
-
* End slide
|
543
|
-
* Slide name: `999982.html.erb.tt`
|
544
|
-
|
545
|
-
If you place templates in one of the template directories - see [Normal Slide
|
546
|
-
Templates](#normal_slide_templates) for the concrete paths -
|
547
|
-
`middleman-presentation` will use your templates instead of the ones comming
|
548
|
-
with the gem.
|
549
|
-
|
550
|
-
If you want to modify the existing predefined slides, run the following command first,
|
551
|
-
it will copy the files to
|
552
|
-
`~/.config/middleman/presentation/templates/predefined_slides.d`.
|
553
|
-
|
554
|
-
```
|
555
|
-
middleman-presentation init predefined_slides
|
556
|
-
```
|
557
|
-
|
558
|
-
## Configuration
|
559
|
-
|
560
|
-
<a name="configuration"></a>
|
561
|
-
|
562
|
-
`middleman-presentation` will try to find its configuration file at different places:
|
563
|
-
|
564
|
-
1. User local: `~/.config/middleman/presentation/presentations.yaml`, `~/.middleman/presentation/presentations.yaml`
|
565
|
-
2. System local: `/etc/middleman/presentation/presentations`
|
566
|
-
|
567
|
-
To get a full list of available configuration options and their values, run the following command
|
568
|
-
|
569
|
-
```
|
570
|
-
middleman-presentation show config
|
571
|
-
```
|
572
|
-
|
573
|
-
To get a full list of available configuration options and their default values, run the following command
|
574
|
-
|
575
|
-
```
|
576
|
-
middleman-presentation show config --defaults
|
577
|
-
```
|
578
|
-
|
579
|
-
## Development
|
580
|
-
|
581
|
-
Make sure you've got a working internet connection before running the tests. To
|
582
|
-
keep the source code repository lean there tests that download assets via bower.
|
583
|
-
|
584
|
-
If you care about licensing, please have a look at [LICENSE.txt](LICENSE.txt).
|
585
|
-
As this software would not be possible without the wonderful gems out there,
|
586
|
-
there's also an overview about all the licenses used by the required gems at
|
587
|
-
[doc/licenses/dependencies.html](doc/licenses/dependencies.html).
|
588
|
-
|
589
|
-
If you get some weird errors during testing, make sure have got enough space at
|
590
|
-
`/tmp`. This directory is used by `bower` to temporary store downloaded assets.
|
591
|
-
|
592
|
-
To check which file consumes the whole space at `/tmp` you can use the following command:
|
593
|
-
|
594
|
-
```bash
|
595
|
-
# output sizes in mebibytes and sort numerically
|
596
|
-
du -ms /tmp/* | sort -n
|
597
|
-
```
|
598
|
-
|
599
|
-
To find the process which uses this file, run this command:
|
600
|
-
|
601
|
-
```bash
|
602
|
-
lsof <file>
|
603
|
-
```
|
604
|
-
|
605
|
-
## Contributing
|
606
|
-
|
607
|
-
Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file.
|
608
|
-
|