reveal-ck 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -3
- data/bin/reveal-ck +2 -2
- data/features/step_definitions/html_match_steps.rb +27 -0
- data/files/reveal-ck/css/reveal-ck.css +6 -0
- data/{templates/reveal.js → files/reveal-ck/templates/index.html}/body.html.erb +0 -0
- data/{templates/reveal.js → files/reveal-ck/templates/index.html}/head.html.erb +2 -0
- data/{templates/reveal.js → files/reveal-ck/templates/index.html}/index.html.erb +0 -0
- data/{templates/reveal.js → files/reveal-ck/templates/index.html}/script.js.erb +0 -0
- data/{templates → files/reveal-ck/templates/slides}/code.slim +0 -0
- data/{templates → files/reveal-ck/templates/slides}/image.slim +0 -0
- data/{templates → files/reveal-ck/templates/slides}/intro.slim +0 -0
- data/{templates → files/reveal-ck/templates/slides}/quote.slim +0 -0
- data/{templates → files/reveal-ck/templates/slides}/text.slim +0 -0
- data/{reveal.js → files/reveal.js}/Gruntfile.js +0 -0
- data/{reveal.js → files/reveal.js}/LICENSE +0 -0
- data/{reveal.js → files/reveal.js}/README.md +0 -0
- data/{reveal.js → files/reveal.js}/css/print/paper.css +0 -0
- data/{reveal.js → files/reveal.js}/css/print/pdf.css +0 -0
- data/{reveal.js → files/reveal.js}/css/reveal.css +0 -0
- data/{reveal.js → files/reveal.js}/css/reveal.min.css +0 -0
- data/{reveal.js → files/reveal.js}/css/theme/README.md +0 -0
- data/{reveal.js → files/reveal.js}/css/theme/beige.css +0 -0
- data/{reveal.js → files/reveal.js}/css/theme/blood.css +0 -0
- data/{reveal.js → files/reveal.js}/css/theme/default.css +0 -0
- data/{reveal.js → files/reveal.js}/css/theme/moon.css +0 -0
- data/{reveal.js → files/reveal.js}/css/theme/night.css +0 -0
- data/{reveal.js → files/reveal.js}/css/theme/serif.css +0 -0
- data/{reveal.js → files/reveal.js}/css/theme/simple.css +0 -0
- data/{reveal.js → files/reveal.js}/css/theme/sky.css +0 -0
- data/{reveal.js → files/reveal.js}/css/theme/solarized.css +0 -0
- data/{reveal.js → files/reveal.js}/css/theme/source/beige.scss +0 -0
- data/{reveal.js → files/reveal.js}/css/theme/source/blood.scss +0 -0
- data/{reveal.js → files/reveal.js}/css/theme/source/default.scss +0 -0
- data/{reveal.js → files/reveal.js}/css/theme/source/moon.scss +0 -0
- data/{reveal.js → files/reveal.js}/css/theme/source/night.scss +0 -0
- data/{reveal.js → files/reveal.js}/css/theme/source/serif.scss +0 -0
- data/{reveal.js → files/reveal.js}/css/theme/source/simple.scss +0 -0
- data/{reveal.js → files/reveal.js}/css/theme/source/sky.scss +0 -0
- data/{reveal.js → files/reveal.js}/css/theme/source/solarized.scss +0 -0
- data/{reveal.js → files/reveal.js}/css/theme/template/mixins.scss +0 -0
- data/{reveal.js → files/reveal.js}/css/theme/template/settings.scss +0 -0
- data/{reveal.js → files/reveal.js}/css/theme/template/theme.scss +0 -0
- data/{reveal.js → files/reveal.js}/index.html +0 -0
- data/{reveal.js → files/reveal.js}/js/reveal.js +0 -0
- data/{reveal.js → files/reveal.js}/js/reveal.min.js +0 -0
- data/{reveal.js → files/reveal.js}/lib/css/zenburn.css +0 -0
- data/{reveal.js → files/reveal.js}/lib/font/league_gothic-webfont.eot +0 -0
- data/{reveal.js → files/reveal.js}/lib/font/league_gothic-webfont.svg +0 -0
- data/{reveal.js → files/reveal.js}/lib/font/league_gothic-webfont.ttf +0 -0
- data/{reveal.js → files/reveal.js}/lib/font/league_gothic-webfont.woff +0 -0
- data/{reveal.js → files/reveal.js}/lib/font/league_gothic_license +0 -0
- data/{reveal.js → files/reveal.js}/lib/js/classList.js +0 -0
- data/{reveal.js → files/reveal.js}/lib/js/head.min.js +0 -0
- data/{reveal.js → files/reveal.js}/lib/js/html5shiv.js +0 -0
- data/{reveal.js → files/reveal.js}/package.json +0 -0
- data/{reveal.js → files/reveal.js}/plugin/highlight/highlight.js +0 -0
- data/{reveal.js → files/reveal.js}/plugin/leap/leap.js +0 -0
- data/{reveal.js → files/reveal.js}/plugin/markdown/example.html +0 -0
- data/{reveal.js → files/reveal.js}/plugin/markdown/example.md +0 -0
- data/{reveal.js → files/reveal.js}/plugin/markdown/markdown.js +0 -0
- data/{reveal.js → files/reveal.js}/plugin/markdown/marked.js +0 -0
- data/{reveal.js → files/reveal.js}/plugin/math/math.js +0 -0
- data/{reveal.js → files/reveal.js}/plugin/multiplex/client.js +0 -0
- data/{reveal.js → files/reveal.js}/plugin/multiplex/index.js +0 -0
- data/{reveal.js → files/reveal.js}/plugin/multiplex/master.js +0 -0
- data/{reveal.js → files/reveal.js}/plugin/notes-server/client.js +0 -0
- data/{reveal.js → files/reveal.js}/plugin/notes-server/index.js +0 -0
- data/{reveal.js → files/reveal.js}/plugin/notes-server/notes.html +0 -0
- data/{reveal.js → files/reveal.js}/plugin/notes/notes.html +0 -0
- data/{reveal.js → files/reveal.js}/plugin/notes/notes.js +0 -0
- data/{reveal.js → files/reveal.js}/plugin/postmessage/example.html +0 -0
- data/{reveal.js → files/reveal.js}/plugin/postmessage/postmessage.js +0 -0
- data/{reveal.js → files/reveal.js}/plugin/print-pdf/print-pdf.js +0 -0
- data/{reveal.js → files/reveal.js}/plugin/remotes/remotes.js +0 -0
- data/{reveal.js → files/reveal.js}/plugin/search/search.js +0 -0
- data/{reveal.js → files/reveal.js}/plugin/zoom-js/zoom.js +0 -0
- data/{reveal.js → files/reveal.js}/test/examples/assets/image1.png +0 -0
- data/{reveal.js → files/reveal.js}/test/examples/assets/image2.png +0 -0
- data/{reveal.js → files/reveal.js}/test/examples/barebones.html +0 -0
- data/{reveal.js → files/reveal.js}/test/examples/embedded-media.html +0 -0
- data/{reveal.js → files/reveal.js}/test/examples/math.html +0 -0
- data/{reveal.js → files/reveal.js}/test/examples/slide-backgrounds.html +0 -0
- data/{reveal.js → files/reveal.js}/test/qunit-1.12.0.css +0 -0
- data/{reveal.js → files/reveal.js}/test/qunit-1.12.0.js +0 -0
- data/{reveal.js → files/reveal.js}/test/test-markdown-element-attributes.html +0 -0
- data/{reveal.js → files/reveal.js}/test/test-markdown-element-attributes.js +0 -0
- data/{reveal.js → files/reveal.js}/test/test-markdown-slide-attributes.html +0 -0
- data/{reveal.js → files/reveal.js}/test/test-markdown-slide-attributes.js +0 -0
- data/{reveal.js → files/reveal.js}/test/test-markdown.html +0 -0
- data/{reveal.js → files/reveal.js}/test/test-markdown.js +0 -0
- data/{reveal.js → files/reveal.js}/test/test.html +0 -0
- data/{reveal.js → files/reveal.js}/test/test.js +0 -0
- data/lib/reveal-ck.rb +9 -8
- data/lib/reveal-ck/builders.rb +1 -0
- data/lib/reveal-ck/builders/create_index_html.rb +3 -3
- data/lib/reveal-ck/builders/create_slides_html.rb +45 -3
- data/lib/reveal-ck/builders/index_html.rb +4 -4
- data/lib/reveal-ck/builders/reveal_ck_files.rb +21 -0
- data/lib/reveal-ck/builders/slides_builder.rb +26 -17
- data/lib/reveal-ck/config.rb +37 -14
- data/lib/reveal-ck/filtered_html_string.rb +24 -0
- data/lib/reveal-ck/markdown/slide_markdown.rb +11 -5
- data/lib/reveal-ck/render/index_html_maker.rb +9 -9
- data/lib/reveal-ck/templates/finder.rb +2 -1
- data/lib/reveal-ck/version.rb +1 -1
- data/spec/lib/reveal-ck/builders/copy_files_task_spec.rb +4 -4
- data/spec/lib/reveal-ck/builders/create_index_html_spec.rb +3 -2
- data/spec/lib/reveal-ck/builders/create_slides_html_spec.rb +26 -0
- data/spec/lib/reveal-ck/builders/index_html_spec.rb +4 -3
- data/spec/lib/reveal-ck/builders/slides_builder_spec.rb +2 -2
- data/spec/lib/reveal-ck/builders/user_files_spec.rb +1 -1
- data/spec/lib/reveal-ck/config_spec.rb +19 -1
- data/spec/lib/reveal-ck/markdown/slide_markdown_spec.rb +45 -42
- data/spec/lib/reveal-ck/markdown/slide_markdown_template_spec.rb +56 -14
- data/spec/lib/reveal-ck/templates/finder_spec.rb +5 -5
- data/spec/lib/reveal-ck/templates/processor_spec.rb +2 -2
- data/spec/lib/reveal-ck/tilt/config_spec.rb +1 -1
- data/spec/lib/reveal-ck_spec.rb +15 -14
- metadata +157 -110
- data/spec/data/changers/slicer/after_remove +0 -6
- data/spec/data/changers/slicer/before_remove +0 -10
- data/spec/data/changers/splicer/abcd +0 -4
- data/spec/data/changers/splicer/after_insert +0 -14
- data/spec/data/changers/splicer/before_insert +0 -10
- data/spec/data/changers/string_replacer/after_replace +0 -4
- data/spec/data/changers/string_replacer/before_replace +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a22fa9bd00a93a29d756242fa3fca039c7a51ded
|
4
|
+
data.tar.gz: 9957dab823be1182634d4660df24a6b206d48a19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f73aa08506b27f0d1e16e3e8b32e1fee62415d3a9cf8ae332a7e989ec7302dea53cb54ac940eb014ff7073cfa07d2ba299575f78e09b744ca8fa2a89a99b928
|
7
|
+
data.tar.gz: bfdee99b08af09ab27de8aae8e8dae9a17c48c681acf73581ea5ab199a5b8be96256696e768e5c32439d5af876c126a6f14a09a46bd04f362dbca9e1b55008ba
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Make Slides with a Quickness
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/reveal-ck.svg)](http://badge.fury.io/rb/reveal-ck)
|
4
|
+
|
3
5
|
reveal-ck lets you author [reveal.js][reveal.js] presentations with
|
4
6
|
popular markup and templating languages.
|
5
7
|
|
@@ -29,7 +31,8 @@ You write in Markdown, Textile, Haml, Slim or Ruby itself.
|
|
29
31
|
<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
32
|
</a>
|
31
33
|
|
32
|
-
[![Build Status][travis]](https://travis-ci.org/jedcn/reveal-ck)
|
33
|
-
[![Code Climate][code-climate]](https://codeclimate.com/github/jedcn/reveal-ck)
|
34
34
|
|
35
|
-
[reveal.
|
35
|
+
[![Build Status](https://travis-ci.org/jedcn/reveal-ck.svg)](https://travis-ci.org/jedcn/reveal-ck)
|
36
|
+
[![Code Climate](https://codeclimate.com/github/jedcn/reveal-ck.png)](https://codeclimate.com/github/jedcn/reveal-ck)
|
37
|
+
|
38
|
+
[reveal.js]: http://lab.hakim.se/reveal-js
|
data/bin/reveal-ck
CHANGED
@@ -39,8 +39,8 @@ class RevealCKExecutable
|
|
39
39
|
end
|
40
40
|
puts "Generating slides for '#{slides_file}'.."
|
41
41
|
builder_args = {
|
42
|
-
|
43
|
-
|
42
|
+
user_dir: Dir.pwd,
|
43
|
+
gem_dir: RevealCK.path,
|
44
44
|
output_dir: options[:dir],
|
45
45
|
slides_file: options[:file]
|
46
46
|
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
|
3
|
+
def check_html_matches(file, selector_list, selector_type)
|
4
|
+
prep_for_fs_check do
|
5
|
+
content = IO.read(file)
|
6
|
+
doc = Nokogiri::HTML(content)
|
7
|
+
selector_list.each do |selector, description|
|
8
|
+
check_doc_matches(doc, selector, description, selector_type)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def check_doc_matches(doc, selector, description, type)
|
14
|
+
search_result = doc.send(type, selector)
|
15
|
+
return unless search_result.empty?
|
16
|
+
message = "Could not find #{description}. "
|
17
|
+
message += "No match for #{type} '#{selector}'"
|
18
|
+
fail message
|
19
|
+
end
|
20
|
+
|
21
|
+
Then(/^the file "(.*?)" should have html matching the css:$/) do |file, table|
|
22
|
+
check_html_matches(file, table.raw, :css)
|
23
|
+
end
|
24
|
+
|
25
|
+
Then(/^the file "(.*?)" should have html matching the xpath:$/) do |file, table|
|
26
|
+
check_html_matches(file, table.raw, :xpath)
|
27
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/reveal-ck.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require_relative 'reveal-ck/version'
|
2
2
|
require_relative 'reveal-ck/config'
|
3
3
|
require_relative 'reveal-ck/retrieve'
|
4
|
+
require_relative 'reveal-ck/filtered_html_string'
|
4
5
|
require_relative 'reveal-ck/render'
|
5
6
|
require_relative 'reveal-ck/slide'
|
6
7
|
require_relative 'reveal-ck/presentation'
|
@@ -10,20 +11,20 @@ require_relative 'reveal-ck/builders'
|
|
10
11
|
require_relative 'reveal-ck/markdown'
|
11
12
|
require_relative 'reveal-ck/tilt/config'
|
12
13
|
|
13
|
-
# RevealCK::
|
14
|
+
# RevealCK::path provides the path where files within the reveal-ck
|
14
15
|
# gem are located on your system.
|
15
16
|
module RevealCK
|
16
|
-
def self.
|
17
|
+
def self.path(*args)
|
17
18
|
lib = File.dirname(__FILE__)
|
18
19
|
gem_root = File.join(lib, '..')
|
19
20
|
location = File.expand_path(gem_root)
|
20
21
|
File.join(location, *args)
|
21
22
|
end
|
22
|
-
end
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
24
|
+
def self.template_path(*args)
|
25
|
+
lib = File.dirname(__FILE__)
|
26
|
+
gem_root = File.join(lib, '..', 'files', 'reveal-ck', 'templates')
|
27
|
+
location = File.expand_path(gem_root)
|
28
|
+
File.join(location, *args)
|
29
|
+
end
|
29
30
|
end
|
data/lib/reveal-ck/builders.rb
CHANGED
@@ -3,6 +3,7 @@ require_relative 'builders/creation_task'
|
|
3
3
|
require_relative 'builders/copy_files_task'
|
4
4
|
require_relative 'builders/slides_builder'
|
5
5
|
require_relative 'builders/reveal_js_files'
|
6
|
+
require_relative 'builders/reveal_ck_files'
|
6
7
|
require_relative 'builders/create_slides_html'
|
7
8
|
require_relative 'builders/create_index_html'
|
8
9
|
require_relative 'builders/user_files'
|
@@ -7,11 +7,11 @@ module RevealCK
|
|
7
7
|
# index.html file should end up, this class knows how to work with
|
8
8
|
# Rake and create the index.html.
|
9
9
|
class CreateIndexHtml < CreationTask
|
10
|
-
attr_reader :slides_html, :
|
10
|
+
attr_reader :slides_html, :template, :output_dir, :config
|
11
11
|
|
12
12
|
def initialize(args)
|
13
13
|
@slides_html = retrieve(:slides_html, args)
|
14
|
-
@
|
14
|
+
@template = retrieve(:template, args)
|
15
15
|
@output_dir = retrieve(:output_dir, args)
|
16
16
|
@config = retrieve(:config, args)
|
17
17
|
super
|
@@ -21,7 +21,7 @@ module RevealCK
|
|
21
21
|
index_html_file = "#{output_dir}/index.html"
|
22
22
|
task(index_html_file => slides_html) do
|
23
23
|
content = IndexHtml.new(slides_html: slides_html,
|
24
|
-
|
24
|
+
template: template,
|
25
25
|
config: config).render
|
26
26
|
File.open(index_html_file, 'w') do |index_html|
|
27
27
|
index_html.puts(content)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'html/pipeline'
|
2
|
+
|
1
3
|
module RevealCK
|
2
4
|
module Builders
|
3
5
|
# Given a slides_file, a Rake application, and a place where the
|
@@ -16,14 +18,54 @@ module RevealCK
|
|
16
18
|
def setup
|
17
19
|
slides_html_file = "#{output_dir}/slides.html"
|
18
20
|
task(slides_html_file) do
|
19
|
-
presentation = RevealCK::Presentation.load(file: slides_file,
|
20
|
-
config: config)
|
21
21
|
File.open(slides_html_file, 'w') do |slides_html|
|
22
|
-
slides_html.puts(
|
22
|
+
slides_html.puts(presentation_html)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
things_to_create.add(slides_html_file)
|
26
26
|
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def presentation_html
|
31
|
+
presentation = RevealCK::Presentation.load(file: slides_file,
|
32
|
+
config: config)
|
33
|
+
initial_html = presentation.html
|
34
|
+
apply_filters_to(initial_html)
|
35
|
+
end
|
36
|
+
|
37
|
+
def apply_filters_to(html)
|
38
|
+
filters = get_classes_from_array(config.filters)
|
39
|
+
pipeline = HTML::Pipeline.new(filters)
|
40
|
+
filtered_html_string = FilteredHtmlString.new(html: html,
|
41
|
+
config: config.to_h,
|
42
|
+
pipeline: pipeline)
|
43
|
+
filtered_html_string.render
|
44
|
+
end
|
45
|
+
|
46
|
+
def get_classes_from_array(array_of_names)
|
47
|
+
array_of_names.map do |name|
|
48
|
+
name.split('::').reduce(Object) { |a, e| a.const_get(e) }
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
module HTML
|
56
|
+
class Pipeline
|
57
|
+
# This class is very similar EmojiFilter. It has been slightly
|
58
|
+
# tweaked to make emoji function better within reveal.js
|
59
|
+
class RevealCKEmojiFilter < EmojiFilter
|
60
|
+
def emoji_image_filter(text)
|
61
|
+
return text unless text.include?(':')
|
62
|
+
|
63
|
+
text.gsub EmojiPattern do
|
64
|
+
name = Regexp.last_match[1]
|
65
|
+
result = "<img class='emoji' title=':#{name}:' alt=':#{name}:'"
|
66
|
+
result + "src='#{emoji_url(name)}' align='absmiddle' />"
|
67
|
+
end
|
68
|
+
end
|
27
69
|
end
|
28
70
|
end
|
29
71
|
end
|
@@ -9,21 +9,21 @@ module RevealCK
|
|
9
9
|
class IndexHtml
|
10
10
|
include Retrieve
|
11
11
|
|
12
|
-
attr_reader :
|
12
|
+
attr_reader :template, :slides_html, :config
|
13
13
|
|
14
14
|
def initialize(args)
|
15
|
-
@
|
15
|
+
@template = retrieve(:template, args)
|
16
16
|
@slides_html = retrieve(:slides_html, args)
|
17
17
|
@config = retrieve(:config, args)
|
18
18
|
end
|
19
19
|
|
20
20
|
def render
|
21
21
|
scope = RevealCK::Render::Scope.new(dir: Dir.pwd, config: config)
|
22
|
-
|
22
|
+
tilt_template = Tilt.new(template)
|
23
23
|
locals = {
|
24
24
|
slides_html: slides_html
|
25
25
|
}
|
26
|
-
|
26
|
+
tilt_template.render(scope, locals)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'rake'
|
2
|
+
|
3
|
+
module RevealCK
|
4
|
+
module Builders
|
5
|
+
# This class knows which files from reveal-ck are vital to the
|
6
|
+
# presentation.
|
7
|
+
class RevealCkFiles
|
8
|
+
include Retrieve
|
9
|
+
|
10
|
+
attr_reader :dir
|
11
|
+
|
12
|
+
def initialize(args)
|
13
|
+
@dir = retrieve(:dir, args)
|
14
|
+
end
|
15
|
+
|
16
|
+
def files
|
17
|
+
FileList["#{dir}/css/reveal-ck.css"]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|