reveal-ck 0.2.0 → 0.3.0
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.
- checksums.yaml +6 -14
- data/LICENSE +2 -2
- data/README.md +30 -5
- data/Rakefile +4 -5
- data/bin/reveal-ck +70 -86
- data/features/step_definitions/file_management_steps.rb +1 -1
- data/features/support/env.rb +0 -14
- data/lib/reveal-ck.rb +12 -8
- data/lib/reveal-ck/builders.rb +8 -3
- data/lib/reveal-ck/builders/copy_files_task.rb +29 -0
- data/lib/reveal-ck/builders/create_index_html.rb +34 -0
- data/lib/reveal-ck/builders/create_slides_html.rb +29 -0
- data/lib/reveal-ck/builders/creation_task.rb +34 -0
- data/lib/reveal-ck/builders/index_html.rb +17 -79
- data/lib/reveal-ck/builders/rake_aware.rb +26 -0
- data/lib/reveal-ck/builders/reveal_js_files.rb +60 -0
- data/lib/reveal-ck/builders/slides_builder.rb +87 -0
- data/lib/reveal-ck/builders/user_files.rb +47 -0
- data/lib/reveal-ck/config.rb +21 -34
- data/lib/reveal-ck/markdown/slide_markdown.rb +10 -3
- data/lib/reveal-ck/markdown/slide_markdown_template.rb +5 -4
- data/lib/reveal-ck/presentation.rb +26 -14
- data/lib/reveal-ck/presentation_dsl.rb +22 -11
- data/lib/reveal-ck/render.rb +4 -0
- data/lib/reveal-ck/render/contents_of.rb +10 -0
- data/lib/reveal-ck/render/css_files.rb +15 -0
- data/lib/reveal-ck/render/index_html_maker.rb +35 -0
- data/lib/reveal-ck/render/scope.rb +18 -0
- data/lib/reveal-ck/retrieve.rb +12 -0
- data/lib/reveal-ck/slide.rb +4 -4
- data/lib/reveal-ck/templates.rb +0 -1
- data/lib/reveal-ck/templates/finder.rb +2 -4
- data/lib/reveal-ck/templates/processor.rb +10 -9
- data/lib/reveal-ck/version.rb +2 -1
- data/rakelib/ci.rake +2 -0
- data/rakelib/examples.rake +1 -1
- data/rakelib/relish.rake +26 -0
- data/rakelib/rubocop.rake +3 -0
- data/reveal.js/Gruntfile.js +1 -1
- data/reveal.js/LICENSE +1 -1
- data/reveal.js/README.md +15 -15
- data/reveal.js/css/reveal.css +1 -1
- data/reveal.js/css/reveal.min.css +1 -1
- data/reveal.js/index.html +8 -2
- data/reveal.js/js/reveal.js +1 -1
- data/reveal.js/js/reveal.min.js +2 -2
- data/reveal.js/package.json +1 -1
- data/spec/data/builders/index_html/slides.html +3 -0
- data/spec/data/presentation_dsl/dsl.rb +4 -3
- data/spec/data/render/scope/css_dir/css/custom.css +0 -0
- data/spec/data/render/scope/css_dir/css/nested/custom.css +0 -0
- data/spec/data/{templates/render_scope → render/scope}/quote +0 -0
- data/spec/examples/programmatic_slides_spec.rb +2 -2
- data/spec/examples/slide_output_spec.rb +2 -2
- data/spec/lib/reveal-ck/builders/copy_files_task_spec.rb +74 -0
- data/spec/lib/reveal-ck/builders/create_index_html_spec.rb +41 -0
- data/spec/lib/reveal-ck/builders/create_slides_html_spec.rb +35 -0
- data/spec/lib/reveal-ck/builders/creation_task_spec.rb +75 -0
- data/spec/lib/reveal-ck/builders/index_html_spec.rb +69 -0
- data/spec/lib/reveal-ck/builders/rake_aware_spec.rb +62 -0
- data/spec/lib/reveal-ck/builders/reveal_js_files_spec.rb +32 -0
- data/spec/lib/reveal-ck/builders/slides_builder_spec.rb +66 -0
- data/spec/lib/reveal-ck/builders/user_files_spec.rb +32 -0
- data/spec/lib/reveal-ck/config_spec.rb +39 -62
- data/spec/lib/reveal-ck/markdown/slide_markdown_spec.rb +2 -4
- data/spec/lib/reveal-ck/presentation_dsl_spec.rb +11 -2
- data/spec/lib/reveal-ck/presentation_spec.rb +10 -5
- data/spec/lib/reveal-ck/render/scope_spec.rb +40 -0
- data/spec/lib/reveal-ck/templates/processor_spec.rb +6 -2
- data/spec/lib/reveal-ck_spec.rb +11 -1
- data/templates/reveal.js/body.html.erb +13 -0
- data/templates/reveal.js/head.html.erb +30 -0
- data/templates/reveal.js/index.html.erb +10 -0
- data/templates/reveal.js/script.js.erb +23 -0
- metadata +161 -121
- data/lib/reveal-ck/builders/build_task.rb +0 -21
- data/lib/reveal-ck/builders/builder.rb +0 -27
- data/lib/reveal-ck/builders/packaged_slides.rb +0 -84
- data/lib/reveal-ck/changers.rb +0 -3
- data/lib/reveal-ck/changers/slicer.rb +0 -25
- data/lib/reveal-ck/changers/splicer.rb +0 -37
- data/lib/reveal-ck/changers/string_replacer.rb +0 -18
- data/lib/reveal-ck/templates/render_scope.rb +0 -14
- data/rakelib/cane.rake +0 -10
- data/spec/lib/reveal-ck/builders/builder_spec.rb +0 -39
- data/spec/lib/reveal-ck/builders/packaged_slides_spec.rb +0 -39
- data/spec/lib/reveal-ck/changers/slicer_spec.rb +0 -41
- data/spec/lib/reveal-ck/changers/splicer_spec.rb +0 -45
- data/spec/lib/reveal-ck/changers/string_replacer_spec.rb +0 -35
- data/spec/lib/reveal-ck/templates/render_scope_spec.rb +0 -24
checksums.yaml
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
metadata.gz: !binary |-
|
|
9
|
-
YWJmODY1YjNhNTZlZmNhMTZlMmY5YTA5M2JiMzFlZWE1ZGZlN2EyODMzZDU0
|
|
10
|
-
MDU3Y2NhNTBkYzk3NWJiNWFlZGZkNGQ5YTVlMTVkMjE3OTJmNzFlM2FlMmEw
|
|
11
|
-
NTE0ZjAwY2QzMjk4MDAyYzQ1N2U2MDZiYWY3NGI3ZTRmYWZkNWY=
|
|
12
|
-
data.tar.gz: !binary |-
|
|
13
|
-
YjYzMWU5MWE1NjU5ZDZiMjlkYzJiNTM5ODQ2MmQ4OTFiOWIyYWQ4MDA4NGE1
|
|
14
|
-
ZGM5YmQ5NDIxOTBiMjQ4NjFhOTk4MzJjNDRmZGVhMjFmZTYxMDM5YWFhZDM0
|
|
15
|
-
ZmNiYjVmMmZiZTk1NzkyNTk4MmU4MTY5NDRlM2I0ZjAzMDEwMTA=
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 1f86a3c2fb07f07cc93f5ba5e78d505f0f3a94cd
|
|
4
|
+
data.tar.gz: 5b9197c6a1fbd564ed20329357f879c60feeb246
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 3cf370cd8cd3bf83b78cbc4f878c096579d32dad04098cda3754e18da67d11202f97182c6a927262028f9a89b32b4d87258ed5ee9a42ce0c4f10120191963ade
|
|
7
|
+
data.tar.gz: b45e6ad9c6f594dc31905f3d314f48e469cdeb92e8e47589c0c8abe347ec50b6aa4e1105687f6dbee58bf5409b6084a45b7cced314c67dc489e443ba76db092a
|
data/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright (c) 2013 Jed Northridge, http://jednorthridge.com
|
|
1
|
+
Copyright (c) 2013-2014 Jed Northridge, http://jednorthridge.com
|
|
2
2
|
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
4
|
a copy of this software and associated documentation files (the
|
|
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
|
17
17
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
18
18
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
19
19
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
20
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
|
@@ -1,10 +1,35 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Make Slides with a Quickness
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
reveal-ck lets you author [reveal.js][reveal.js] presentations with
|
|
4
|
+
popular markup and templating languages.
|
|
4
5
|
|
|
5
|
-
You write in Haml
|
|
6
|
-
[looks like this][reveal.js].
|
|
6
|
+
You write in Markdown, Textile, Haml, Slim or Ruby itself.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## A Written Introduction
|
|
9
|
+
|
|
10
|
+
..is available at http://jedcn.github.io/reveal-ck.
|
|
11
|
+
|
|
12
|
+
## If you'd prefer short videos,
|
|
13
|
+
|
|
14
|
+
*An Introduction* (4 mins):
|
|
15
|
+
|
|
16
|
+
<a href='https://vimeo.com/jedcn/reveal-ck-introduction'>
|
|
17
|
+
<img alt="Video Thumbnail" width="306" height="178" src='https://raw2.github.com/jedcn/reveal-ck/gh-pages/images/reveal-ck-introduction-thumbnail.png' />
|
|
18
|
+
</a>
|
|
19
|
+
|
|
20
|
+
*Getting Started with Markdown* (6 mins):
|
|
21
|
+
|
|
22
|
+
<a href='https://vimeo.com/jedcn/reveal-ck-getting-started'>
|
|
23
|
+
<img alt="Video Thumbnail" width="306" height="178" src='https://raw2.github.com/jedcn/reveal-ck/gh-pages/images/reveal-ck-getting-started-thumbnail.png' />
|
|
24
|
+
</a>
|
|
25
|
+
|
|
26
|
+
*Stop! Haml Time!* (14 mins):
|
|
27
|
+
|
|
28
|
+
<a href='https://vimeo.com/jedcn/reveal-ck-stop-haml-time'>
|
|
29
|
+
<img alt="Video Thumbnail" width="306" height="178" src='https://raw2.github.com/jedcn/reveal-ck/gh-pages/images/reveal-ck-stop-haml-time-thumbnail.png' />
|
|
30
|
+
</a>
|
|
31
|
+
|
|
32
|
+
[![Build Status][travis]](https://travis-ci.org/jedcn/reveal-ck)
|
|
33
|
+
[![Code Climate][code-climate]](https://codeclimate.com/github/jedcn/reveal-ck)
|
|
9
34
|
|
|
10
35
|
[reveal.js]: http://lab.hakim.se/reveal-js
|
data/Rakefile
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
1
|
require 'rubygems'
|
|
3
2
|
|
|
4
3
|
require 'bundler'
|
|
@@ -8,10 +7,10 @@ begin
|
|
|
8
7
|
Bundler.setup(:default, :development)
|
|
9
8
|
rescue Bundler::BundlerError => e
|
|
10
9
|
$stderr.puts e.message
|
|
11
|
-
$stderr.puts
|
|
10
|
+
$stderr.puts 'Run `bundle install` to install missing gems'
|
|
12
11
|
exit e.status_code
|
|
13
12
|
end
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
task :
|
|
14
|
+
task default: :ci
|
|
15
|
+
|
|
16
|
+
task test: [:spec, :cucumber]
|
data/bin/reveal-ck
CHANGED
|
@@ -8,93 +8,77 @@ program_desc 'A reveal.js construction kit'
|
|
|
8
8
|
|
|
9
9
|
version RevealCK::VERSION
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
11
|
+
class RevealCKExecutable
|
|
12
|
+
desc 'Generate reveal.js slides'
|
|
13
|
+
command :generate do |c|
|
|
14
|
+
|
|
15
|
+
slide_files = FileList['slides.*']
|
|
16
|
+
default_file = slide_files.empty? ? nil : slide_files.first
|
|
17
|
+
|
|
18
|
+
c.desc 'The file containing your slide content'
|
|
19
|
+
c.flag [:f, :file], default_value: default_file
|
|
20
|
+
|
|
21
|
+
c.desc 'The directory to place your generated slides in'
|
|
22
|
+
c.flag [:d, :dir], default_value: 'slides'
|
|
23
|
+
|
|
24
|
+
c.action do |_, options, _|
|
|
25
|
+
slides_file = options[:file]
|
|
26
|
+
if slides_file.nil?
|
|
27
|
+
puts
|
|
28
|
+
puts 'Problem:'
|
|
29
|
+
puts
|
|
30
|
+
puts ' reveal-ck could not find a slides file, and it cannnot build'
|
|
31
|
+
puts ' your presentation without one.'
|
|
32
|
+
puts
|
|
33
|
+
puts ' It thinks anything that matches "slides.*" is a slides file.'
|
|
34
|
+
puts
|
|
35
|
+
puts ' Some examples are: slides.md, slides.html, slides.haml'
|
|
36
|
+
puts
|
|
37
|
+
msg = 'Create a file matching slides.* to proceed, such as slides.md.'
|
|
38
|
+
exit_now!(msg)
|
|
39
|
+
end
|
|
40
|
+
puts "Generating slides for '#{slides_file}'.."
|
|
41
|
+
builder_args = {
|
|
42
|
+
reveal_js_dir: RevealCK.path_to('reveal.js'),
|
|
43
|
+
reveal_ck_dir: Dir.pwd,
|
|
44
|
+
output_dir: options[:dir],
|
|
45
|
+
slides_file: options[:file]
|
|
46
|
+
}
|
|
47
|
+
slides_builder =
|
|
48
|
+
RevealCK::Builders::SlidesBuilder.new(builder_args)
|
|
49
|
+
slides_builder.prepare
|
|
50
|
+
slides_builder.build
|
|
51
|
+
end
|
|
45
52
|
end
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
desc 'Start webserver so slides are available via http'
|
|
49
|
-
command :serve, :server do |c|
|
|
50
|
-
|
|
51
|
-
c.desc 'The directory to serve up'
|
|
52
|
-
c.flag [:d, :dir], default_value: 'slides'
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
54
|
+
desc 'Start webserver so slides are available via http'
|
|
55
|
+
command :serve, :server do |c|
|
|
56
|
+
|
|
57
|
+
c.desc 'The directory to serve up'
|
|
58
|
+
c.flag [:d, :dir], default_value: 'slides'
|
|
59
|
+
|
|
60
|
+
c.desc 'The port to serve on'
|
|
61
|
+
c.flag [:p, :port], default_value: 10_000
|
|
62
|
+
|
|
63
|
+
c.action do |_, options, _|
|
|
64
|
+
dir = options[:dir]
|
|
65
|
+
port = options[:port]
|
|
66
|
+
|
|
67
|
+
require 'webrick'
|
|
68
|
+
server = WEBrick::HTTPServer.new Port: port, DocumentRoot: dir
|
|
69
|
+
trap('INT') { server.shutdown }
|
|
70
|
+
|
|
71
|
+
puts
|
|
72
|
+
puts
|
|
73
|
+
puts "\tServing up slide content in '#{dir}/'."
|
|
74
|
+
puts
|
|
75
|
+
puts "\tOpen your browser to 'http://localhost:#{port}'."
|
|
76
|
+
puts
|
|
77
|
+
puts "\tPress CTRL-C to stop serving slides."
|
|
78
|
+
puts
|
|
79
|
+
puts
|
|
80
|
+
server.start
|
|
81
|
+
end
|
|
75
82
|
end
|
|
76
|
-
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
pre do |global, command, options, args|
|
|
80
|
-
# Pre logic here
|
|
81
|
-
# Return true to proceed; false to abort and not call the
|
|
82
|
-
# chosen command
|
|
83
|
-
# Use skips_pre before a command to skip this block
|
|
84
|
-
# on that command only
|
|
85
|
-
true
|
|
83
|
+
exit run(ARGV)
|
|
86
84
|
end
|
|
87
|
-
|
|
88
|
-
post do |global, command, options, args|
|
|
89
|
-
# Post logic here
|
|
90
|
-
# Use skips_post before a command to skip this
|
|
91
|
-
# block on that command only
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
on_error do |exception|
|
|
95
|
-
# Error logic here
|
|
96
|
-
# return false to skip default error handling
|
|
97
|
-
true
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
exit run(ARGV)
|
data/features/support/env.rb
CHANGED
|
@@ -1,15 +1 @@
|
|
|
1
1
|
require 'aruba/cucumber'
|
|
2
|
-
|
|
3
|
-
ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
|
|
4
|
-
LIB_DIR = File.join(File.expand_path(File.dirname(__FILE__)),'..','..','lib')
|
|
5
|
-
|
|
6
|
-
Before do
|
|
7
|
-
# Using "announce" causes massive warnings on 1.9.2
|
|
8
|
-
@puts = true
|
|
9
|
-
@original_rubylib = ENV['RUBYLIB']
|
|
10
|
-
ENV['RUBYLIB'] = LIB_DIR + File::PATH_SEPARATOR + ENV['RUBYLIB'].to_s
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
After do
|
|
14
|
-
ENV['RUBYLIB'] = @original_rubylib
|
|
15
|
-
end
|
data/lib/reveal-ck.rb
CHANGED
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
require_relative 'reveal-ck/version'
|
|
2
2
|
require_relative 'reveal-ck/config'
|
|
3
|
+
require_relative 'reveal-ck/retrieve'
|
|
4
|
+
require_relative 'reveal-ck/render'
|
|
3
5
|
require_relative 'reveal-ck/slide'
|
|
4
6
|
require_relative 'reveal-ck/presentation'
|
|
5
7
|
require_relative 'reveal-ck/presentation_dsl'
|
|
6
8
|
require_relative 'reveal-ck/templates'
|
|
7
|
-
require_relative 'reveal-ck/changers'
|
|
8
9
|
require_relative 'reveal-ck/builders'
|
|
9
10
|
require_relative 'reveal-ck/markdown'
|
|
10
11
|
require_relative 'reveal-ck/tilt/config'
|
|
11
12
|
|
|
12
|
-
# RevealCK::
|
|
13
|
-
#
|
|
13
|
+
# RevealCK::path_to provides the path where files within the reveal-ck
|
|
14
|
+
# gem are located on your system.
|
|
14
15
|
module RevealCK
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
def self.path_to(*args)
|
|
17
|
+
lib = File.dirname(__FILE__)
|
|
18
|
+
gem_root = File.join(lib, '..')
|
|
19
|
+
location = File.expand_path(gem_root)
|
|
20
|
+
File.join(location, *args)
|
|
21
|
+
end
|
|
18
22
|
end
|
|
19
23
|
|
|
20
24
|
# RevealCK::REVEALJS_FILES is a list of files that compromise
|
|
21
25
|
# reveal.js bundled into this gem.
|
|
22
26
|
module RevealCK
|
|
23
|
-
revealjs =
|
|
24
|
-
REVEALJS_FILES = Dir.glob
|
|
27
|
+
revealjs = path_to('reveal.js')
|
|
28
|
+
REVEALJS_FILES = Dir.glob("#{revealjs}/**/*")
|
|
25
29
|
end
|
data/lib/reveal-ck/builders.rb
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
require_relative 'builders/
|
|
2
|
-
require_relative 'builders/
|
|
1
|
+
require_relative 'builders/rake_aware'
|
|
2
|
+
require_relative 'builders/creation_task'
|
|
3
|
+
require_relative 'builders/copy_files_task'
|
|
4
|
+
require_relative 'builders/slides_builder'
|
|
5
|
+
require_relative 'builders/reveal_js_files'
|
|
6
|
+
require_relative 'builders/create_slides_html'
|
|
7
|
+
require_relative 'builders/create_index_html'
|
|
8
|
+
require_relative 'builders/user_files'
|
|
3
9
|
require_relative 'builders/index_html'
|
|
4
|
-
require_relative 'builders/packaged_slides'
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module RevealCK
|
|
2
|
+
module Builders
|
|
3
|
+
# Copy a listing of files from one location to another
|
|
4
|
+
class CopyFilesTask < CreationTask
|
|
5
|
+
attr_reader :file_listing, :output_dir
|
|
6
|
+
|
|
7
|
+
def initialize(args)
|
|
8
|
+
@file_listing = retrieve(:file_listing, args)
|
|
9
|
+
@output_dir = retrieve(:output_dir, args)
|
|
10
|
+
super
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def setup
|
|
14
|
+
file_listing.files.each do |file|
|
|
15
|
+
analyze_file(file) unless File.directory?(file)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def analyze_file(file)
|
|
20
|
+
dest = file.pathmap("%{^#{file_listing.dir}/,#{output_dir}/}p")
|
|
21
|
+
copy_file(file, dest)
|
|
22
|
+
dest_dir = dest.pathmap('%d')
|
|
23
|
+
create_directory(dest_dir)
|
|
24
|
+
things_to_create.add(dest_dir)
|
|
25
|
+
things_to_create.add(dest)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
require 'rake'
|
|
2
|
+
|
|
3
|
+
module RevealCK
|
|
4
|
+
module Builders
|
|
5
|
+
# Given a slides.html, a Rake application, a template for building
|
|
6
|
+
# out a reveal.js index.html, and a place where the resulting
|
|
7
|
+
# index.html file should end up, this class knows how to work with
|
|
8
|
+
# Rake and create the index.html.
|
|
9
|
+
class CreateIndexHtml < CreationTask
|
|
10
|
+
attr_reader :slides_html, :index_html, :output_dir, :config
|
|
11
|
+
|
|
12
|
+
def initialize(args)
|
|
13
|
+
@slides_html = retrieve(:slides_html, args)
|
|
14
|
+
@index_html = retrieve(:index_html, args)
|
|
15
|
+
@output_dir = retrieve(:output_dir, args)
|
|
16
|
+
@config = retrieve(:config, args)
|
|
17
|
+
super
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def setup
|
|
21
|
+
index_html_file = "#{output_dir}/index.html"
|
|
22
|
+
task(index_html_file => slides_html) do
|
|
23
|
+
content = IndexHtml.new(slides_html: slides_html,
|
|
24
|
+
index_file: index_html,
|
|
25
|
+
config: config).render
|
|
26
|
+
File.open(index_html_file, 'w') do |index_html|
|
|
27
|
+
index_html.puts(content)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
things_to_create.add(index_html_file)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module RevealCK
|
|
2
|
+
module Builders
|
|
3
|
+
# Given a slides_file, a Rake application, and a place where the
|
|
4
|
+
# transformed slides file should end up, this class knows how to
|
|
5
|
+
# work with Rake and create the slides.html.
|
|
6
|
+
class CreateSlidesHtml < CreationTask
|
|
7
|
+
attr_reader :slides_file, :output_dir, :config
|
|
8
|
+
|
|
9
|
+
def initialize(args)
|
|
10
|
+
@slides_file = retrieve(:slides_file, args)
|
|
11
|
+
@output_dir = retrieve(:output_dir, args)
|
|
12
|
+
@config = retrieve(:config, args)
|
|
13
|
+
super
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def setup
|
|
17
|
+
slides_html_file = "#{output_dir}/slides.html"
|
|
18
|
+
task(slides_html_file) do
|
|
19
|
+
presentation = RevealCK::Presentation.load(file: slides_file,
|
|
20
|
+
config: config)
|
|
21
|
+
File.open(slides_html_file, 'w') do |slides_html|
|
|
22
|
+
slides_html.puts(presentation.html)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
things_to_create.add(slides_html_file)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
module RevealCK
|
|
2
|
+
module Builders
|
|
3
|
+
# Works within the context of Rake to setup a task for a given
|
|
4
|
+
# name
|
|
5
|
+
class CreationTask
|
|
6
|
+
include Retrieve
|
|
7
|
+
include RakeAware
|
|
8
|
+
attr_reader :application, :things_to_create
|
|
9
|
+
|
|
10
|
+
def initialize(args)
|
|
11
|
+
@application = retrieve(:application, args)
|
|
12
|
+
@things_to_create = Set.new
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def setup
|
|
16
|
+
fail('setup must be implemented by subclasses')
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def name
|
|
20
|
+
full_class_name = self.class.to_s
|
|
21
|
+
class_name = full_class_name.gsub(/.*::/, '')
|
|
22
|
+
add_underscores = class_name.gsub(/([A-Z])/, '_\1')
|
|
23
|
+
trim_first_underscore = add_underscores[1..add_underscores.size]
|
|
24
|
+
trim_first_underscore.downcase
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def prepare
|
|
28
|
+
setup
|
|
29
|
+
task(name => things_to_create.to_a)
|
|
30
|
+
name
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|