bastos-gary 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +83 -0
- data/Rakefile +18 -0
- data/assets/gary.js +1 -0
- data/assets/jquery.js +3549 -0
- data/assets/outline.css +27 -0
- data/assets/print.css +1 -0
- data/assets/slides.css +76 -0
- data/assets/slides.js +201 -0
- data/assets/style.css +107 -0
- data/bin/gary +13 -0
- data/examples/test.rb +17 -0
- data/gary.gemspec +39 -0
- data/lib/albino.rb +116 -0
- data/lib/gary.rb +139 -0
- metadata +92 -0
data/assets/outline.css
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
/* don't change this unless you want the layout stuff to show up in the outline view! */
|
2
|
+
|
3
|
+
.layout > *, #controls *, #footer *, #navLinks * { display: none; }
|
4
|
+
|
5
|
+
#controls, #navLinks, #toggle {
|
6
|
+
display: block; visibility: visible; margin: 0; padding: 0;}
|
7
|
+
|
8
|
+
#toggle { position: fixed; top: 0; right: 0; padding: 0.5em; }
|
9
|
+
#toggle {border: 1px solid; border-width: 0 0 1px 1px; background: #FFF;}
|
10
|
+
|
11
|
+
|
12
|
+
/* making the outline look pretty-ish */
|
13
|
+
|
14
|
+
#slide1, #slide1 h1, #slide1 h2, #slide1 h3, #slide1 h4 {border: none; margin: 0;}
|
15
|
+
#slide1 h1 {padding-top: 1.5em;}
|
16
|
+
|
17
|
+
.slide { margin: 1.5em 0 0; border-top: 1px solid #888; }
|
18
|
+
.slide h1 { border-bottom: 1px solid #AAA; }
|
19
|
+
|
20
|
+
#microsoft {
|
21
|
+
display: none;
|
22
|
+
border: red solid thick;
|
23
|
+
padding: 1em;
|
24
|
+
font-family: sans-serif;
|
25
|
+
font-weight: bold;
|
26
|
+
margin-bottom: 2em;
|
27
|
+
}
|
data/assets/print.css
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
/* The following rule is necessary to have all slides appear in print! DO NOT REMOVE IT! */
|
data/assets/slides.css
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
.slide { display: none; }
|
2
|
+
#slide1 { display: block; }
|
3
|
+
#microsoft { display: none; }
|
4
|
+
|
5
|
+
.slide { position: absolute; }
|
6
|
+
#header, #footer { position: fixed; }
|
7
|
+
|
8
|
+
.layout { display: block; }
|
9
|
+
.notes { display: none; } /* handout notes/note (use note? handout? notes? */
|
10
|
+
|
11
|
+
#header, #footer, .slide { width: 100%; top: 0; left: 0; }
|
12
|
+
#header { top: 0; height: 0.5em; z-index: 1;}
|
13
|
+
|
14
|
+
#footer { top: auto; bottom: 0; height: 1em; z-index: 5;}
|
15
|
+
#footer { font-size: 100%; font-weight: bold; padding: 1em 0;}
|
16
|
+
#footer h1 { display: block; margin: 0; padding: 0 1em; font-size: 0.5em; }
|
17
|
+
#footer h2 { display: block; margin: 0; padding: 0 1em; font-size: 0.5em; font-style: italic; }
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
#controls { position: fixed; left: 60%; bottom: 0; width: 40%; z-index: 100;
|
22
|
+
text-align: right;
|
23
|
+
font: bold 1.2em Verdana, Helvetica, sans-serif; }
|
24
|
+
|
25
|
+
#controls :focus { outline: 1px dotted white;}
|
26
|
+
|
27
|
+
#controls #navLinks { text-align: right; margin: 0; visibility: hidden; }
|
28
|
+
|
29
|
+
#controls #navLinks a { padding: 0; margin: 0 0.5em; cursor: pointer; border: none; }
|
30
|
+
|
31
|
+
#controls #navLinks :link,
|
32
|
+
#controls #navLinks :visited {text-decoration: none; }
|
33
|
+
|
34
|
+
#controls #navList #jumplist { background: white; color: black; }
|
35
|
+
|
36
|
+
|
37
|
+
#currentSlide { position: fixed; width: 10%; left: 45%; bottom: 1em; z-index: 10;}
|
38
|
+
#currentSlide { text-align: center; font-size: 0.8em; }
|
39
|
+
#currentSlide :link,
|
40
|
+
#currentSlide :visited {text-decoration: none; }
|
41
|
+
|
42
|
+
.presentation { margin: 0; padding: 0; }
|
43
|
+
.slide { margin: 0 0 0 0; height: 96%; }
|
44
|
+
.slide { overflow-x: hidden; overflow-y: auto; }
|
45
|
+
.slide { top: 0; width: 92%; padding: 2% 4% 0 4%; z-index: 2; list-style: none;}
|
46
|
+
|
47
|
+
/* .step { visibility: hidden; } */
|
48
|
+
|
49
|
+
/* enable svg backgrounds for gradient themes */
|
50
|
+
div.background { position: fixed; left: 0px; right: 0px; top: 0px; bottom: 0px; z-index: -1; }
|
51
|
+
body { opacity: .99; }
|
52
|
+
|
53
|
+
html, body { margin: 0; padding: 0; }
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
/*
|
59
|
+
div#header {background: #FCC;}
|
60
|
+
div#footer {background: #CCF;}
|
61
|
+
div#controls {background: #BBD;}
|
62
|
+
div#currentSlide {background: #FFC;}
|
63
|
+
*/
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
data/assets/slides.js
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
var snum = 1; /* current slide # (non-zero based index e.g. starting with 1) */
|
2
|
+
var smax = 1; /* max number of slides */
|
3
|
+
var s6mode = true; /* are we in slide mode (in contrast to outline mode)? */
|
4
|
+
var defaultView = 'slideshow'; /* slideshow | outline */
|
5
|
+
|
6
|
+
function showHide(action)
|
7
|
+
{
|
8
|
+
switch( action ) {
|
9
|
+
case 's': $( '#navLinks' ).css( 'visibility', 'visible' ); break;
|
10
|
+
case 'h': $( '#navLinks' ).css( 'visibility', 'hidden' ); break;
|
11
|
+
case 'c': /* toggle control panel */
|
12
|
+
if( $( '#navLinks' ).css( 'visibility' ) != 'visible' )
|
13
|
+
$( '#navLinks' ).css( 'visibility', 'visible' );
|
14
|
+
else
|
15
|
+
$( '#navLinks' ).css( 'visibility', 'hidden' );
|
16
|
+
break;
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
function currentSlide() {
|
21
|
+
|
22
|
+
$( '#currentSlide' ).html( '<a id="plink" href="">' +
|
23
|
+
'<span id="csHere">' + snum + '<\/span> ' +
|
24
|
+
'<span id="csSep">\/<\/span> ' +
|
25
|
+
'<span id="csTotal">' + smax + '<\/span>' +
|
26
|
+
'<\/a>' );
|
27
|
+
}
|
28
|
+
|
29
|
+
|
30
|
+
function permaLink() {
|
31
|
+
$('#plink').get(0).href = window.location.pathname + '#slide' + snum;
|
32
|
+
}
|
33
|
+
|
34
|
+
function goTo( target ) {
|
35
|
+
if( target > smax || target == snum ) return;
|
36
|
+
go( target - snum );
|
37
|
+
}
|
38
|
+
|
39
|
+
function go( step ) {
|
40
|
+
|
41
|
+
var cid = '#slide' + snum;
|
42
|
+
|
43
|
+
if (step != 'j') {
|
44
|
+
snum += step;
|
45
|
+
if( snum > smax ) snum = smax;
|
46
|
+
if (snum < 1) snum = 1;
|
47
|
+
} else
|
48
|
+
snum = parseInt( $( '#jumplist' ).val() );
|
49
|
+
|
50
|
+
var nid = '#slide' + snum;
|
51
|
+
|
52
|
+
$( cid ).hide();
|
53
|
+
$( nid ).show();
|
54
|
+
|
55
|
+
$('#jumplist').get(0).selectedIndex = (snum-1);
|
56
|
+
currentSlide();
|
57
|
+
permaLink();
|
58
|
+
}
|
59
|
+
|
60
|
+
|
61
|
+
function toggle() {
|
62
|
+
|
63
|
+
/* get stylesheets */
|
64
|
+
var slides = $('#slideProj').get(0);
|
65
|
+
var outline = $('#outlineStyle').get(0);
|
66
|
+
|
67
|
+
if( !slides.disabled ) {
|
68
|
+
slides.disabled = true;
|
69
|
+
outline.disabled = false;
|
70
|
+
s6mode = false;
|
71
|
+
$('.slide').each( function() { $(this).show(); } );
|
72
|
+
} else {
|
73
|
+
slides.disabled = false;
|
74
|
+
outline.disabled = true;
|
75
|
+
s6mode = true;
|
76
|
+
$('.slide').each( function(i) {
|
77
|
+
if( i == (snum-1) )
|
78
|
+
$(this).show();
|
79
|
+
else
|
80
|
+
$(this).hide();
|
81
|
+
});
|
82
|
+
}
|
83
|
+
}
|
84
|
+
|
85
|
+
|
86
|
+
function populateJumpList() {
|
87
|
+
|
88
|
+
var list = $('#jumplist').get(0);
|
89
|
+
|
90
|
+
$( '.slide' ).each( function(i) {
|
91
|
+
list.options[list.length] = new Option( (i+1)+' : '+ $(this).find('h1').text(), (i+1) );
|
92
|
+
});
|
93
|
+
}
|
94
|
+
|
95
|
+
function createControls() {
|
96
|
+
|
97
|
+
$('#controls').html( '<div id="navLinks">' +
|
98
|
+
'<a accesskey="t" id="toggle" href="#">Ø<\/a>' +
|
99
|
+
'<a accesskey="z" id="prev" href="#">«<\/a>' +
|
100
|
+
'<a accesskey="x" id="next" href="#">»<\/a>' +
|
101
|
+
'<div id="navList"><select id="jumplist" /><\/div>' +
|
102
|
+
'<\/div>' );
|
103
|
+
|
104
|
+
$('#controls').mouseover( function() { showHide('s'); } );
|
105
|
+
$('#controls').mouseout( function() { showHide('h'); } );
|
106
|
+
$('#toggle').click( function() { toggle(); } );
|
107
|
+
$('#prev').click( function() { go(-1); } );
|
108
|
+
$('#next').click( function() { go(1); } );
|
109
|
+
|
110
|
+
$('#jumplist').change( function() { go('j'); } );
|
111
|
+
|
112
|
+
populateJumpList();
|
113
|
+
currentSlide();
|
114
|
+
}
|
115
|
+
|
116
|
+
function addSlideIds() {
|
117
|
+
$( '.slide' ).each( function(i) {
|
118
|
+
$(this).attr( 'id', 'slide'+(i+1) );
|
119
|
+
});
|
120
|
+
|
121
|
+
smax = $( '.slide' ).length;
|
122
|
+
}
|
123
|
+
|
124
|
+
function notOperaFix() {
|
125
|
+
|
126
|
+
$('#slideProj').attr( 'media','screen' );
|
127
|
+
|
128
|
+
var outline = $('#outlineStyle').get(0);
|
129
|
+
outline.disabled = true;
|
130
|
+
}
|
131
|
+
|
132
|
+
|
133
|
+
function defaultCheck() {
|
134
|
+
$( 'meta' ).each( function() {
|
135
|
+
if( $(this).attr( 'name' ) == 'defaultView' )
|
136
|
+
defaultView = $(this).attr( 'content' );
|
137
|
+
} );
|
138
|
+
}
|
139
|
+
|
140
|
+
function keys(key) {
|
141
|
+
if (!key) {
|
142
|
+
key = event;
|
143
|
+
key.which = key.keyCode;
|
144
|
+
}
|
145
|
+
if (key.which == 84) {
|
146
|
+
toggle();
|
147
|
+
return;
|
148
|
+
}
|
149
|
+
if (s6mode) {
|
150
|
+
switch (key.which) {
|
151
|
+
case 32: // spacebar
|
152
|
+
case 34: // page down
|
153
|
+
case 39: // rightkey
|
154
|
+
case 40: // downkey
|
155
|
+
go(1);
|
156
|
+
break;
|
157
|
+
case 33: // page up
|
158
|
+
case 37: // leftkey
|
159
|
+
case 38: // upkey
|
160
|
+
go(-1);
|
161
|
+
break;
|
162
|
+
case 36: // home
|
163
|
+
goTo(1);
|
164
|
+
break;
|
165
|
+
case 35: // end
|
166
|
+
goTo(smax);
|
167
|
+
break;
|
168
|
+
case 67: // c
|
169
|
+
showHide('c');
|
170
|
+
break;
|
171
|
+
}
|
172
|
+
}
|
173
|
+
return false;
|
174
|
+
}
|
175
|
+
|
176
|
+
|
177
|
+
$(document).ready(function(){
|
178
|
+
|
179
|
+
if( $.browser.msie )
|
180
|
+
{
|
181
|
+
$( '.layout > *').hide();
|
182
|
+
$( '.presentation').hide();
|
183
|
+
|
184
|
+
$( '#microsoft' ).show();
|
185
|
+
}
|
186
|
+
else
|
187
|
+
{
|
188
|
+
defaultCheck();
|
189
|
+
addSlideIds();
|
190
|
+
createControls();
|
191
|
+
|
192
|
+
/* opera is the only browser currently supporting css projection mode */
|
193
|
+
/* if( !$.browser.opera ) */
|
194
|
+
notOperaFix();
|
195
|
+
|
196
|
+
if( defaultView == 'outline' )
|
197
|
+
toggle();
|
198
|
+
|
199
|
+
document.onkeyup = keys;
|
200
|
+
}
|
201
|
+
});
|
data/assets/style.css
ADDED
@@ -0,0 +1,107 @@
|
|
1
|
+
@import url(slides.css); /* required to make the slide show run at all */
|
2
|
+
|
3
|
+
/* Customizations */
|
4
|
+
|
5
|
+
html, body {
|
6
|
+
color: black;
|
7
|
+
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
|
8
|
+
}
|
9
|
+
|
10
|
+
a:link, a:visited { color: black; }
|
11
|
+
|
12
|
+
h1 { font-size: 30pt; }
|
13
|
+
h2 { font-size: 28pt; }
|
14
|
+
h3 { font-size: 25pt; }
|
15
|
+
p, li, td, th { font-size: 18pt; }
|
16
|
+
|
17
|
+
pre { font-size: 16pt; }
|
18
|
+
|
19
|
+
pre.code {
|
20
|
+
background-color: black;
|
21
|
+
padding: 5px;
|
22
|
+
border: silver thick groove;
|
23
|
+
-moz-border-radius: 11px;
|
24
|
+
}
|
25
|
+
|
26
|
+
|
27
|
+
div#header, div#footer { color: black; }
|
28
|
+
|
29
|
+
#currentSlide { color: black;}
|
30
|
+
|
31
|
+
#controls #navLinks a { color: black; }
|
32
|
+
div#header {background: #ebebeb;}
|
33
|
+
div#footer {background: #ebebeb;}
|
34
|
+
div#controls {background: #ebebeb;}
|
35
|
+
div#currentSlide {background: #ebebeb;}
|
36
|
+
|
37
|
+
|
38
|
+
.slide {
|
39
|
+
color:#fbfbfb;
|
40
|
background-color:#000;
|
41
|
+
}
|
42
|
+
|
43
|
+
|
44
|
+
.container {width:70%;margin:0 auto;}
|
45
|
+
.container h1, .container h2, .container h3{text-align:center}
|
46
|
+
|
47
|
+
/* Pygments related */
|
48
|
+
|
49
|
+
.highlight { background: #000; width:75%;margin:0 auto;}
|
50
|
+
.highlight .n { color: #FFF; }
|
51
|
+
.highlight .c { color:#5F5A60; font-style: italic } /* Comment */
|
52
|
+
.highlight .err { border: 1px solid #FF0000 } /* Error */
|
53
|
+
.highlight .o { color: #666666 } /* Operator */
|
54
|
+
.highlight .cm { color: #00FF00; font-style: italic } /* Comment.Multiline */
|
55
|
+
.highlight .cp { color: #00FF00 } /* Comment.Preproc */
|
56
|
+
.highlight .c1 { color: #00FF00} /* Comment.Single */
|
57
|
+
.highlight .cs { color: #00FF00} /* Comment.Special */
|
58
|
+
.highlight .gd { color: #A00000 } /* Generic.Deleted */
|
59
|
+
.highlight .ge { font-style: italic } /* Generic.Emph */
|
60
|
+
.highlight .gr { color: #FF0000 } /* Generic.Error */
|
61
|
+
.highlight .gh { color: #000080 } /* Generic.Heading */
|
62
|
+
.highlight .gi { color: #00A000 } /* Generic.Inserted */
|
63
|
+
.highlight .go { color: #808080 } /* Generic.Output */
|
64
|
+
.highlight .gp { color: #000080 } /* Generic.Prompt */
|
65
|
+
.highlight .gs { color: #000080 } /* Generic.Strong */
|
66
|
+
.highlight .gu { color: #800080 } /* Generic.Subheading */
|
67
|
+
.highlight .gt { color: #0040D0 } /* Generic.Traceback */
|
68
|
+
.highlight .k { color: #F9EE98 } /* Keyword */
|
69
|
+
.highlight .kc { color: #C0C0FF } /* Keyword.Constant */
|
70
|
+
.highlight .kd { color: #C0C0FF } /* Keyword.Declaration */
|
71
|
+
.highlight .kp { color: #C0C0FF } /* Keyword.Pseudo */
|
72
|
+
.highlight .kr { color: #C0C0FF } /* Keyword.Reserved */
|
73
|
+
.highlight .kt { color: #C0C0FF } /* Keyword.Type */
|
74
|
+
.highlight .m { color: #CF6A4C } /* Literal.Number */
|
75
|
+
.highlight .s { color: #BB4444 } /* Literal.String */
|
76
|
+
.highlight .na { color: #BB4444 } /* Name.Attribute */
|
77
|
+
.highlight .nb { color: #AA22FF } /* Name.Builtin */
|
78
|
+
.highlight .nc { color: #7587A6 } /* Name.Class */
|
79
|
+
.highlight .no { color: #880000 } /* Name.Constant */
|
80
|
+
.highlight .nd { color: #AA22FF } /* Name.Decorator */
|
81
|
+
.highlight .ni { color: #999999 } /* Name.Entity */
|
82
|
+
.highlight .ne { color: #D2413A } /* Name.Exception */
|
83
|
+
.highlight .nf { color: #8F9D6A } /* Name.Function */
|
84
|
+
.highlight .nl { color: #A0A000 } /* Name.Label */
|
85
|
+
.highlight .nn { color: #C0C0FF } /* Name.Namespace */
|
86
|
+
.highlight .nt { color: #008000 } /* Name.Tag */
|
87
|
+
.highlight .nv { color: #B8860B } /* Name.Variable */
|
88
|
+
.highlight .ow { color: #AA22FF } /* Operator.Word */
|
89
|
+
.highlight .mf { color: #666666 } /* Literal.Number.Float */
|
90
|
+
.highlight .mh { color: #666666 } /* Literal.Number.Hex */
|
91
|
+
.highlight .mi { color: #CF6A4C } /* Literal.Number.Integer */
|
92
|
+
.highlight .mo { color: #CF6A4C } /* Literal.Number.Oct */
|
93
|
+
.highlight .sb { color: #BB4444 } /* Literal.String.Backtick */
|
94
|
+
.highlight .sc { color: #BB4444 } /* Literal.String.Char */
|
95
|
+
.highlight .sd { color: #BB4444 } /* Literal.String.Doc */
|
96
|
+
.highlight .s2 { color: #BB4444 } /* Literal.String.Double */
|
97
|
+
.highlight .se { color: #BB6622 } /* Literal.String.Escape */
|
98
|
+
.highlight .sh { color: #BB4444 } /* Literal.String.Heredoc */
|
99
|
+
.highlight .si { color: #BB6688 } /* Literal.String.Interpol */
|
100
|
+
.highlight .sx { color: #008000 } /* Literal.String.Other */
|
101
|
+
.highlight .sr { color: #BB6688 } /* Literal.String.Regex */
|
102
|
+
.highlight .s1 { color: #BB4444 } /* Literal.String.Single */
|
103
|
+
.highlight .ss { color: #B8860B } /* Literal.String.Symbol */
|
104
|
+
.highlight .bp { color: #AA22FF } /* Name.Builtin.Pseudo */
|
105
|
+
.highlight .vc { color: #B8860B } /* Name.Variable.Class */
|
106
|
+
.highlight .vg { color: #B8860B } /* Name.Variable.Global */
|
107
|
+
.highlight .vi { color: #B8860B } /* Name.Variable.Instance */
|
108
|
+
.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */
|
data/bin/gary
ADDED
data/examples/test.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
presentation :title => "My First Presentation" do
|
2
|
+
|
3
|
+
slide do
|
4
|
+
h1 "Just a test"
|
5
|
+
code :type=>:ruby, :code => "def a; a+a;end"
|
6
|
+
end
|
7
|
+
|
8
|
+
slide do
|
9
|
+
h1 "Just another test"
|
10
|
+
h2 "Hello world"
|
11
|
+
end
|
12
|
+
|
13
|
+
slide do
|
14
|
+
h1 "Bye"
|
15
|
+
center { h3 "Bye people!" }
|
16
|
+
end
|
17
|
+
end
|