slideoff 0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +3 -0
- data/MIT-LICENSE +20 -0
- data/README.md +218 -0
- data/bin/slideoff +127 -0
- data/lib/slideoff/config_builder.rb +60 -0
- data/lib/slideoff/flickr_api.rb +50 -0
- data/lib/slideoff/flickr_image.rb +92 -0
- data/lib/slideoff/markdown.rb +145 -0
- data/lib/slideoff/presentation.rb +90 -0
- data/lib/slideoff/remote_api.rb +53 -0
- data/lib/slideoff/routes.rb +20 -0
- data/lib/slideoff/server.rb +50 -0
- data/lib/slideoff/slides_api.rb +59 -0
- data/lib/slideoff/utils.rb +453 -0
- data/lib/slideoff.rb +15 -0
- data/themes/3d_slideshow/README +2 -0
- data/themes/3d_slideshow/css/main.css +232 -0
- data/themes/3d_slideshow/css/reset.css +57 -0
- data/themes/3d_slideshow/index.erb +31 -0
- data/themes/3d_slideshow/js/slideshow.js +288 -0
- data/themes/CSSS/README +2 -0
- data/themes/CSSS/css/slideshow.css +304 -0
- data/themes/CSSS/css/theme.css +250 -0
- data/themes/CSSS/images/rainbow-wood.jpg +0 -0
- data/themes/CSSS/index.erb +36 -0
- data/themes/CSSS/js/classList.js +116 -0
- data/themes/CSSS/js/prefixfree.min.js +5 -0
- data/themes/CSSS/js/slideshow.js +621 -0
- data/themes/common/css/pygments/colorful.css +62 -0
- data/themes/common/css/pygments/manni.css +61 -0
- data/themes/common/css/pygments/native.css +70 -0
- data/themes/common/css/pygments/solarized.css +66 -0
- data/themes/common/fonts/DroidSansMono.svg +626 -0
- data/themes/common/fonts/DroidSansMono.ttf +0 -0
- data/themes/common/fonts/Lato-BoldItalic.woff +0 -0
- data/themes/common/fonts/Lato-Italic.woff +0 -0
- data/themes/common/fonts/Lato-bold.woff +0 -0
- data/themes/common/fonts/Lato.woff +0 -0
- data/themes/common/fonts/OpenSans-Bold.woff +0 -0
- data/themes/common/fonts/OpenSans-BoldItalic.woff +0 -0
- data/themes/common/fonts/OpenSans-Italic.woff +0 -0
- data/themes/common/fonts/OpenSans.woff +0 -0
- data/themes/common/fonts/PTMono.woff +0 -0
- data/themes/common/fonts/PTSans.Bold.Italic.woff +0 -0
- data/themes/common/fonts/PTSans.Bold.woff +0 -0
- data/themes/common/fonts/PTSans.Italic.woff +0 -0
- data/themes/common/fonts/PTSans.Narrow.Bold.woff +0 -0
- data/themes/common/fonts/PTSans.Narrow.woff +0 -0
- data/themes/common/fonts/PTSans.woff +0 -0
- data/themes/common/fonts/TargetBlank.otf +0 -0
- data/themes/common/fonts/TargetBlank.svg +14 -0
- data/themes/common/fonts/YanoneKaffeesatz-Bold.woff +0 -0
- data/themes/common/fonts/YanoneKaffeesatz-Regular.woff +0 -0
- data/themes/common/fonts/crimson_text.ttf +0 -0
- data/themes/common/fonts/crimson_text_bold.ttf +0 -0
- data/themes/common/fonts/crimson_text_semibold.ttf +0 -0
- data/themes/common/fonts/league_gothic-webfont.ttf +0 -0
- data/themes/html5rocks/README +2 -0
- data/themes/html5rocks/css/default.css +501 -0
- data/themes/html5rocks/css/moon.css +543 -0
- data/themes/html5rocks/css/sand.css +508 -0
- data/themes/html5rocks/css/sea_wave.css +492 -0
- data/themes/html5rocks/index.erb +64 -0
- data/themes/html5rocks/js/slides.js +464 -0
- data/themes/io2012/README +2 -0
- data/themes/io2012/css/default.css +1481 -0
- data/themes/io2012/css/fonts.css +24 -0
- data/themes/io2012/css/phone.css +27 -0
- data/themes/io2012/images/google_developers_icon_128.png +0 -0
- data/themes/io2012/images/io2012_logo.png +0 -0
- data/themes/io2012/index.erb +73 -0
- data/themes/io2012/js/hammer.js +586 -0
- data/themes/io2012/js/modernizr.custom.45394.js +4 -0
- data/themes/io2012/js/order.js +8 -0
- data/themes/io2012/js/polyfills/classList.min.js +2 -0
- data/themes/io2012/js/polyfills/dataset.min.js +2 -0
- data/themes/io2012/js/polyfills/history.min.js +1 -0
- data/themes/io2012/js/prettify/lang-apollo.js +2 -0
- data/themes/io2012/js/prettify/lang-clj.js +18 -0
- data/themes/io2012/js/prettify/lang-css.js +2 -0
- data/themes/io2012/js/prettify/lang-go.js +1 -0
- data/themes/io2012/js/prettify/lang-hs.js +2 -0
- data/themes/io2012/js/prettify/lang-lisp.js +3 -0
- data/themes/io2012/js/prettify/lang-lua.js +2 -0
- data/themes/io2012/js/prettify/lang-ml.js +2 -0
- data/themes/io2012/js/prettify/lang-n.js +4 -0
- data/themes/io2012/js/prettify/lang-proto.js +1 -0
- data/themes/io2012/js/prettify/lang-scala.js +2 -0
- data/themes/io2012/js/prettify/lang-sql.js +2 -0
- data/themes/io2012/js/prettify/lang-tex.js +1 -0
- data/themes/io2012/js/prettify/lang-vb.js +2 -0
- data/themes/io2012/js/prettify/lang-vhdl.js +3 -0
- data/themes/io2012/js/prettify/lang-wiki.js +2 -0
- data/themes/io2012/js/prettify/lang-xq.js +3 -0
- data/themes/io2012/js/prettify/lang-yaml.js +2 -0
- data/themes/io2012/js/prettify/prettify.css +1 -0
- data/themes/io2012/js/prettify/prettify.js +28 -0
- data/themes/io2012/js/require-1.0.8.min.js +33 -0
- data/themes/io2012/js/slide-controller.js +109 -0
- data/themes/io2012/js/slide-deck.js +768 -0
- data/themes/io2012/js/slides.js +5 -0
- data/themes/memories/README +5 -0
- data/themes/memories/css/fonts.css +25 -0
- data/themes/memories/css/slideshow.css +286 -0
- data/themes/memories/css/theme.css +183 -0
- data/themes/memories/index.erb +37 -0
- data/themes/memories/js/prefixfree.min.js +13 -0
- data/themes/memories/js/slideshow.js +577 -0
- data/themes/modern/LICENSE +20 -0
- data/themes/modern/README.md +52 -0
- data/themes/modern/css/GENERATED_CONTENT +0 -0
- data/themes/modern/css/defaults.css +0 -0
- data/themes/modern/css/fonts.css +166 -0
- data/themes/modern/css/pygments/colorful.css +215 -0
- data/themes/modern/css/pygments/github.css +208 -0
- data/themes/modern/css/pygments/solarized-dark.css +213 -0
- data/themes/modern/css/pygments/solarized-light.css +213 -0
- data/themes/modern/css/reset.css +41 -0
- data/themes/modern/css/screen.css +1183 -0
- data/themes/modern/fonts/Collegiate.woff +0 -0
- data/themes/modern/fonts/GoudyBookletter.1911.woff +0 -0
- data/themes/modern/fonts/Inconsolata.Bold.woff +0 -0
- data/themes/modern/fonts/Inconsolata.woff +0 -0
- data/themes/modern/fonts/Junction.woff +0 -0
- data/themes/modern/fonts/LiberationMono.Bold.woff +0 -0
- data/themes/modern/fonts/LiberationMono.BoldItalic.woff +0 -0
- data/themes/modern/fonts/LiberationMono.Italic.woff +0 -0
- data/themes/modern/fonts/LiberationMono.Regular.woff +0 -0
- data/themes/modern/fonts/OpenSans.Bold.woff +0 -0
- data/themes/modern/fonts/OpenSans.BoldItalic.woff +0 -0
- data/themes/modern/fonts/OpenSans.ExtraBold.woff +0 -0
- data/themes/modern/fonts/OpenSans.ExtraBoldItalic.woff +0 -0
- data/themes/modern/fonts/OpenSans.Italic.woff +0 -0
- data/themes/modern/fonts/OpenSans.Light.woff +0 -0
- data/themes/modern/fonts/OpenSans.LightItalic.woff +0 -0
- data/themes/modern/fonts/OpenSans.Regular.woff +0 -0
- data/themes/modern/fonts/OpenSans.Semibold.woff +0 -0
- data/themes/modern/fonts/OpenSans.SemiboldItalic.woff +0 -0
- data/themes/modern/fonts/PTMono.woff +0 -0
- data/themes/modern/fonts/PTSans.Bold.Italic.woff +0 -0
- data/themes/modern/fonts/PTSans.Bold.woff +0 -0
- data/themes/modern/fonts/PTSans.Italic.woff +0 -0
- data/themes/modern/fonts/PTSans.Narrow.Bold.woff +0 -0
- data/themes/modern/fonts/PTSans.woff +0 -0
- data/themes/modern/fonts/Raleway.Thin.woff +0 -0
- data/themes/modern/fonts/STIXGeneral.Bold.woff +0 -0
- data/themes/modern/fonts/STIXGeneral.BoldItalic.woff +0 -0
- data/themes/modern/fonts/STIXGeneral.Italic.woff +0 -0
- data/themes/modern/fonts/STIXGeneral.Regular.woff +0 -0
- data/themes/modern/fonts/YanoneKaffeesatz.Bold.woff +0 -0
- data/themes/modern/fonts/YanoneKaffeesatz.ExtraLight.woff +0 -0
- data/themes/modern/fonts/YanoneKaffeesatz.Light.woff +0 -0
- data/themes/modern/fonts/YanoneKaffeesatz.Regular.woff +0 -0
- data/themes/modern/images/cc/by.svg +29 -0
- data/themes/modern/images/cc/cc-white.svg +23 -0
- data/themes/modern/images/cc/cc.svg +23 -0
- data/themes/modern/images/cc/nc-eu.svg +21 -0
- data/themes/modern/images/cc/nc-jp.svg +18 -0
- data/themes/modern/images/cc/nc.svg +23 -0
- data/themes/modern/images/cc/nd.svg +20 -0
- data/themes/modern/images/cc/pd.svg +24 -0
- data/themes/modern/images/cc/remix.svg +20 -0
- data/themes/modern/images/cc/sa.svg +22 -0
- data/themes/modern/images/cc/sampling.plus.svg +33 -0
- data/themes/modern/images/cc/sampling.svg +36 -0
- data/themes/modern/images/cc/share.svg +22 -0
- data/themes/modern/images/cc/zero.svg +24 -0
- data/themes/modern/images/flickr.svg +65 -0
- data/themes/modern/images/mesh.png +0 -0
- data/themes/modern/images/mesh@2x.png +0 -0
- data/themes/modern/images/progress-grayDark.svg +55 -0
- data/themes/modern/images/progress.svg +3 -0
- data/themes/modern/index.erb +76 -0
- data/themes/modern/js/highcharts.js +294 -0
- data/themes/modern/js/jquery-2.1.0.min.js +4 -0
- data/themes/modern/js/script.coffee +480 -0
- data/themes/modern/js/script.js +678 -0
- data/themes/modern/styles/_box.scss +89 -0
- data/themes/modern/styles/_figure.scss +81 -0
- data/themes/modern/styles/_full.scss +74 -0
- data/themes/modern/styles/_increment.scss +38 -0
- data/themes/modern/styles/_list.scss +129 -0
- data/themes/modern/styles/_progress.scss +19 -0
- data/themes/modern/styles/defaults.scss +46 -0
- data/themes/modern/styles/fonts.scss +197 -0
- data/themes/modern/styles/pygments/_solarized.scss +82 -0
- data/themes/modern/styles/pygments/colorful.scss +67 -0
- data/themes/modern/styles/pygments/github.scss +67 -0
- data/themes/modern/styles/pygments/solarized-dark.scss +15 -0
- data/themes/modern/styles/pygments/solarized-light.scss +15 -0
- data/themes/modern/styles/reset.scss +46 -0
- data/themes/modern/styles/screen.scss +841 -0
- data/themes/reveal/README +2 -0
- data/themes/reveal/css/main.css +1029 -0
- data/themes/reveal/css/reset.css +57 -0
- data/themes/reveal/index.erb +102 -0
- data/themes/reveal/js/classList.js +2 -0
- data/themes/reveal/js/head.min.js +8 -0
- data/themes/reveal/js/reveal.js +951 -0
- data/themes/shower/README +2 -0
- data/themes/shower/css/fonts.css +50 -0
- data/themes/shower/css/reset.css +42 -0
- data/themes/shower/css/style.css +418 -0
- data/themes/shower/images/grid.png +0 -0
- data/themes/shower/images/linen.png +0 -0
- data/themes/shower/images/ribbon.svg +4 -0
- data/themes/shower/index.erb +35 -0
- data/themes/shower/js/script.js +325 -0
- data/themes/template/README +5 -0
- data/themes/template/css/reset.css +42 -0
- data/themes/template/index.erb +35 -0
- data/themes/template/js/prefixfree.min.js +13 -0
- metadata +343 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 87edcce9bece900268c1ae4cb9470fa69283d469
|
4
|
+
data.tar.gz: 128ac25f3d45253eb3ec9a48109a916c409c5724
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ef2ff59adab75e9f16ea05d26243ea442975057818ccd5b2b3731babbc305e5873926a23b8f4f1a4bb6d392b086d21967e64923d6994ce2dabbda129742c05f3
|
7
|
+
data.tar.gz: 0498a98e72099a68672d5dbfe29b558471f1a9fe04186d2297a96fdb760bfcf968ca8840f5162f468c4dbfb5bbb576e272d1ab2dae7bdede68a6cf9fe8518980
|
data/Gemfile
ADDED
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Bruno Michel <bruno.michel@af83.com>
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,218 @@
|
|
1
|
+
# Slideoff
|
2
|
+
|
3
|
+
Slideoff is a presentation tool. You write some slides in markdown, choose
|
4
|
+
a style and it displays it in HTML5. With a browser in full-screen, you can
|
5
|
+
make amazing presentations!
|
6
|
+
|
7
|
+
## Requirements
|
8
|
+
|
9
|
+
* **Ruby 1.9.3** or higher
|
10
|
+
* **Sass** for themes with sass files
|
11
|
+
* **CoffeeScript** for themes with coffee files
|
12
|
+
* **pygments** for syntax highlighting
|
13
|
+
* **wget** for static site generation
|
14
|
+
* **python3** for serving static presentation
|
15
|
+
* **git** for installing themes and make your slides version controled
|
16
|
+
* **scp** for uploading to remote host
|
17
|
+
* **Browser** for viewing presentation
|
18
|
+
|
19
|
+
|
20
|
+
## First presentation
|
21
|
+
|
22
|
+
1. `gem install slideoff` Install Slideoff
|
23
|
+
1. `slideoff init mypres` Initialize presentation in `mypres/`
|
24
|
+
1. `$EDITOR presentation.json` and add your Flickr API key
|
25
|
+
1. `$EDITOR main/index.md` Edit your slides
|
26
|
+
1. `slideoff serve` Start server
|
27
|
+
1. Open <http://localhost:9000/>
|
28
|
+
1. Use the arrows keys to navigate between slides
|
29
|
+
|
30
|
+
## Themes
|
31
|
+
|
32
|
+
Several themes are available: `io2012`, `shower`, `3d_slideshow`, `reveal`,
|
33
|
+
`html5rocks`, `CSSS`, `memories` and `modern`. To choose the theme for your
|
34
|
+
presentation, edit the `presentation.json` file and change the `"theme"`
|
35
|
+
element.
|
36
|
+
|
37
|
+
You can also create your own theme, for example, by copying the template:
|
38
|
+
|
39
|
+
```sh
|
40
|
+
mkdir -p ~/.slideoff
|
41
|
+
cp -r themes/template ~/.slideoff/my-theme
|
42
|
+
$EDITOR ~/.slideoff/my-theme/README
|
43
|
+
```
|
44
|
+
|
45
|
+
|
46
|
+
## Markup for the slides
|
47
|
+
|
48
|
+
This slides are writen in [Markdown](http://daringfireball.net/projects/markdown/syntax)
|
49
|
+
and `!SLIDE` is the indicator for a new slide.
|
50
|
+
|
51
|
+
Example:
|
52
|
+
|
53
|
+
!SLIDE
|
54
|
+
# Title of the first slide #
|
55
|
+
## A subtitle ##
|
56
|
+
And some text...
|
57
|
+
|
58
|
+
!SLIDE
|
59
|
+
# Another slide #
|
60
|
+
|
61
|
+
* a
|
62
|
+
* bullet
|
63
|
+
* list
|
64
|
+
|
65
|
+
!SLIDE
|
66
|
+
# Third slide #
|
67
|
+
|
68
|
+
1. **bold**
|
69
|
+
2. _italics_
|
70
|
+
3. https://github.com/
|
71
|
+
|
72
|
+
Many more additional elements are added. See `main/index.md` after initialization to get an example.
|
73
|
+
|
74
|
+
|
75
|
+
## Syntax Highlighting
|
76
|
+
|
77
|
+
To highlight some code in your slides, you have to install
|
78
|
+
[pygments](http://pygments.org/). Then, surround your code with backticks
|
79
|
+
like this:
|
80
|
+
|
81
|
+
```ruby
|
82
|
+
class Foobar
|
83
|
+
def baz
|
84
|
+
puts "Foobar says baz"
|
85
|
+
end
|
86
|
+
end
|
87
|
+
```
|
88
|
+
|
89
|
+
|
90
|
+
##Flickr integration
|
91
|
+
|
92
|
+
To integrate this [Flickr photo (22565509)](https://secure.flickr.com/photos/scoobymoo/22565509) you have to write this:
|
93
|
+
|
94
|
+
```
|
95
|
+
!F[22565509]
|
96
|
+
```
|
97
|
+
|
98
|
+
Only the ID of the photo is relevant. All other information like image source, title, author or license are requested via the Flickr
|
99
|
+
API. So it's important to generate a Flickr API key to have access to the API. You can do it on
|
100
|
+
<https://secure.flickr.com/services/apps/create/>. You have to specify this key in your `presentation.json`.
|
101
|
+
|
102
|
+
|
103
|
+
##Boxes
|
104
|
+
|
105
|
+
```
|
106
|
+
!SLIDE
|
107
|
+
#Boxes
|
108
|
+
|
109
|
+
+++
|
110
|
+
+++Normal box
|
111
|
+
+++Content
|
112
|
+
|
113
|
+
+++shadow
|
114
|
+
+++Box with shadow
|
115
|
+
+++Content
|
116
|
+
|
117
|
+
+++box-alert
|
118
|
+
+++Alert box
|
119
|
+
+++Content
|
120
|
+
```
|
121
|
+
|
122
|
+
|
123
|
+
##Description list
|
124
|
+
|
125
|
+
```
|
126
|
+
!SLIDE
|
127
|
+
#Description list
|
128
|
+
|
129
|
+
Elephant
|
130
|
+
: big animal
|
131
|
+
House
|
132
|
+
: big garage
|
133
|
+
Car
|
134
|
+
: big bike with four wheels
|
135
|
+
Smartphone
|
136
|
+
: smart mobile phone with touch display
|
137
|
+
```
|
138
|
+
|
139
|
+
|
140
|
+
##Change colors
|
141
|
+
|
142
|
+
Highlighting text with red background:
|
143
|
+
|
144
|
+
```
|
145
|
+
==red==text==
|
146
|
+
```
|
147
|
+
|
148
|
+
Red text:
|
149
|
+
|
150
|
+
```
|
151
|
+
__red__text__
|
152
|
+
```
|
153
|
+
|
154
|
+
|
155
|
+
##Incremental view of slide
|
156
|
+
|
157
|
+
If you like to display some information incrementally, you can do it! If you specify an additional slide class `incr-list`
|
158
|
+
and all `li`-HTML-Elements will be displayed after some key strokes. For example:
|
159
|
+
|
160
|
+
```
|
161
|
+
!SLIDE incr-list
|
162
|
+
|
163
|
+
* First item will be displayed after first key stroke
|
164
|
+
* Second item will be displayed after second key stroke
|
165
|
+
* Third item will be displayed after third key stroke
|
166
|
+
```
|
167
|
+
|
168
|
+
If you like to add some opacity to visited elements, you can add `incr-list hover` to `!SLIDE`.
|
169
|
+
|
170
|
+
If you don't like to increment list items only, you can do it more precise. You only have to add `!PAUSE` in your slide. For example:
|
171
|
+
|
172
|
+
```
|
173
|
+
!SLIDE
|
174
|
+
|
175
|
+
This paragraph will be displayed first.
|
176
|
+
|
177
|
+
!PAUSE
|
178
|
+
|
179
|
+
+++box-red shadow
|
180
|
+
+++Box
|
181
|
+
+++This box is displayed after one next key stroke.
|
182
|
+
```
|
183
|
+
|
184
|
+
Try it in your example presentation after initialization.
|
185
|
+
|
186
|
+
## Export to PDF
|
187
|
+
|
188
|
+
Change to list mode with stroking `esc` key and use your normal printer dialog. You have to specify the correct margins and paper dimensions. I added a custom "PX 1024x640" and set width to 270mm and height to 169mm and all margins to 0.
|
189
|
+
|
190
|
+
You can export your presentation to PDF by installing
|
191
|
+
[phantomjs](http://phantomjs.org/) and then run `slideoff2pdf`.
|
192
|
+
|
193
|
+
|
194
|
+
## Issues or Suggestions
|
195
|
+
|
196
|
+
Found an issue or have a suggestion? Please report it on
|
197
|
+
[Github's issue tracker](http://github.com/DSIW/slideoff/issues).
|
198
|
+
|
199
|
+
If you wants to make a pull request, please check the specs before:
|
200
|
+
|
201
|
+
bundle exec spec/slideoff_spec.rb
|
202
|
+
|
203
|
+
|
204
|
+
## Credits
|
205
|
+
|
206
|
+
Bruno Michel is the guy who made [Slide'em up](https://github.com/nono/slide-em-up) and Scott Chacon is the guy who made
|
207
|
+
[ShowOff](https://github.com/schacon/showoff). Slideoff is based on Slide'em up and Showoff.
|
208
|
+
|
209
|
+
Themes were picked from the internet. Thanks to:
|
210
|
+
|
211
|
+
- Hakim El Hattab for 3d_slideshow and reveal
|
212
|
+
- Google for html5rocks
|
213
|
+
- Vadim Makeev for shower
|
214
|
+
- Lea Verou for CSSS (and its modified version, memories)
|
215
|
+
- Google for io2012
|
216
|
+
|
217
|
+
♡2014 by DSIW. Copying is an act of love. Please copy and share.
|
218
|
+
Released under the MIT license
|
data/bin/slideoff
ADDED
@@ -0,0 +1,127 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'gli'
|
5
|
+
|
6
|
+
require "slideoff"
|
7
|
+
|
8
|
+
include GLI::App
|
9
|
+
|
10
|
+
version "0.3.5" # Slideoff::VERSION
|
11
|
+
|
12
|
+
|
13
|
+
desc 'Create new slideoff presentation'
|
14
|
+
arg_name 'dir_name'
|
15
|
+
long_desc 'This command helps start a new slideoff presentation by setting up the proper directory structure for you. It takes the directory name you would like slideoff to create for you.'
|
16
|
+
command [:init] do |c|
|
17
|
+
|
18
|
+
c.action do |global_options,options,args|
|
19
|
+
raise "dir_name is required" if args.empty?
|
20
|
+
Slideoff::Utils.init_directory(args[0])
|
21
|
+
puts "Done. Run 'slideoff serve' in #{args[0]}/ dir to see slideshow"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
desc 'Install new slideoff theme'
|
27
|
+
arg_name 'repository_url'
|
28
|
+
long_desc 'Installs theme under ~/.slideoff.'
|
29
|
+
command [:install_theme] do |c|
|
30
|
+
c.action do |global_options,options,args|
|
31
|
+
raise "repository_url is required" if args.empty?
|
32
|
+
Slideoff::Utils.install_theme(args[0])
|
33
|
+
puts "Done."
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
desc 'Puts your slideoff presentation into a gh-pages branch'
|
39
|
+
long_desc 'Generates a static version of your presentation into your gh-pages branch for publishing to GitHub Pages'
|
40
|
+
command :upload do |c|
|
41
|
+
c.desc 'Port on which to run'
|
42
|
+
c.default_value Slideoff::Server::DEFAULT_PORT
|
43
|
+
c.flag [:p,:port]
|
44
|
+
|
45
|
+
c.action do |global_options,options,args|
|
46
|
+
puts "Generating static content"
|
47
|
+
Slideoff::Utils.upload(options)
|
48
|
+
puts "Uploaded!"
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
desc 'Serves the slideoff presentation in the current directory'
|
54
|
+
command :serve do |c|
|
55
|
+
c.desc 'Show verbose messaging'
|
56
|
+
c.switch :verbose
|
57
|
+
|
58
|
+
c.desc 'Port on which to run'
|
59
|
+
c.default_value Slideoff::Server::DEFAULT_PORT
|
60
|
+
c.flag [:p,:port]
|
61
|
+
|
62
|
+
c.desc 'Host or ip to run on'
|
63
|
+
c.default_value Slideoff::Server::DEFAULT_ADDRESS
|
64
|
+
c.flag [:h,:host]
|
65
|
+
|
66
|
+
c.desc 'API key for remote access'
|
67
|
+
c.flag [:remote_key]
|
68
|
+
|
69
|
+
c.action do |global_options,options,args|
|
70
|
+
server = Slideoff::Server.new(options)
|
71
|
+
puts "Your remote key is #{server.remote_key}\n\n"
|
72
|
+
server.start
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
|
77
|
+
desc 'Generate static version of presentation'
|
78
|
+
long_desc 'Creates a static version of the presentation in "static" directory'
|
79
|
+
command [:static] do |c|
|
80
|
+
c.desc 'Port on which to run'
|
81
|
+
c.default_value Slideoff::Server::DEFAULT_PORT
|
82
|
+
c.flag [:p,:port]
|
83
|
+
|
84
|
+
c.action do |global_options,options,args|
|
85
|
+
Slideoff::Utils.generate_static(options)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
|
90
|
+
desc 'Serves static version of presentation'
|
91
|
+
long_desc 'Serves static version of presentation'
|
92
|
+
command [:serve_static] do |c|
|
93
|
+
c.desc 'Port on which to run'
|
94
|
+
c.default_value "4242"
|
95
|
+
c.flag [:p,:port]
|
96
|
+
|
97
|
+
c.action do |global_options,options,args|
|
98
|
+
if File.basename(Dir.pwd) =~ /^static/
|
99
|
+
Slideoff::Utils.serve_static(options[:port], verbose: true)
|
100
|
+
else
|
101
|
+
Dir.chdir(Slideoff::Utils.static_dir) do |dir|
|
102
|
+
Slideoff::Utils.serve_static(options[:port], verbose: true)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
|
109
|
+
pre do |global,command,options,args|
|
110
|
+
# Pre logic here
|
111
|
+
# Return true to proceed; false to abourt and not call the
|
112
|
+
# chosen command
|
113
|
+
true
|
114
|
+
end
|
115
|
+
|
116
|
+
post do |global,command,options,args|
|
117
|
+
# Post logic here
|
118
|
+
end
|
119
|
+
|
120
|
+
on_error do |exception|
|
121
|
+
# Error logic here
|
122
|
+
# return false to skip default error handling
|
123
|
+
true
|
124
|
+
end
|
125
|
+
|
126
|
+
|
127
|
+
exit run(ARGV)
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require "yajl"
|
4
|
+
require "ostruct"
|
5
|
+
|
6
|
+
module Slideoff
|
7
|
+
class ConfigBuilder < OpenStruct
|
8
|
+
DEFAULT = {
|
9
|
+
"title" => "No title",
|
10
|
+
"theme" => "shower",
|
11
|
+
"duration" => 60,
|
12
|
+
"author" => "Max Mustermann",
|
13
|
+
"pygments_style" => "colorful"
|
14
|
+
}
|
15
|
+
SECTION_DEFAULT = {
|
16
|
+
"show_chapter" => true,
|
17
|
+
"show_toc" => true
|
18
|
+
}
|
19
|
+
|
20
|
+
def initialize(_dir)
|
21
|
+
infos = extract_normal_infos(_dir) || extract_infos_from_showoff(_dir) || {}
|
22
|
+
|
23
|
+
unless infos.empty?
|
24
|
+
infos = DEFAULT.merge({dir: _dir}.merge(infos))
|
25
|
+
infos['sections'] = infos['sections'].reduce({}) do |new_hash, (k, hash)|
|
26
|
+
new_hash.merge!(k => SECTION_DEFAULT.merge(hash))
|
27
|
+
end
|
28
|
+
Dir.chdir(_dir) do
|
29
|
+
infos['css'] = Dir["**/*.css"]
|
30
|
+
infos['js'] = Dir["**/*.js"]
|
31
|
+
end
|
32
|
+
ENV["FLICKR_API_KEY"] = infos['flickr_api_key']
|
33
|
+
end
|
34
|
+
|
35
|
+
super(infos)
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def extract_normal_infos(dir)
|
41
|
+
parse_file(dir, "presentation")
|
42
|
+
end
|
43
|
+
|
44
|
+
def extract_infos_from_showoff(dir)
|
45
|
+
infos = parse_file(dir, "showoff")
|
46
|
+
sections = infos["sections"].map {|s| s["section"] }
|
47
|
+
{
|
48
|
+
"title" => infos["name"],
|
49
|
+
"theme" => "showoff",
|
50
|
+
"sections" => sections
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
def parse_file(dir, file)
|
55
|
+
filename = "#{dir}/#{file}.json"
|
56
|
+
return {} unless File.exists?(filename)
|
57
|
+
Yajl::Parser.parse(File.read filename)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'net/http'
|
4
|
+
require 'json'
|
5
|
+
|
6
|
+
module Slideoff
|
7
|
+
class FlickrAPIException < Exception
|
8
|
+
def initialize(code, message)
|
9
|
+
@code = code
|
10
|
+
@message = message
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.from_json(json)
|
14
|
+
new(json['code'], json['message'])
|
15
|
+
end
|
16
|
+
|
17
|
+
def to_s
|
18
|
+
"#{@message} [Code: #{@code}]"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
class FlickrAPI
|
23
|
+
ENDPOINT = "https://api.flickr.com/services/rest/"
|
24
|
+
|
25
|
+
DEFAULT_PARAMS = {
|
26
|
+
:api_key => CONFIG.flickr_api_key,
|
27
|
+
:format => :json,
|
28
|
+
:nojsoncallback => 1
|
29
|
+
}
|
30
|
+
|
31
|
+
def initialize(params = {})
|
32
|
+
raise "Please specify your Flickr API key in presentation.json" unless CONFIG.flickr_api_key
|
33
|
+
@params = params
|
34
|
+
end
|
35
|
+
|
36
|
+
def uri
|
37
|
+
_uri = URI(ENDPOINT)
|
38
|
+
_uri.query = URI.encode_www_form(DEFAULT_PARAMS.merge(@params))
|
39
|
+
_uri
|
40
|
+
end
|
41
|
+
|
42
|
+
def json
|
43
|
+
@json ||= begin
|
44
|
+
_json = JSON.parse(Net::HTTP.get(uri))
|
45
|
+
raise FlickrAPIException.from_json(_json) unless _json['stat'] == 'ok'
|
46
|
+
_json
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Slideoff
|
4
|
+
class FlickrImage
|
5
|
+
def initialize(id)
|
6
|
+
@id = id
|
7
|
+
end
|
8
|
+
|
9
|
+
def image_src
|
10
|
+
# Prefer m else lagest size
|
11
|
+
size = sizes.select { |size| %w[Large Original].include?(size["label"]) }.first || sizes.last
|
12
|
+
size["source"]
|
13
|
+
end
|
14
|
+
|
15
|
+
def sizes
|
16
|
+
@sizes ||= FlickrAPI.new(method: 'flickr.photos.getSizes', photo_id: @id).json["sizes"]["size"]
|
17
|
+
end
|
18
|
+
|
19
|
+
def author
|
20
|
+
realname = info["owner"]["realname"]
|
21
|
+
!realname.strip.empty? ? realname : info["owner"]["username"]
|
22
|
+
end
|
23
|
+
|
24
|
+
def title
|
25
|
+
info["title"]["_content"]
|
26
|
+
end
|
27
|
+
|
28
|
+
def license
|
29
|
+
license_id = info["license"]
|
30
|
+
license_id = license_id.to_i rescue 0
|
31
|
+
flickr_licenses[license_id]
|
32
|
+
end
|
33
|
+
|
34
|
+
def page
|
35
|
+
info["urls"]["url"].first["_content"]
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
# Source: https://secure.flickr.com/services/api/explore/flickr.photos.licenses.getInfo
|
41
|
+
def flickr_licenses
|
42
|
+
[
|
43
|
+
{
|
44
|
+
"name" => "All Rights Reserved",
|
45
|
+
"url" => ""
|
46
|
+
},
|
47
|
+
{
|
48
|
+
"name" => "Attribution-NonCommercial-ShareAlike License",
|
49
|
+
"url" => "http://creativecommons.org/licenses/by-nc-sa/2.0/",
|
50
|
+
"cc_attributes" => %w[by nc sa]
|
51
|
+
},
|
52
|
+
{
|
53
|
+
"name" => "Attribution-NonCommercial License",
|
54
|
+
"url" => "http://creativecommons.org/licenses/by-nc/2.0/",
|
55
|
+
"cc_attributes" => %w[by nc]
|
56
|
+
},
|
57
|
+
{
|
58
|
+
"name" => "Attribution-NonCommercial-NoDerivs License",
|
59
|
+
"url" => "http://creativecommons.org/licenses/by-nc-nd/2.0/",
|
60
|
+
"cc_attributes" => %w[by nc nd]
|
61
|
+
},
|
62
|
+
{
|
63
|
+
"name" => "Attribution License",
|
64
|
+
"url" => "http://creativecommons.org/licenses/by/2.0/",
|
65
|
+
"cc_attributes" => %w[by]
|
66
|
+
},
|
67
|
+
{
|
68
|
+
"name" => "Attribution-ShareAlike License",
|
69
|
+
"url" => "http://creativecommons.org/licenses/by-sa/2.0/",
|
70
|
+
"cc_attributes" => %w[by sa]
|
71
|
+
},
|
72
|
+
{
|
73
|
+
"name" => "Attribution-NoDerivs License",
|
74
|
+
"url" => "http://creativecommons.org/licenses/by-nd/2.0/",
|
75
|
+
"cc_attributes" => %w[by nd]
|
76
|
+
},
|
77
|
+
{
|
78
|
+
"name" => "No known copyright restrictions",
|
79
|
+
"url" => "http://www.flickr.com/commons/usage/"
|
80
|
+
},
|
81
|
+
{
|
82
|
+
"name" => "United States Government Work",
|
83
|
+
"url" => "http://www.usa.gov/copyright.shtml"
|
84
|
+
}
|
85
|
+
]
|
86
|
+
end
|
87
|
+
|
88
|
+
def info
|
89
|
+
@info ||= FlickrAPI.new(method: 'flickr.photos.getInfo', photo_id: @id).json["photo"]
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|