zlide 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +18 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +47 -0
- data/Rakefile +8 -0
- data/bin/zlide +9 -0
- data/lib/zlide.rb +9 -0
- data/lib/zlide/cli/base.rb +40 -0
- data/lib/zlide/deck.rb +56 -0
- data/lib/zlide/layouts/deckjs.haml +44 -0
- data/lib/zlide/redcarpet/renderers.rb +5 -0
- data/lib/zlide/redcarpet/renderers/html.rb +35 -0
- data/lib/zlide/redcarpet/renderers/mock.rb +31 -0
- data/lib/zlide/redcarpet/renderers/pdf.rb +214 -0
- data/lib/zlide/server/base.rb +45 -0
- data/lib/zlide/templates/README.md.tt +5 -0
- data/lib/zlide/templates/config/deck.yml.tt +1 -0
- data/lib/zlide/templates/stylesheets/deck-theme.css +214 -0
- data/lib/zlide/templates/stylesheets/highlight-theme.css +127 -0
- data/lib/zlide/templates/stylesheets/slides.css +10 -0
- data/lib/zlide/version.rb +3 -0
- data/spec/spec_helper.rb +3 -0
- data/spec/zlide/deck_spec.rb +32 -0
- data/spec/zlide/server/base_spec.rb +23 -0
- data/vendor/javascripts/deck.js +1 -0
- data/vendor/javascripts/deck/deck.core.js +498 -0
- data/vendor/javascripts/deck/deck.edit.js +33 -0
- data/vendor/javascripts/deck/deck.goto.js +170 -0
- data/vendor/javascripts/deck/deck.hash.js +142 -0
- data/vendor/javascripts/deck/deck.menu.js +187 -0
- data/vendor/javascripts/deck/deck.navigation.js +92 -0
- data/vendor/javascripts/deck/deck.scale.js +170 -0
- data/vendor/javascripts/deck/deck.status.js +95 -0
- data/vendor/javascripts/highlight.js +1 -0
- data/vendor/javascripts/jquery-1.7.2.min.js +4 -0
- data/vendor/javascripts/modernizr.custom.js +4 -0
- data/vendor/stylesheets/deck.css +4 -0
- data/vendor/stylesheets/deck/deck.core.css +407 -0
- data/vendor/stylesheets/deck/deck.goto.css +41 -0
- data/vendor/stylesheets/deck/deck.hash.css +13 -0
- data/vendor/stylesheets/deck/deck.menu.css +47 -0
- data/vendor/stylesheets/deck/deck.navigation.css +43 -0
- data/vendor/stylesheets/deck/deck.scale.css +28 -0
- data/vendor/stylesheets/deck/deck.status.css +18 -0
- data/vendor/stylesheets/deck/transition/fade.css +43 -0
- data/vendor/stylesheets/deck/transition/fade.scss +69 -0
- data/vendor/stylesheets/deck/transition/horizontal-slide.css +76 -0
- data/vendor/stylesheets/deck/transition/horizontal-slide.scss +90 -0
- data/vendor/stylesheets/deck/transition/vertical-slide.css +94 -0
- data/vendor/stylesheets/deck/transition/vertical-slide.scss +112 -0
- data/vendor/stylesheets/test.css +3 -0
- data/zlide.gemspec +27 -0
- metadata +229 -0
@@ -0,0 +1,45 @@
|
|
1
|
+
require "sinatra/base"
|
2
|
+
require "sprockets"
|
3
|
+
|
4
|
+
module Zlide
|
5
|
+
module Server
|
6
|
+
|
7
|
+
class Base < Sinatra::Base
|
8
|
+
|
9
|
+
set :root, Dir.pwd
|
10
|
+
|
11
|
+
set :assets, Sprockets::Environment.new
|
12
|
+
|
13
|
+
settings.assets.append_path File.join(File.dirname(__FILE__), '..', '..', '..', 'vendor', 'javascripts')
|
14
|
+
settings.assets.append_path File.join(File.dirname(__FILE__), '..', '..', '..', 'vendor', 'stylesheets')
|
15
|
+
settings.assets.append_path File.join(Dir.pwd, 'stylesheets')
|
16
|
+
|
17
|
+
set :deck, Zlide::Deck.new
|
18
|
+
|
19
|
+
get '/' do
|
20
|
+
settings.deck.to_html
|
21
|
+
end
|
22
|
+
|
23
|
+
get '/slide/:id' do |id|
|
24
|
+
settings.deck.slide(id.to_i)
|
25
|
+
end
|
26
|
+
|
27
|
+
post '/slide/:id' do |id|
|
28
|
+
settings.deck.update_slide(id.to_i, params[:slide])
|
29
|
+
"OK"
|
30
|
+
end
|
31
|
+
|
32
|
+
get '/javascripts/:file.js' do
|
33
|
+
content_type 'application/javascript'
|
34
|
+
settings.assets["#{params[:file]}.js"]
|
35
|
+
end
|
36
|
+
|
37
|
+
get '/stylesheets/:file.css' do
|
38
|
+
content_type 'text/css'
|
39
|
+
settings.assets["#{params[:file]}.css"]
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
title: <%= @name %>
|
@@ -0,0 +1,214 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
.deck-container {
|
3
|
+
font-family: "Gill Sans", "Gill Sans MT", Calibri, sans-serif;
|
4
|
+
font-size: 1.75em;
|
5
|
+
background: #f4fafe;
|
6
|
+
/* Old browsers */
|
7
|
+
background: -moz-linear-gradient(top, #f4fafe 0%, #ccf0f0 100%);
|
8
|
+
/* FF3.6+ */
|
9
|
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f4fafe), color-stop(100%, #ccf0f0));
|
10
|
+
/* Chrome,Safari4+ */
|
11
|
+
background: -webkit-linear-gradient(top, #f4fafe 0%, #ccf0f0 100%);
|
12
|
+
/* Chrome10+,Safari5.1+ */
|
13
|
+
background: -o-linear-gradient(top, #f4fafe 0%, #ccf0f0 100%);
|
14
|
+
/* Opera11.10+ */
|
15
|
+
background: -ms-linear-gradient(top, #f4fafe 0%, #ccf0f0 100%);
|
16
|
+
/* IE10+ */
|
17
|
+
background: linear-gradient(top, #f4fafe 0%, #ccf0f0 100%);
|
18
|
+
/* W3C */
|
19
|
+
background-attachment: fixed;
|
20
|
+
}
|
21
|
+
.deck-container > .slide {
|
22
|
+
text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.5);
|
23
|
+
}
|
24
|
+
.deck-container > .slide .deck-before, .deck-container > .slide .deck-previous {
|
25
|
+
opacity: 0.4;
|
26
|
+
}
|
27
|
+
.deck-container > .slide .deck-before:not(.deck-child-current) .deck-before, .deck-container > .slide .deck-before:not(.deck-child-current) .deck-previous, .deck-container > .slide .deck-previous:not(.deck-child-current) .deck-before, .deck-container > .slide .deck-previous:not(.deck-child-current) .deck-previous {
|
28
|
+
opacity: 1;
|
29
|
+
}
|
30
|
+
.deck-container > .slide .deck-child-current {
|
31
|
+
opacity: 1;
|
32
|
+
}
|
33
|
+
.deck-container .slide h1, .deck-container .slide h2, .deck-container .slide h3, .deck-container .slide h4, .deck-container .slide h5, .deck-container .slide h6 {
|
34
|
+
font-family: "Hoefler Text", Constantia, Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
|
35
|
+
}
|
36
|
+
.deck-container .slide h1 {
|
37
|
+
color: #08455f;
|
38
|
+
}
|
39
|
+
.deck-container .slide h2 {
|
40
|
+
color: #0b7495;
|
41
|
+
border-bottom: 0;
|
42
|
+
}
|
43
|
+
.cssreflections .deck-container .slide h2 {
|
44
|
+
line-height: 1;
|
45
|
+
-webkit-box-reflect: below -0.556em -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(0.3, transparent), color-stop(0.7, rgba(255, 255, 255, 0.1)), to(transparent));
|
46
|
+
-moz-box-reflect: below -0.556em -moz-linear-gradient(top, transparent 0%, transparent 30%, rgba(255, 255, 255, 0.3) 100%);
|
47
|
+
}
|
48
|
+
.deck-container .slide h3 {
|
49
|
+
color: #000;
|
50
|
+
}
|
51
|
+
.deck-container .slide pre {
|
52
|
+
border-color: #cde;
|
53
|
+
background: #fff;
|
54
|
+
position: relative;
|
55
|
+
z-index: auto;
|
56
|
+
/* http://nicolasgallagher.com/css-drop-shadows-without-images/ */
|
57
|
+
}
|
58
|
+
.borderradius .deck-container .slide pre {
|
59
|
+
-webkit-border-radius: 5px;
|
60
|
+
-moz-border-radius: 5px;
|
61
|
+
border-radius: 5px;
|
62
|
+
}
|
63
|
+
.csstransforms.boxshadow .deck-container .slide pre > :first-child:before {
|
64
|
+
content: "";
|
65
|
+
position: absolute;
|
66
|
+
z-index: -1;
|
67
|
+
background: #fff;
|
68
|
+
top: 0;
|
69
|
+
bottom: 0;
|
70
|
+
left: 0;
|
71
|
+
right: 0;
|
72
|
+
}
|
73
|
+
.csstransforms.boxshadow .deck-container .slide pre:before, .csstransforms.boxshadow .deck-container .slide pre:after {
|
74
|
+
content: "";
|
75
|
+
position: absolute;
|
76
|
+
z-index: -2;
|
77
|
+
bottom: 15px;
|
78
|
+
width: 50%;
|
79
|
+
height: 20%;
|
80
|
+
max-width: 300px;
|
81
|
+
-webkit-box-shadow: 0 15px 10px rgba(0, 0, 0, 0.7);
|
82
|
+
-moz-box-shadow: 0 15px 10px rgba(0, 0, 0, 0.7);
|
83
|
+
box-shadow: 0 15px 10px rgba(0, 0, 0, 0.7);
|
84
|
+
}
|
85
|
+
.csstransforms.boxshadow .deck-container .slide pre:before {
|
86
|
+
left: 10px;
|
87
|
+
-webkit-transform: rotate(-3deg);
|
88
|
+
-moz-transform: rotate(-3deg);
|
89
|
+
-ms-transform: rotate(-3deg);
|
90
|
+
-o-transform: rotate(-3deg);
|
91
|
+
transform: rotate(-3deg);
|
92
|
+
}
|
93
|
+
.csstransforms.boxshadow .deck-container .slide pre:after {
|
94
|
+
right: 10px;
|
95
|
+
-webkit-transform: rotate(3deg);
|
96
|
+
-moz-transform: rotate(3deg);
|
97
|
+
-ms-transform: rotate(3deg);
|
98
|
+
-o-transform: rotate(3deg);
|
99
|
+
transform: rotate(3deg);
|
100
|
+
}
|
101
|
+
.deck-container .slide code {
|
102
|
+
color: #789;
|
103
|
+
}
|
104
|
+
.deck-container .slide blockquote {
|
105
|
+
font-family: "Hoefler Text", Constantia, Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
|
106
|
+
font-size: 2em;
|
107
|
+
padding: 1em 2em .5em 2em;
|
108
|
+
color: #000;
|
109
|
+
background: #fff;
|
110
|
+
position: relative;
|
111
|
+
border: 1px solid #cde;
|
112
|
+
z-index: auto;
|
113
|
+
}
|
114
|
+
.borderradius .deck-container .slide blockquote {
|
115
|
+
-webkit-border-radius: 5px;
|
116
|
+
-moz-border-radius: 5px;
|
117
|
+
border-radius: 5px;
|
118
|
+
}
|
119
|
+
.boxshadow .deck-container .slide blockquote > :first-child:before {
|
120
|
+
content: "";
|
121
|
+
position: absolute;
|
122
|
+
z-index: -1;
|
123
|
+
background: #fff;
|
124
|
+
top: 0;
|
125
|
+
bottom: 0;
|
126
|
+
left: 0;
|
127
|
+
right: 0;
|
128
|
+
}
|
129
|
+
.boxshadow .deck-container .slide blockquote:after {
|
130
|
+
content: "";
|
131
|
+
position: absolute;
|
132
|
+
z-index: -2;
|
133
|
+
top: 10px;
|
134
|
+
bottom: 10px;
|
135
|
+
left: 0;
|
136
|
+
right: 50%;
|
137
|
+
-moz-border-radius: 10px/100px;
|
138
|
+
border-radius: 10px/100px;
|
139
|
+
-webkit-box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
|
140
|
+
-moz-box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
|
141
|
+
box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
|
142
|
+
}
|
143
|
+
.deck-container .slide blockquote p {
|
144
|
+
margin: 0;
|
145
|
+
}
|
146
|
+
.deck-container .slide blockquote cite {
|
147
|
+
font-size: .5em;
|
148
|
+
font-style: normal;
|
149
|
+
font-weight: bold;
|
150
|
+
color: #888;
|
151
|
+
}
|
152
|
+
.deck-container .slide blockquote:before {
|
153
|
+
content: "“";
|
154
|
+
position: absolute;
|
155
|
+
top: 0;
|
156
|
+
left: 0;
|
157
|
+
font-size: 5em;
|
158
|
+
line-height: 1;
|
159
|
+
color: #ccf0f0;
|
160
|
+
z-index: 1;
|
161
|
+
}
|
162
|
+
.deck-container .slide ::-moz-selection {
|
163
|
+
background: #08455f;
|
164
|
+
color: #fff;
|
165
|
+
}
|
166
|
+
.deck-container .slide ::selection {
|
167
|
+
background: #08455f;
|
168
|
+
color: #fff;
|
169
|
+
}
|
170
|
+
.deck-container .slide a, .deck-container .slide a:hover, .deck-container .slide a:focus, .deck-container .slide a:active, .deck-container .slide a:visited {
|
171
|
+
color: #599;
|
172
|
+
text-decoration: none;
|
173
|
+
}
|
174
|
+
.deck-container .slide a:hover, .deck-container .slide a:focus {
|
175
|
+
text-decoration: underline;
|
176
|
+
}
|
177
|
+
.deck-container .deck-prev-link, .deck-container .deck-next-link {
|
178
|
+
background: #fff;
|
179
|
+
opacity: 0.5;
|
180
|
+
}
|
181
|
+
.deck-container .deck-prev-link, .deck-container .deck-prev-link:hover, .deck-container .deck-prev-link:focus, .deck-container .deck-prev-link:active, .deck-container .deck-prev-link:visited, .deck-container .deck-next-link, .deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus, .deck-container .deck-next-link:active, .deck-container .deck-next-link:visited {
|
182
|
+
color: #599;
|
183
|
+
}
|
184
|
+
.deck-container .deck-prev-link:hover, .deck-container .deck-prev-link:focus, .deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus {
|
185
|
+
opacity: 1;
|
186
|
+
text-decoration: none;
|
187
|
+
}
|
188
|
+
.deck-container .deck-status {
|
189
|
+
font-size: 0.6666em;
|
190
|
+
}
|
191
|
+
.deck-container.deck-menu .slide {
|
192
|
+
background: transparent;
|
193
|
+
-webkit-border-radius: 5px;
|
194
|
+
-moz-border-radius: 5px;
|
195
|
+
border-radius: 5px;
|
196
|
+
}
|
197
|
+
.rgba .deck-container.deck-menu .slide {
|
198
|
+
background: rgba(0, 0, 0, 0.1);
|
199
|
+
}
|
200
|
+
.deck-container.deck-menu .slide.deck-current, .rgba .deck-container.deck-menu .slide.deck-current, .no-touch .deck-container.deck-menu .slide:hover {
|
201
|
+
background: #fff;
|
202
|
+
}
|
203
|
+
.deck-container .goto-form {
|
204
|
+
background: #fff;
|
205
|
+
border: 1px solid #cde;
|
206
|
+
-webkit-border-radius: 5px;
|
207
|
+
-moz-border-radius: 5px;
|
208
|
+
border-radius: 5px;
|
209
|
+
}
|
210
|
+
.boxshadow .deck-container .goto-form {
|
211
|
+
-webkit-box-shadow: 0 15px 10px -10px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
|
212
|
+
-moz-box-shadow: 0 15px 10px -10px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
|
213
|
+
box-shadow: 0 15px 10px -10px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
|
214
|
+
}
|
@@ -0,0 +1,127 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
|
4
|
+
|
5
|
+
*/
|
6
|
+
|
7
|
+
pre code {
|
8
|
+
display: block; padding: 0.5em;
|
9
|
+
color: #333;
|
10
|
+
background: #f8f8ff
|
11
|
+
}
|
12
|
+
|
13
|
+
pre .comment,
|
14
|
+
pre .template_comment,
|
15
|
+
pre .diff .header,
|
16
|
+
pre .javadoc {
|
17
|
+
color: #998;
|
18
|
+
font-style: italic
|
19
|
+
}
|
20
|
+
|
21
|
+
pre .keyword,
|
22
|
+
pre .css .rule .keyword,
|
23
|
+
pre .winutils,
|
24
|
+
pre .javascript .title,
|
25
|
+
pre .nginx .title,
|
26
|
+
pre .subst,
|
27
|
+
pre .request,
|
28
|
+
pre .status {
|
29
|
+
color: #333;
|
30
|
+
font-weight: bold
|
31
|
+
}
|
32
|
+
|
33
|
+
pre .number,
|
34
|
+
pre .hexcolor,
|
35
|
+
pre .ruby .constant {
|
36
|
+
color: #099;
|
37
|
+
}
|
38
|
+
|
39
|
+
pre .string,
|
40
|
+
pre .tag .value,
|
41
|
+
pre .phpdoc,
|
42
|
+
pre .tex .formula {
|
43
|
+
color: #d14
|
44
|
+
}
|
45
|
+
|
46
|
+
pre .title,
|
47
|
+
pre .id {
|
48
|
+
color: #900;
|
49
|
+
font-weight: bold
|
50
|
+
}
|
51
|
+
|
52
|
+
pre .javascript .title,
|
53
|
+
pre .lisp .title,
|
54
|
+
pre .clojure .title,
|
55
|
+
pre .subst {
|
56
|
+
font-weight: normal
|
57
|
+
}
|
58
|
+
|
59
|
+
pre .class .title,
|
60
|
+
pre .haskell .type,
|
61
|
+
pre .vhdl .literal,
|
62
|
+
pre .tex .command {
|
63
|
+
color: #458;
|
64
|
+
font-weight: bold
|
65
|
+
}
|
66
|
+
|
67
|
+
pre .tag,
|
68
|
+
pre .tag .title,
|
69
|
+
pre .rules .property,
|
70
|
+
pre .django .tag .keyword {
|
71
|
+
color: #000080;
|
72
|
+
font-weight: normal
|
73
|
+
}
|
74
|
+
|
75
|
+
pre .attribute,
|
76
|
+
pre .variable,
|
77
|
+
pre .lisp .body {
|
78
|
+
color: #008080
|
79
|
+
}
|
80
|
+
|
81
|
+
pre .regexp {
|
82
|
+
color: #009926
|
83
|
+
}
|
84
|
+
|
85
|
+
pre .class {
|
86
|
+
color: #458;
|
87
|
+
font-weight: bold
|
88
|
+
}
|
89
|
+
|
90
|
+
pre .symbol,
|
91
|
+
pre .ruby .symbol .string,
|
92
|
+
pre .lisp .keyword,
|
93
|
+
pre .tex .special,
|
94
|
+
pre .prompt {
|
95
|
+
color: #990073
|
96
|
+
}
|
97
|
+
|
98
|
+
pre .built_in,
|
99
|
+
pre .lisp .title,
|
100
|
+
pre .clojure .built_in {
|
101
|
+
color: #0086b3
|
102
|
+
}
|
103
|
+
|
104
|
+
pre .preprocessor,
|
105
|
+
pre .pi,
|
106
|
+
pre .doctype,
|
107
|
+
pre .shebang,
|
108
|
+
pre .cdata {
|
109
|
+
color: #999;
|
110
|
+
font-weight: bold
|
111
|
+
}
|
112
|
+
|
113
|
+
pre .deletion {
|
114
|
+
background: #fdd
|
115
|
+
}
|
116
|
+
|
117
|
+
pre .addition {
|
118
|
+
background: #dfd
|
119
|
+
}
|
120
|
+
|
121
|
+
pre .diff .change {
|
122
|
+
background: #0086b3
|
123
|
+
}
|
124
|
+
|
125
|
+
pre .chunk {
|
126
|
+
color: #aaa
|
127
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/*
|
2
|
+
* This is the default stylesheet that automatically gets
|
3
|
+
* included in your slide deck.
|
4
|
+
*
|
5
|
+
* Currently this loads the default deck.js and highlight.js
|
6
|
+
* themes. Feel free to add and/or change to your liking.
|
7
|
+
*
|
8
|
+
*= require deck-theme
|
9
|
+
*= require highlight-theme
|
10
|
+
*/
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Zlide::Deck do
|
4
|
+
|
5
|
+
describe "deck initialization" do
|
6
|
+
|
7
|
+
it "should look for .md files in a slides folder" do
|
8
|
+
Dir.should_receive(:glob).with('slides/*.md').and_return([])
|
9
|
+
Zlide::Deck.new
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should read file contents from .md files" do
|
13
|
+
Dir.stub(:glob).and_return(["test1", "test2"])
|
14
|
+
File.should_receive(:read).with("test1").and_return("!SLIDE\n# test1")
|
15
|
+
File.should_receive(:read).with("test2").and_return("!SLIDE\n# test2")
|
16
|
+
Zlide::Deck.new
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
describe "output rendering" do
|
22
|
+
|
23
|
+
it "should produce html from markdown" do
|
24
|
+
Dir.stub(:glob).and_return(["test1"])
|
25
|
+
File.stub(:read).and_return("!SLIDE\n# Test")
|
26
|
+
deck = Zlide::Deck.new
|
27
|
+
File.unstub(:read)
|
28
|
+
deck.to_html.should match(/<h1>Test<\/h1>/)
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|