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
data/.gitignore ADDED
@@ -0,0 +1,16 @@
1
+ doc
2
+ src
3
+ images
4
+ html
5
+ *.sw?
6
+ pkg
7
+ .jhw-cache
8
+ coverage
9
+ .bundle
10
+ tmp
11
+ cruddo.rdoc
12
+ gli.wiki
13
+ Gemfile.lock
14
+ results.html
15
+ .rbx
16
+ .DS_Store
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use 1.9.3@trickster --create
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source :rubygems
2
+ gemspec
data/README.rdoc CHANGED
@@ -9,7 +9,7 @@ JavaScript, which will dynamically resize each slide to the biggest it can be ba
9
9
 
10
10
  == Presentation Format
11
11
 
12
- Your presentation is stored in text file. Each slide has the following format:
12
+ Your presentation is stored in a text file. Each slide has the following format:
13
13
 
14
14
  !<slide_type>: options
15
15
  <content>
@@ -53,11 +53,11 @@ transition:: number of milliseconds to transition to the *next* slide. The defa
53
53
  The first line is the "title" if this slide, rendered in an +H1+. The remaining are bullets. If a bullet line is preceded with a <tt>*</tt>, <tt>-</tt>, or <tt>+</tt>, that bullet character is omitted automatically.
54
54
 
55
55
  == IMAGE
56
- The first line is the url to the image to show.
56
+ The first line is the url to the image to show. Trickster will size the image down only if it is too big, preserving its aspect ratio.
57
57
 
58
58
  == CODE
59
59
 
60
- If the first line starts with <tt>file://</tt>, the contents of this file is read in as the contents of the code block. Otherwise, the entire contents of the slide is verbatim put into a +pre+ and then +code+ block. Syntax highlighting is done using a modified version of +highlight.js+. This modification demarcates each line of the code, and allows you to show line numbers and callout particular lines.
60
+ If the first line starts with <tt>file://</tt>, the contents of this file is read in as the contents of the code block. Otherwise, the entire contents of the slide is verbatim put into a +pre+ and then +code+ block. Syntax highlighting is done using +highlight.js+.
61
61
 
62
62
  === Language
63
63
 
@@ -74,6 +74,14 @@ A code slide accepts an option of +callout+ which is a comma-delimited list of t
74
74
 
75
75
  Further, if the line number is preceded with a dash (e.g. <tt>-3</tt>), that line will be styled for strikethrough, in addition to being highlighed. This is useful to show lines of code that are going to be deleted based on whatever you are talking about.
76
76
 
77
+ === Highlighting Themes
78
+
79
+ Trickster comes with all the themes provided by highlight.js, as well a customizable theme in SCSS. When you create your slideshow, use <tt>--theme</tt> to specify the syntax highlighting theme. <code>trickster help init</code> will show the list of themes available.
80
+
81
+ If you want easily create a custom highlighting scheme, the theme +custom+ generates a SASS template with variables to allow you to easily set the colors you want.
82
+
83
+ Once your slideshow has been created, you can change the theme via <code>trickster update theme</code>. <strong>This is destructive</strong> so make sure your slideshow is checked into version control.
84
+
77
85
  == COMMANDLINE
78
86
 
79
87
  This slide is for showing command-line invocations and results. It is assumed to start with a CLI invocation and that such invocations are followed by results, that can be many lines. When you present the slideshow, the command will be output in a "typewriter" style, after which the result will be shown automatically, with each command acting like a "bullet" to be revealed.
@@ -105,7 +113,7 @@ The second, and more useful, point of customization is +styles.css+ or +styles.s
105
113
 
106
114
  * Prefer 'em' over explicit sizes, as this will aloww your sizing choices to work at any size (remember that Trickster tries to fit your content to the screen)
107
115
  * The <tt>BODY</tt> element will be given the class of the currently-displayed slide, so if you want to, for example, change the background color of a slide based on its type, apply styles to <tt>body.SLIDE_TYPE</tt> and not <tt>section.SLIDE_TYPE</tt>
108
- * The syntax highlighting is woefully tied to Solarized Light. Since we are using a patched version of highlight.js that shows line numbers and calls out lines, I had to patch the syntax CSS file to show those highlights. I've currently only done so for Solarized Light, and this style is hard-coded in the generated HTML file, anway. Sorry. Feel free to improve this for me and I'll commit the patch.
116
+ * If you want to customzie the syntax highlighting, you can. <tt>trickster update</tt> will leave it alone. If you want to build a more invovled highlighting theme, use the "custom" theme when you create your presentation or migrate to it via <tt>trickster update theme -t custom</tt>
109
117
 
110
118
  == Delivering the Presentation
111
119
 
@@ -113,7 +121,7 @@ Simply open `index.html` in your browser. Your browser should be Safari or Chro
113
121
 
114
122
  Every time you reload, the presentation will be dynamically sized to the size of the browser, so you should configure your browser and monitor to the size of your presentation, then reload.
115
123
 
116
- Occasionally, Trickster will size the slides too larger or too small. In that case, you can use "-" and "+" to resize the slides on the fly. If you reload, the sizes will be reset.
124
+ Occasionally, Trickster will size the slides too larger or too small. In that case, you can use "-" and "+" to resize the slides on the fly. Note that if you you reload, the sizes will be reset.
117
125
 
118
126
  === Keyboard Commands
119
127
 
@@ -131,7 +139,7 @@ Trickster discourages verbose slides with lots of text or lots of bullets. This
131
139
 
132
140
  == trickster - Bootstrap, generate, and manage your trickster presentation
133
141
 
134
- v0.0.4
142
+ v0.0.5
135
143
 
136
144
  === Global Options
137
145
  === --help
@@ -185,16 +193,52 @@ You can examine the file `slides` to see some examples of how to format your
185
193
  presentation. You can run `trickster build` in the directory to create the HTML
186
194
  file from your slides.
187
195
 
188
- Note that if you upgrade trickster, you should run `tricksterd update` in your slide directory
196
+ Note that if you upgrade trickster, you should run `trickster update` in your slide directory
189
197
  to get the latest JavaScript and CSS files.
198
+ ===== Options
199
+ ===== -t arg
200
+
201
+ Specify the syntax highlighting theme to use. One of arta, ascetic, brown_paper, custom, dark, default, far, github, googlecode, idea, ir_black, magula, monokai, pojoaque, rainbow, school_book, solarized_dark, solarized_light, sunburst, tomorrow, tomorrow-night, tomorrow-night-blue, tomorrow-night-bright, tomorrow-night-eighties, vs, xcode, zenburn. Use 'custom' to get an scss file you can easily customize.
202
+
203
+ [Aliases] --theme
204
+ [Default Value] default
205
+ [Must Match] ["arta", "ascetic", "brown_paper", "custom", "dark", "default", "far", "github", "googlecode", "idea", "ir_black", "magula", "monokai", "pojoaque", "rainbow", "school_book", "solarized_dark", "solarized_light", "sunburst", "tomorrow", "tomorrow-night", "tomorrow-night-blue", "tomorrow-night-bright", "tomorrow-night-eighties", "vs", "xcode", "zenburn"]
206
+
207
+
190
208
  ==== update [dir_name]
191
- Update an existing slideshow with the latest Trickster JS/CSS files
209
+ Update your slideshow with files provided by trickster
210
+
211
+
212
+
213
+ ===== Commands
214
+ ====== files slide_dir
215
+ Update the trickster JS/CSS files when you've updated the trickster gem
192
216
 
193
217
 
194
218
  Run this after you've upgraded trickster and want to get the latest features. Since your
195
- slideshow is entirely self-contained, when you upgrade tricksterd, your static JavaScript and
196
- CSS files will be out of date.
219
+ slideshow is entirely self-contained, when you upgrade trickster, your static JavaScript and
220
+ CSS files will be out of date.
221
+
222
+ Note that `styles.css`, which was provided by trickster as a basis for styling, will not
223
+ be touched, and your customizations will remain. All other files that trickster gave you
224
+ when you ran `trickster init` will be overwritten.
225
+ ====== theme slide_dir
226
+ Update the syntax-highlighting theme for your presentation
227
+
228
+
229
+ A normal 'trickster update' will leave your theme.css alone, since you can customize it. This will overwrite
230
+ your existing theme.css with the theme from trickster that you specify. You should check your presentation
231
+ into source control to avoid the destructive nature of this command.
232
+ ======= Options
233
+ ======= -t slide_dir
234
+
235
+ Specify the syntax highlighting theme to use. One of arta, ascetic, brown_paper, custom, dark, default, far, github, googlecode, idea, ir_black, magula, monokai, pojoaque, rainbow, school_book, solarized_dark, solarized_light, sunburst, tomorrow, tomorrow-night, tomorrow-night-blue, tomorrow-night-bright, tomorrow-night-eighties, vs, xcode, zenburn. Use 'custom' to get an scss file you can easily customize.
236
+
237
+ [Aliases] --theme
238
+ [Default Value] default
239
+ [Must Match] ["arta", "ascetic", "brown_paper", "custom", "dark", "default", "far", "github", "googlecode", "idea", "ir_black", "magula", "monokai", "pojoaque", "rainbow", "school_book", "solarized_dark", "solarized_light", "sunburst", "tomorrow", "tomorrow-night", "tomorrow-night-blue", "tomorrow-night-bright", "tomorrow-night-eighties", "vs", "xcode", "zenburn"]
240
+ A normal 'trickster update' will leave your theme.css alone, since you can customize it. This will overwrite
241
+ your existing theme.css with the theme from trickster that you specify. You should check your presentation
242
+ into source control to avoid the destructive nature of this command.
197
243
 
198
- Note that `styles.css`, which was provided by trickster as a basis for styling, will not
199
- be touched, and your customizations will remain. All other files that trickster gave you
200
- when you ran `trickster init` will be overwritten.
244
+ [Default Command] files
data/Rakefile ADDED
@@ -0,0 +1,120 @@
1
+ require 'rake/clean'
2
+ require 'bundler'
3
+ require 'rdoc/task'
4
+ require 'cucumber'
5
+ require 'cucumber/rake/task'
6
+
7
+ Bundler::GemHelper.install_tasks
8
+
9
+ CLEAN << "test/slideshow/index.html"
10
+
11
+ Rake::RDocTask.new do |rd|
12
+ rd.main = "README.rdoc"
13
+ rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
14
+ rd.title = 'Your application title'
15
+ end
16
+
17
+ CUKE_RESULTS = 'results.html'
18
+ CLEAN << CUKE_RESULTS
19
+ CLOBBER << 'tmp/aruba'
20
+ desc 'Run features'
21
+ Cucumber::Rake::Task.new(:features) do |t|
22
+ opts = "features --format html -o #{CUKE_RESULTS} --format progress -x"
23
+ opts += " --tags #{ENV['TAGS']}" if ENV['TAGS']
24
+ t.cucumber_opts = opts
25
+ t.fork = false
26
+ end
27
+
28
+ desc 'Run features tagged as work-in-progress (@wip)'
29
+ Cucumber::Rake::Task.new('features:wip') do |t|
30
+ tag_opts = ' --tags ~@pending'
31
+ tag_opts = ' --tags @wip'
32
+ t.cucumber_opts = "features --format html -o #{CUKE_RESULTS} --format pretty -x -s#{tag_opts}"
33
+ t.fork = false
34
+ end
35
+
36
+ task :cucumber => :features
37
+ task 'cucumber:wip' => 'features:wip'
38
+ task :wip => 'features:wip'
39
+
40
+ task :jasmine do |t|
41
+ unless system("jasmine-headless-webkit -j test/jasmine.yml")
42
+ exit -1
43
+ end
44
+ end
45
+ CLOBBER << ".jhw-cache"
46
+
47
+ require 'rake/testtask'
48
+ Rake::TestTask.new do |t|
49
+ t.libs << "test"
50
+ t.test_files = FileList['test/*_test.rb']
51
+ end
52
+
53
+ desc 'Add CSS markup to the theme files for callouts'
54
+ task 'patch_css' do
55
+ Dir["css/themes-orig/*.css"].each do |original_css_file|
56
+ new_css_file = "css/themes/" + File.basename(original_css_file)
57
+ background = nil
58
+ opacity = nil
59
+ look_for_background = false
60
+ File.open(new_css_file,'w') do |new_file|
61
+ File.open(original_css_file).readlines.each do |line|
62
+ new_file.puts line
63
+
64
+ if look_for_background
65
+ if line =~ /background-color: (.*);/
66
+ background = $1;
67
+ look_for_background = false
68
+ elsif line =~ /background: (.*);/
69
+ background = $1;
70
+ look_for_background = false
71
+ elsif line =~ /opacity: (.*);/
72
+ opacity = $1;
73
+ look_for_background = false
74
+ end
75
+ end
76
+
77
+ if line =~ /^pre .tex .formula {/
78
+ look_for_background = true
79
+ end
80
+ end
81
+ string = <<EOS
82
+ pre {
83
+ counter-reset: lines;
84
+ }
85
+ pre .line {
86
+ counter-increment: lines;
87
+ }
88
+ pre .line::before {
89
+ content: counter(lines); text-align: right;
90
+ display: inline-block; width: 2em;
91
+ padding-right: 0.5em; margin-right: 0.5em;
92
+ color: #eee8d5;
93
+ }
94
+
95
+ pre .line-callout::before {
96
+ content: '\\2192'; text-align: right;
97
+ display: inline-block; width: 2em;
98
+ padding-right: 0.5em; margin-right: 0.5em;
99
+ color: #002b36;
100
+ }
101
+
102
+ .lines-callout {
103
+ border-radius: 0.25em;
104
+ padding-top: 0.15em;
105
+ padding-bottom: 0.15em;
106
+ }
107
+
108
+ .lines-callout {
109
+ padding-top: 0.1em;
110
+ padding-bottom: 0.1em;
111
+ #{background.nil? ? opacity.nil? ? '/* Could not determine background for callouts */' : ("opacity: " + opacity + ";") : ("background: " + background + ";")}
112
+ }
113
+ EOS
114
+ new_file.puts string
115
+ end
116
+ puts "Migrated #{original_css_file}"
117
+ end
118
+ end
119
+
120
+ task :default => [:test,:jasmine,:features]
data/TODO ADDED
@@ -0,0 +1,4 @@
1
+ * Have executable generate a bundle instead of running it out this dir
2
+ * Implement 'watch' to regenerate
3
+ * Implement 'init' to boostrap bundle
4
+ * SASS
data/bin/trickster CHANGED
@@ -7,10 +7,23 @@ require 'fileutils'
7
7
 
8
8
  include GLI::App
9
9
 
10
+ BASE_DIR = File.expand_path(File.join(File.dirname(__FILE__),'..'))
11
+
12
+ THEMES = Dir[File.join(BASE_DIR,'css','themes') + "/*.css",
13
+ File.join(BASE_DIR,'css','themes') + "/*.scss"].map { |file|
14
+ File.basename(file).gsub(/\.css$/,'').gsub(/\.scss/,'')
15
+ }.sort
16
+
10
17
  program_desc 'Bootstrap, generate, and manage your trickster presentation'
11
18
 
12
19
  version Trickster::VERSION
13
20
 
21
+ def add_theme_flag(command)
22
+ command.desc "Specify the syntax highlighting theme to use. One of #{THEMES.join(', ')}. Use 'custom' to get an scss file you can easily customize."
23
+ command.default_value 'default'
24
+ command.flag [:t,:theme], :must_match => THEMES
25
+ end
26
+
14
27
  desc 'Create a new trickster presentation'
15
28
  long_desc <<EOS
16
29
  This will create a completely self-contained presentation that can be run just from the files
@@ -21,11 +34,14 @@ You can examine the file `slides` to see some examples of how to format your
21
34
  presentation. You can run `trickster build` in the directory to create the HTML
22
35
  file from your slides.
23
36
 
24
- Note that if you upgrade trickster, you should run `tricksterd update` in your slide directory
37
+ Note that if you upgrade trickster, you should run `trickster update` in your slide directory
25
38
  to get the latest JavaScript and CSS files.
26
39
  EOS
27
40
  arg_name 'dir_name'
28
41
  command :init do |c|
42
+
43
+ add_theme_flag(c)
44
+
29
45
  c.action do |global_options,options,args|
30
46
  dir = args.shift
31
47
  FileUtils.mkdir(dir)
@@ -55,40 +71,66 @@ class YourCode
55
71
 
56
72
  end
57
73
  EOF
58
- base = File.expand_path(File.join(File.dirname(__FILE__),'..'))
59
74
 
60
- copier = Trickster::FileCopier.new(base,dir)
61
- copier.copy_files('js','js')
62
- copier.copy_files('js/lib','js')
63
- copier.copy_files('css','css')
75
+ file_copier = Trickster::FileCopier.new(BASE_DIR,dir)
76
+ file_copier.copy_files('js','js')
77
+ file_copier.copy_files('js/lib','js')
78
+ file_copier.copy_files('css','css')
79
+
80
+ theme_copier = Trickster::ThemeCopier.new(BASE_DIR,dir)
81
+ theme_copier.copy_theme(options[:theme])
64
82
 
65
83
  puts "Your slideshow is ready, run trickster build to build it"
66
84
  end
67
85
  end
68
86
  end
69
87
 
70
- desc 'Update an existing slideshow with the latest Trickster JS/CSS files'
71
- long_desc <<EOS
72
- Run this after you've upgraded trickster and want to get the latest features. Since your
73
- slideshow is entirely self-contained, when you upgrade tricksterd, your static JavaScript and
74
- CSS files will be out of date.
75
-
76
- Note that `styles.css`, which was provided by trickster as a basis for styling, will not
77
- be touched, and your customizations will remain. All other files that trickster gave you
78
- when you ran `trickster init` will be overwritten.
79
- EOS
88
+ desc 'Update your slideshow with files provided by trickster'
80
89
  arg_name '[dir_name]'
81
90
  command :update do |c|
82
- c.action do |global_options,options,args|
83
- dir = args.shift
84
- dir = '.' if dir.nil?
85
- base = File.expand_path(File.join(File.dirname(__FILE__),'..'))
86
91
 
87
- copier = Trickster::FileCopier.new(base,dir)
88
- copier.copy_files('js','js', :except => "custom.js")
89
- copier.copy_files('js/lib','js')
90
- copier.copy_files('css','css', :except => "styles.css")
92
+ c.desc "Update the trickster JS/CSS files when you've updated the trickster gem"
93
+ c.long_desc <<-EOS
94
+ Run this after you've upgraded trickster and want to get the latest features. Since your
95
+ slideshow is entirely self-contained, when you upgrade trickster, your static JavaScript and
96
+ CSS files will be out of date.
97
+
98
+ Note that `styles.css`, which was provided by trickster as a basis for styling, will not
99
+ be touched, and your customizations will remain. All other files that trickster gave you
100
+ when you ran `trickster init` will be overwritten.
101
+ EOS
102
+ c.arg_name 'slide_dir'
103
+ c.command :files do |files_command|
104
+ files_command.action do |global_options,options,args|
105
+ dir = args.shift
106
+ dir = '.' if dir.nil?
107
+
108
+ copier = Trickster::FileCopier.new(BASE_DIR,dir)
109
+ copier.copy_files('js','js', :except => "custom.js")
110
+ copier.copy_files('js/lib','js')
111
+ copier.copy_files('css','css', :except => "styles.css")
112
+ end
91
113
  end
114
+
115
+ c.desc 'Update the syntax-highlighting theme for your presentation'
116
+ c.long_desc <<-EOS
117
+ A normal 'trickster update' will leave your theme.css alone, since you can customize it. This will overwrite
118
+ your existing theme.css with the theme from trickster that you specify. You should check your presentation
119
+ into source control to avoid the destructive nature of this command.
120
+ EOS
121
+ c.arg_name 'slide_dir'
122
+ c.command :theme do |theme_command|
123
+ add_theme_flag(theme_command)
124
+
125
+ theme_command.action do |global_options,options,args|
126
+ dir = args.shift
127
+ dir = '.' if dir.nil?
128
+ theme_copier = Trickster::ThemeCopier.new(BASE_DIR,dir)
129
+ theme_copier.copy_theme(options[:theme])
130
+ end
131
+ end
132
+
133
+ c.default_command :files
92
134
  end
93
135
 
94
136
  desc 'Generate the presentation from your slides'
@@ -0,0 +1,155 @@
1
+ /*
2
+ Date: 17.V.2011
3
+ Author: pumbur <pumbur@pumbur.net>
4
+ */
5
+
6
+ pre code
7
+ {
8
+ display: block; padding: 0.5em;
9
+ background: #222;
10
+ }
11
+
12
+ pre .profile .header *,
13
+ pre .ini .title,
14
+ pre .nginx .title
15
+ {
16
+ color: #fff;
17
+ }
18
+
19
+ pre .comment,
20
+ pre .javadoc,
21
+ pre .preprocessor,
22
+ pre .preprocessor .title,
23
+ pre .shebang,
24
+ pre .profile .summary,
25
+ pre .diff,
26
+ pre .pi,
27
+ pre .doctype,
28
+ pre .tag,
29
+ pre .template_comment,
30
+ pre .css .rules,
31
+ pre .tex .special
32
+ {
33
+ color: #444;
34
+ }
35
+
36
+ pre .string,
37
+ pre .symbol,
38
+ pre .diff .change,
39
+ pre .regexp,
40
+ pre .xml .attribute,
41
+ pre .smalltalk .char,
42
+ pre .xml .value,
43
+ pre .ini .value,
44
+ pre .clojure .attribute
45
+ {
46
+ color: #ffcc33;
47
+ }
48
+
49
+ pre .number,
50
+ pre .addition
51
+ {
52
+ color: #00cc66;
53
+ }
54
+
55
+ pre .built_in,
56
+ pre .literal,
57
+ pre .vhdl .typename,
58
+ pre .go .constant,
59
+ pre .go .typename,
60
+ pre .ini .keyword,
61
+ pre .lua .title,
62
+ pre .perl .variable,
63
+ pre .php .variable,
64
+ pre .mel .variable,
65
+ pre .django .variable,
66
+ pre .css .funtion,
67
+ pre .smalltalk .method,
68
+ pre .hexcolor,
69
+ pre .important,
70
+ pre .flow,
71
+ pre .inheritance,
72
+ pre .parser3 .variable
73
+ {
74
+ color: #32AAEE;
75
+ }
76
+
77
+ pre .keyword,
78
+ pre .tag .title,
79
+ pre .css .tag,
80
+ pre .css .class,
81
+ pre .css .id,
82
+ pre .css .pseudo,
83
+ pre .css .attr_selector,
84
+ pre .lisp .title,
85
+ pre .clojure .built_in,
86
+ pre .winutils,
87
+ pre .tex .command,
88
+ pre .request,
89
+ pre .status
90
+ {
91
+ color: #6644aa;
92
+ }
93
+
94
+ pre .title,
95
+ pre .ruby .constant,
96
+ pre .vala .constant,
97
+ pre .parent,
98
+ pre .deletion,
99
+ pre .template_tag,
100
+ pre .css .keyword,
101
+ pre .objectivec .class .id,
102
+ pre .smalltalk .class,
103
+ pre .lisp .keyword,
104
+ pre .apache .tag,
105
+ pre .nginx .variable,
106
+ pre .envvar,
107
+ pre .bash .variable,
108
+ pre .go .built_in,
109
+ pre .vbscript .built_in,
110
+ pre .lua .built_in,
111
+ pre .rsl .built_in,
112
+ pre .tail,
113
+ pre .avrasm .label,
114
+ pre .tex .formula,
115
+ pre .tex .formula *
116
+ {
117
+ color: #bb1166;
118
+ }
119
+
120
+ pre .yardoctag,
121
+ pre .phpdoc,
122
+ pre .profile .header,
123
+ pre .ini .title,
124
+ pre .apache .tag,
125
+ pre .parser3 .title
126
+ {
127
+ font-weight: bold;
128
+ }
129
+
130
+ pre .coffeescript .javascript,
131
+ pre .xml .javascript,
132
+ pre .xml .css,
133
+ pre .xml .cdata
134
+ {
135
+ opacity: 0.6;
136
+ }
137
+
138
+ pre code,
139
+ pre .javascript,
140
+ pre .css,
141
+ pre .xml,
142
+ pre .subst,
143
+ pre .diff .chunk,
144
+ pre .css .value,
145
+ pre .css .attribute,
146
+ pre .lisp .string,
147
+ pre .lisp .number,
148
+ pre .tail .params,
149
+ pre .container,
150
+ pre .haskell *,
151
+ pre .erlang *,
152
+ pre .erlang_repl *
153
+ {
154
+ color: #aaa;
155
+ }