trickster 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. data/.gitignore +16 -0
  2. data/.rvmrc +1 -0
  3. data/Gemfile +2 -0
  4. data/README.rdoc +57 -13
  5. data/Rakefile +120 -0
  6. data/TODO +4 -0
  7. data/bin/trickster +66 -24
  8. data/css/themes-orig/arta.css +155 -0
  9. data/css/themes-orig/ascetic.css +50 -0
  10. data/css/themes-orig/brown_paper.css +102 -0
  11. data/css/themes-orig/brown_papersq.png +0 -0
  12. data/css/themes-orig/dark.css +101 -0
  13. data/css/themes-orig/default.css +132 -0
  14. data/css/themes-orig/far.css +111 -0
  15. data/css/themes-orig/github.css +131 -0
  16. data/css/themes-orig/googlecode.css +144 -0
  17. data/css/themes-orig/idea.css +121 -0
  18. data/css/themes-orig/ir_black.css +98 -0
  19. data/css/themes-orig/magula.css +119 -0
  20. data/css/themes-orig/monokai.css +112 -0
  21. data/css/themes-orig/pojoaque.css +104 -0
  22. data/css/themes-orig/pojoaque.jpg +0 -0
  23. data/css/themes-orig/rainbow.css +114 -0
  24. data/css/themes-orig/school_book.css +109 -0
  25. data/css/themes-orig/school_book.png +0 -0
  26. data/css/themes-orig/solarized_dark.css +88 -0
  27. data/css/themes-orig/solarized_light.css +88 -0
  28. data/css/themes-orig/sunburst.css +148 -0
  29. data/css/themes-orig/tomorrow-night-blue.css +42 -0
  30. data/css/themes-orig/tomorrow-night-bright.css +41 -0
  31. data/css/themes-orig/tomorrow-night-eighties.css +41 -0
  32. data/css/themes-orig/tomorrow-night.css +42 -0
  33. data/css/themes-orig/tomorrow.css +39 -0
  34. data/css/themes-orig/vs.css +85 -0
  35. data/css/themes-orig/xcode.css +154 -0
  36. data/css/themes-orig/zenburn.css +113 -0
  37. data/css/themes/arta.css +186 -0
  38. data/css/themes/ascetic.css +81 -0
  39. data/css/themes/brown_paper.css +133 -0
  40. data/css/themes/custom.scss +322 -0
  41. data/css/themes/dark.css +132 -0
  42. data/css/themes/default.css +163 -0
  43. data/css/themes/far.css +142 -0
  44. data/css/themes/github.css +162 -0
  45. data/css/themes/googlecode.css +175 -0
  46. data/css/themes/idea.css +152 -0
  47. data/css/themes/ir_black.css +129 -0
  48. data/css/themes/magula.css +150 -0
  49. data/css/themes/monokai.css +143 -0
  50. data/css/themes/pojoaque.css +135 -0
  51. data/css/themes/rainbow.css +145 -0
  52. data/css/themes/school_book.css +140 -0
  53. data/css/themes/solarized_dark.css +119 -0
  54. data/css/themes/solarized_light.css +119 -0
  55. data/css/themes/sunburst.css +179 -0
  56. data/css/themes/tomorrow-night-blue.css +73 -0
  57. data/css/themes/tomorrow-night-bright.css +72 -0
  58. data/css/themes/tomorrow-night-eighties.css +72 -0
  59. data/css/themes/tomorrow-night.css +73 -0
  60. data/css/themes/tomorrow.css +70 -0
  61. data/css/themes/vs.css +116 -0
  62. data/css/themes/xcode.css +185 -0
  63. data/css/themes/zenburn.css +144 -0
  64. data/erb/index.html.erb +2 -2
  65. data/features/build.feature +18 -0
  66. data/features/init.feature +57 -0
  67. data/features/step_definitions/trickster_steps.rb +78 -0
  68. data/features/support/env.rb +15 -0
  69. data/features/update.feature +33 -0
  70. data/js/trickster.js +1 -1
  71. data/lib/trickster.rb +2 -0
  72. data/lib/trickster/copier.rb +11 -0
  73. data/lib/trickster/file_copier.rb +1 -8
  74. data/lib/trickster/renderer/code_renderer.rb +47 -10
  75. data/lib/trickster/theme_copier.rb +16 -0
  76. data/lib/trickster/version.rb +1 -1
  77. data/notes.txt.md +56 -0
  78. data/test/jasmine.yml +4 -0
  79. data/test/js/bullets_spec.js +82 -0
  80. data/test/js/sizer_spec.js +244 -0
  81. data/test/js/trickster_spec.js +10 -0
  82. data/test/js/utils_spec.js +56 -0
  83. data/test/slide_parser_test.rb +50 -0
  84. data/test/slide_renderer_test.rb +316 -0
  85. data/{css → test/slideshow-with-sass/css}/highlight-solarized_light.min.css +0 -0
  86. data/test/slideshow-with-sass/css/normalize.css +375 -0
  87. data/test/slideshow-with-sass/css/styles.scss +66 -0
  88. data/test/slideshow-with-sass/js/bullets.js +83 -0
  89. data/test/slideshow-with-sass/js/custom.js +11 -0
  90. data/test/slideshow-with-sass/js/lib/highlight-7.1.min.js +1 -0
  91. data/test/slideshow-with-sass/js/lib/jquery-1.8.0.min.js +2 -0
  92. data/test/slideshow-with-sass/js/lib/jquerytypewriter.js +54 -0
  93. data/test/slideshow-with-sass/js/lib/underscore-1.3.3.min.js +32 -0
  94. data/test/slideshow-with-sass/js/sizer.js +149 -0
  95. data/test/slideshow-with-sass/js/trickster.js +216 -0
  96. data/test/slideshow-with-sass/js/utils.js +19 -0
  97. data/test/slideshow-with-sass/rudy.png +0 -0
  98. data/test/slideshow-with-sass/slides +47 -0
  99. data/test/slideshow/css/highlight-solarized_light.min.css +37 -0
  100. data/test/slideshow/css/normalize.css +375 -0
  101. data/test/slideshow/css/styles.css +66 -0
  102. data/test/slideshow/css/theme.css +163 -0
  103. data/test/slideshow/index.html +77 -0
  104. data/test/slideshow/js/bullets.js +83 -0
  105. data/test/slideshow/js/custom.js +11 -0
  106. data/test/slideshow/js/lib/highlight-7.1.min.js +1 -0
  107. data/test/slideshow/js/lib/jquery-1.8.0.min.js +2 -0
  108. data/test/slideshow/js/lib/jquerytypewriter.js +54 -0
  109. data/test/slideshow/js/lib/underscore-1.3.3.min.js +32 -0
  110. data/test/slideshow/js/sizer.js +149 -0
  111. data/test/slideshow/js/trickster.js +216 -0
  112. data/test/slideshow/js/utils.js +19 -0
  113. data/test/slideshow/rudy.png +0 -0
  114. data/test/slideshow/slides +47 -0
  115. data/test/test_helper.rb +11 -0
  116. data/trickster.gemspec +27 -0
  117. data/trickster.rdoc +44 -8
  118. metadata +348 -62
  119. data/js/lib/highlight-fc32801.min.js +0 -4601
@@ -0,0 +1,185 @@
1
+ /*
2
+
3
+ XCode style (c) Angel Garcia <angelgarcia.mail@gmail.com>
4
+
5
+ */
6
+
7
+ pre code {
8
+ display: block; padding: 0.5em;
9
+ background: #fff; color: black;
10
+ }
11
+
12
+ pre .comment,
13
+ pre .template_comment,
14
+ pre .javadoc,
15
+ pre .comment * {
16
+ color: rgb(0,106,0);
17
+ }
18
+
19
+ pre .keyword,
20
+ pre .literal,
21
+ pre .nginx .title {
22
+ color: rgb(170,13,145);
23
+ }
24
+ pre .method,
25
+ pre .list .title,
26
+ pre .tag .title,
27
+ pre .setting .value,
28
+ pre .winutils,
29
+ pre .tex .command,
30
+ pre .http .title,
31
+ pre .request,
32
+ pre .status {
33
+ color: #008;
34
+ }
35
+
36
+ pre .envvar,
37
+ pre .tex .special {
38
+ color: #660;
39
+ }
40
+
41
+ pre .string {
42
+ color: rgb(196,26,22);
43
+ }
44
+ pre .tag .value,
45
+ pre .cdata,
46
+ pre .filter .argument,
47
+ pre .attr_selector,
48
+ pre .apache .cbracket,
49
+ pre .date,
50
+ pre .regexp {
51
+ color: #080;
52
+ }
53
+
54
+ pre .sub .identifier,
55
+ pre .pi,
56
+ pre .tag,
57
+ pre .tag .keyword,
58
+ pre .decorator,
59
+ pre .ini .title,
60
+ pre .shebang,
61
+ pre .input_number,
62
+ pre .hexcolor,
63
+ pre .rules .value,
64
+ pre .css .value .number,
65
+ pre .symbol,
66
+ pre .symbol .string,
67
+ pre .number,
68
+ pre .css .function,
69
+ pre .clojure .title,
70
+ pre .clojure .built_in {
71
+ color: rgb(28,0,207);
72
+ }
73
+
74
+ pre .class .title,
75
+ pre .haskell .type,
76
+ pre .smalltalk .class,
77
+ pre .javadoctag,
78
+ pre .yardoctag,
79
+ pre .phpdoc,
80
+ pre .typename,
81
+ pre .tag .attribute,
82
+ pre .doctype,
83
+ pre .class .id,
84
+ pre .built_in,
85
+ pre .setting,
86
+ pre .params,
87
+ pre .clojure .attribute {
88
+ color: rgb(92,38,153);
89
+ }
90
+
91
+ pre .variable {
92
+ color: rgb(63,110,116);
93
+ }
94
+ pre .css .tag,
95
+ pre .rules .property,
96
+ pre .pseudo,
97
+ pre .subst {
98
+ color: #000;
99
+ }
100
+
101
+ pre .css .class, pre .css .id {
102
+ color: #9B703F;
103
+ }
104
+
105
+ pre .value .important {
106
+ color: #ff7700;
107
+ font-weight: bold;
108
+ }
109
+
110
+ pre .rules .keyword {
111
+ color: #C5AF75;
112
+ }
113
+
114
+ pre .annotation,
115
+ pre .apache .sqbracket,
116
+ pre .nginx .built_in {
117
+ color: #9B859D;
118
+ }
119
+
120
+ pre .preprocessor,
121
+ pre .preprocessor * {
122
+ color: rgb(100,56,32);
123
+ }
124
+
125
+ pre .tex .formula {
126
+ background-color: #EEE;
127
+ font-style: italic;
128
+ }
129
+
130
+ pre .diff .header,
131
+ pre .chunk {
132
+ color: #808080;
133
+ font-weight: bold;
134
+ }
135
+
136
+ pre .diff .change {
137
+ background-color: #BCCFF9;
138
+ }
139
+
140
+ pre .addition {
141
+ background-color: #BAEEBA;
142
+ }
143
+
144
+ pre .deletion {
145
+ background-color: #FFC8BD;
146
+ }
147
+
148
+ pre .comment .yardoctag {
149
+ font-weight: bold;
150
+ }
151
+
152
+ pre .method .id {
153
+ color: #000;
154
+ }
155
+ pre {
156
+ counter-reset: lines;
157
+ }
158
+ pre .line {
159
+ counter-increment: lines;
160
+ }
161
+ pre .line::before {
162
+ content: counter(lines); text-align: right;
163
+ display: inline-block; width: 2em;
164
+ padding-right: 0.5em; margin-right: 0.5em;
165
+ color: #eee8d5;
166
+ }
167
+
168
+ pre .line-callout::before {
169
+ content: '\2192'; text-align: right;
170
+ display: inline-block; width: 2em;
171
+ padding-right: 0.5em; margin-right: 0.5em;
172
+ color: #002b36;
173
+ }
174
+
175
+ .lines-callout {
176
+ border-radius: 0.25em;
177
+ padding-top: 0.15em;
178
+ padding-bottom: 0.15em;
179
+ }
180
+
181
+ .lines-callout {
182
+ padding-top: 0.1em;
183
+ padding-bottom: 0.1em;
184
+ background: #EEE;
185
+ }
@@ -0,0 +1,144 @@
1
+ /*
2
+
3
+ Zenburn style from voldmar.ru (c) Vladimir Epifanov <voldmar@voldmar.ru>
4
+ based on dark.css by Ivan Sagalaev
5
+
6
+ */
7
+
8
+ pre code {
9
+ display: block; padding: 0.5em;
10
+ background: #3F3F3F;
11
+ color: #DCDCDC;
12
+ }
13
+
14
+ pre .keyword,
15
+ pre .tag,
16
+ pre .css .class,
17
+ pre .css .id,
18
+ pre .lisp .title,
19
+ pre .nginx .title,
20
+ pre .request,
21
+ pre .status,
22
+ pre .clojure .attribute {
23
+ color: #E3CEAB;
24
+ }
25
+
26
+ pre .django .template_tag,
27
+ pre .django .variable,
28
+ pre .django .filter .argument {
29
+ color: #DCDCDC;
30
+ }
31
+
32
+ pre .number,
33
+ pre .date {
34
+ color: #8CD0D3;
35
+ }
36
+
37
+ pre .dos .envvar,
38
+ pre .dos .stream,
39
+ pre .variable,
40
+ pre .apache .sqbracket {
41
+ color: #EFDCBC;
42
+ }
43
+
44
+ pre .dos .flow,
45
+ pre .diff .change,
46
+ pre .python .exception,
47
+ pre .python .built_in,
48
+ pre .literal,
49
+ pre .tex .special {
50
+ color: #EFEFAF;
51
+ }
52
+
53
+ pre .diff .chunk,
54
+ pre .ruby .subst {
55
+ color: #8F8F8F;
56
+ }
57
+
58
+ pre .dos .keyword,
59
+ pre .python .decorator,
60
+ pre .title,
61
+ pre .haskell .type,
62
+ pre .diff .header,
63
+ pre .ruby .class .parent,
64
+ pre .apache .tag,
65
+ pre .nginx .built_in,
66
+ pre .tex .command,
67
+ pre .input_number {
68
+ color: #efef8f;
69
+ }
70
+
71
+ pre .dos .winutils,
72
+ pre .ruby .symbol,
73
+ pre .ruby .symbol .string,
74
+ pre .ruby .string {
75
+ color: #DCA3A3;
76
+ }
77
+
78
+ pre .diff .deletion,
79
+ pre .string,
80
+ pre .tag .value,
81
+ pre .preprocessor,
82
+ pre .built_in,
83
+ pre .sql .aggregate,
84
+ pre .javadoc,
85
+ pre .smalltalk .class,
86
+ pre .smalltalk .localvars,
87
+ pre .smalltalk .array,
88
+ pre .css .rules .value,
89
+ pre .attr_selector,
90
+ pre .pseudo,
91
+ pre .apache .cbracket,
92
+ pre .tex .formula {
93
+ color: #CC9393;
94
+ }
95
+
96
+ pre .shebang,
97
+ pre .diff .addition,
98
+ pre .comment,
99
+ pre .java .annotation,
100
+ pre .template_comment,
101
+ pre .pi,
102
+ pre .doctype {
103
+ color: #7F9F7F;
104
+ }
105
+
106
+ pre .coffeescript .javascript,
107
+ pre .xml .css,
108
+ pre .xml .javascript,
109
+ pre .xml .vbscript,
110
+ pre .tex .formula {
111
+ opacity: 0.5;
112
+ }
113
+
114
+ pre {
115
+ counter-reset: lines;
116
+ }
117
+ pre .line {
118
+ counter-increment: lines;
119
+ }
120
+ pre .line::before {
121
+ content: counter(lines); text-align: right;
122
+ display: inline-block; width: 2em;
123
+ padding-right: 0.5em; margin-right: 0.5em;
124
+ color: #eee8d5;
125
+ }
126
+
127
+ pre .line-callout::before {
128
+ content: '\2192'; text-align: right;
129
+ display: inline-block; width: 2em;
130
+ padding-right: 0.5em; margin-right: 0.5em;
131
+ color: #002b36;
132
+ }
133
+
134
+ .lines-callout {
135
+ border-radius: 0.25em;
136
+ padding-top: 0.15em;
137
+ padding-bottom: 0.15em;
138
+ }
139
+
140
+ .lines-callout {
141
+ padding-top: 0.1em;
142
+ padding-bottom: 0.1em;
143
+ opacity: 0.5;
144
+ }
data/erb/index.html.erb CHANGED
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <title><%= title %></title>
5
5
  <script src="js/lib/jquery-1.8.0.min.js"></script>
6
- <script src="js/lib/highlight-fc32801.min.js"></script>
6
+ <script src="js/lib/highlight-7.1.min.js"></script>
7
7
  <script src="js/lib/jquerytypewriter.js"></script>
8
8
  <script src="js/lib/underscore-1.3.3.min.js"></script>
9
9
  <script src="js/utils.js"></script>
@@ -12,7 +12,7 @@
12
12
  <script src="js/trickster.js"></script>
13
13
  <script src="js/custom.js"></script>
14
14
  <link rel="stylesheet" href="css/normalize.css">
15
- <link rel="stylesheet" href="css/highlight-solarized_light.min.css">
15
+ <link rel="stylesheet" href="css/theme.css">
16
16
  <link rel="stylesheet" href="css/styles.css">
17
17
  <script>
18
18
  $(window).load(function() {
@@ -0,0 +1,18 @@
1
+ Feature: I can build my slideshow
2
+ In order to view my slideshow
3
+ I must build it from the presentation source
4
+ so I have the HTML good to go.
5
+
6
+ Scenario: Can build a slidehsow
7
+ Given a slideshow in "test_slideshow"
8
+ When I cd to "test_slideshow"
9
+ And I successfully run `trickster build`
10
+ Then a file named "index.html" should exist
11
+
12
+ Scenario: Can build a slideshow that uses sass
13
+ Given a slideshow in "test_slideshow" that uses sass
14
+ When I cd to "test_slideshow"
15
+ And I successfully run `trickster build`
16
+ Then a file named "index.html" should exist
17
+ And a file named "css/styles.css" should exist
18
+
@@ -0,0 +1,57 @@
1
+ Feature: I can create a new slideshow
2
+ In order to make an awesome slideshow
3
+ I want to create the slideshow directory
4
+ with everything i need
5
+
6
+ Scenario: Can init a new slideshow
7
+ Given there is no directory named "slideshow"
8
+ When I successfully run `trickster init slideshow`
9
+ Then a directory named "slideshow" should exist
10
+ And a file named "slideshow/slides" should exist
11
+ And the file "slideshow/slides" should contain:
12
+ """
13
+ slideshow
14
+ !TITLE
15
+ Title of your slideshow
16
+ Subtitle
17
+ Sub-sub title
18
+
19
+ !SECTION: background=dddddd
20
+ A section
21
+
22
+ !BULLETS
23
+ A bullet list
24
+ * can use any
25
+ - reasonable
26
+ + bullet
27
+
28
+ !CODE: callout=3,4,5
29
+ class YourCode
30
+
31
+ def initialize(will)
32
+ @be_highlighted
33
+ end
34
+
35
+ end
36
+ """
37
+ And a directory named "slideshow/js" should exist
38
+ And the directory "slideshow/js" should contain all the trickster JavaScript files and support libs
39
+ And a directory named "slideshow/css" should exist
40
+ And the directory "slideshow/css" should contain all the trickster CSS files and support stylesheets
41
+ And the output should contain "Your slideshow is ready, run trickster build to build it"
42
+ And "css/theme.css" in "slideshow" should be identical to "default.css"
43
+
44
+ Scenario: Can init a new slideshow with a different theme
45
+ Given there is no directory named "slideshow"
46
+ When I successfully run `trickster init -t github slideshow`
47
+ Then a directory named "slideshow" should exist
48
+ And a file named "slideshow/slides" should exist
49
+ And "css/theme.css" in "slideshow" should be identical to "github.css"
50
+
51
+ Scenario: Can init a new slideshow with a custom theme
52
+ Given there is no directory named "slideshow"
53
+ When I successfully run `trickster init -t custom slideshow`
54
+ Then a directory named "slideshow" should exist
55
+ And a file named "slideshow/slides" should exist
56
+ And "css/theme.scss" in "slideshow" should be identical to "custom.scss"
57
+ But a file named "slideshow/css/theme.css" should not exist
@@ -0,0 +1,78 @@
1
+ require 'fileutils'
2
+
3
+ When /^I get help for "([^"]*)"$/ do |app_name|
4
+ @app_name = app_name
5
+ step %(I run `#{app_name} help`)
6
+ end
7
+
8
+ Given /^there is no directory named "(.*?)"$/ do |dir|
9
+ FileUtils.rm_rf(dir)
10
+ end
11
+
12
+ def setup_slideshow_dir(src_dir,dest_dir)
13
+ FileUtils.rm_rf("tmp/aruba/#{dest_dir}")
14
+ FileUtils.mkdir_p("tmp/aruba") unless File.exists?("tmp/aruba")
15
+ FileUtils.cp_r("test/#{src_dir}","tmp/aruba/#{dest_dir}")
16
+ end
17
+ Given /^a slideshow in "(.*?)"$/ do |dir|
18
+ setup_slideshow_dir('slideshow',dir)
19
+ end
20
+
21
+ Given /^a slideshow in "(.*?)" that uses sass$/ do |dir|
22
+ setup_slideshow_dir('slideshow-with-sass',dir)
23
+ end
24
+
25
+
26
+
27
+ Then /^the file "(.*?)" should contain:$/ do |file, partial_content|
28
+ check_file_content(file, partial_content, true)
29
+ end
30
+
31
+ Then /^the directory "(.*?)" should contain all the trickster JavaScript files and support libs$/ do |dir|
32
+ dir = dir.gsub(/\/js\/?/,'')
33
+ Dir["js/*.js"].each do |js_file|
34
+ step %{a file named "#{dir}/#{js_file}" should exist}
35
+ end
36
+ Dir["js/lib/*.js"].each do |js_file|
37
+ step %{a file named "#{dir}/#{js_file}" should exist}
38
+ end
39
+ end
40
+
41
+ Then /^the directory "(.*?)" should contain all the trickster CSS files and support stylesheets$/ do |dir|
42
+ dir = dir.gsub(/\/css\/?/,'')
43
+ Dir["css/*.css"].each do |css_file|
44
+ step %{a file named "#{dir}/#{css_file}" should exist}
45
+ end
46
+ end
47
+
48
+ Given /^the JS files and CSS files in "(.*?)" are out\-of\-date$/ do |dir|
49
+ FileUtils.rm("tmp/aruba/#{dir}/js/trickster.js")
50
+ FileUtils.rm("tmp/aruba/#{dir}/js/sizer.js")
51
+ FileUtils.rm("tmp/aruba/#{dir}/js/bullets.js")
52
+ FileUtils.rm("tmp/aruba/#{dir}/css/normalize.css")
53
+ end
54
+
55
+ Then /^the JS files and CSS files in "(.*?)" should be up\-to\-date$/ do |dir|
56
+ Dir["js/*.js"].each do |js_file|
57
+ File.exist?("tmp/aruba/#{dir}/#{js_file}").should == true
58
+ end
59
+ Dir["js/lib/*.js"].each do |js_file|
60
+ File.exist?("tmp/aruba/#{dir}/#{js_file}").should == true
61
+ end
62
+ Dir["css/*.css"].each do |css_file|
63
+ File.exist?("tmp/aruba/#{dir}/#{css_file}").should == true
64
+ end
65
+ end
66
+
67
+ Then /^"(.*?)" in "(.*?)" should not have been touched$/ do |file,dir|
68
+ original = File.read("test/slideshow/#{file}")
69
+ in_slideshow = File.read("tmp/aruba/#{dir}/#{file}")
70
+ original.should == in_slideshow
71
+ end
72
+
73
+ Then /^"(.*?)" in "(.*?)" should be identical to "(.*?)"$/ do |css_file, dir, original_css_file|
74
+ got = File.read("tmp/aruba/#{dir}/#{css_file}")
75
+ expect = File.read(File.join(File.dirname(__FILE__),'..','..','css','themes',original_css_file))
76
+
77
+ got.should == expect
78
+ end