reveal-ck 0.6.0 → 0.6.1
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 +4 -4
- data/README.md +6 -1
- data/bin/reveal-ck +0 -2
- data/lib/reveal-ck/markdown.rb +4 -3
- data/lib/reveal-ck/markdown/post_processor.rb +15 -0
- data/lib/reveal-ck/markdown/pre_processor.rb +15 -0
- data/lib/reveal-ck/version.rb +1 -1
- data/rakelib/relish.rake +0 -1
- data/spec/data/presentation_dsl/dsl.rb +0 -2
- data/spec/examples/programmatic_slides_spec.rb +0 -2
- data/spec/examples/slide_output_spec.rb +0 -2
- data/spec/lib/reveal-ck/builders/copy_files_task_spec.rb +0 -1
- data/spec/lib/reveal-ck/builders/create_index_html_spec.rb +0 -1
- data/spec/lib/reveal-ck/builders/create_slides_html_spec.rb +0 -2
- data/spec/lib/reveal-ck/builders/creation_task_spec.rb +0 -3
- data/spec/lib/reveal-ck/builders/rake_aware_spec.rb +0 -2
- data/spec/lib/reveal-ck/builders/slides_builder_spec.rb +0 -1
- data/spec/lib/reveal-ck/commands/listen_to_rebuild_slides_spec.rb +0 -1
- data/spec/lib/reveal-ck/commands/listen_to_reload_browser_spec.rb +0 -1
- data/spec/lib/reveal-ck/commands/print_banner_spec.rb +0 -1
- data/spec/lib/reveal-ck/commands/serve_spec.rb +1 -1
- data/spec/lib/reveal-ck/commands/serve_ui_spec.rb +0 -1
- data/spec/lib/reveal-ck/config_spec.rb +0 -2
- data/spec/lib/reveal-ck/markdown/post_processor_spec.rb +14 -5
- data/spec/lib/reveal-ck/markdown/pre_processor_spec.rb +13 -1
- data/spec/lib/reveal-ck/markdown/slide_markdown_spec.rb +0 -1
- data/spec/lib/reveal-ck/markdown/slide_markdown_template_spec.rb +14 -1
- data/spec/lib/reveal-ck/presentation_dsl_spec.rb +0 -2
- data/spec/lib/reveal-ck/presentation_spec.rb +0 -2
- data/spec/lib/reveal-ck/render/scope_spec.rb +0 -1
- data/spec/lib/reveal-ck/slide_spec.rb +0 -2
- data/spec/lib/reveal-ck/templates/finder_spec.rb +0 -4
- data/spec/lib/reveal-ck/templates/processor_spec.rb +0 -2
- data/spec/lib/reveal-ck/tilt/config_spec.rb +0 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7827ff95cbcd95ab71edcb05af538b444034ce57
|
4
|
+
data.tar.gz: 5e4bbe103ed9e3df46ac980ab2c034ccf881a9d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13546e79c4ceca5245cae207289759924f1ac11e37977764a93317364a73cafbd160e190a0f46ace2d4629d0077d49a88151f261e3728539062b7b698f0bc06e
|
7
|
+
data.tar.gz: 0476d2073d10a09620f74a34a70e31895b06066e64625577dca91475e0ea2bc6ca3f23048f28bb8ba78e457287533ed8ee06855627b72de1cc7284d14f940579
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# Create Slides with Markdown
|
2
2
|
|
3
3
|
[](http://badge.fury.io/rb/reveal-ck)
|
4
4
|
|
@@ -112,6 +112,11 @@ Here's a quick example of what it's like to work with reveal-ck:
|
|
112
112
|
If find these ideas intriguing, you can learn more at
|
113
113
|
http://jedcn.github.io/reveal-ck/.
|
114
114
|
|
115
|
+
## Contributing
|
116
|
+
|
117
|
+
If you'd like to log a bug, propose an issue, or get going with local
|
118
|
+
development, please see [doc/CONTRIBUTING.md](doc/CONTRIBUTING.md).
|
119
|
+
|
115
120
|
## Questions?
|
116
121
|
|
117
122
|
If you have questions, find me on github ([@jedcn][github-jedcn]) or
|
data/bin/reveal-ck
CHANGED
@@ -11,7 +11,6 @@ class RevealCKExecutable
|
|
11
11
|
|
12
12
|
desc 'Generate reveal.js slides'
|
13
13
|
command :generate do |c|
|
14
|
-
|
15
14
|
slide_files = FileList['slides.*']
|
16
15
|
default_file = slide_files.empty? ? nil : slide_files.first
|
17
16
|
|
@@ -49,7 +48,6 @@ class RevealCKExecutable
|
|
49
48
|
|
50
49
|
desc 'Start webserver so slides are available via http'
|
51
50
|
command :serve, :server do |c|
|
52
|
-
|
53
51
|
slide_files = FileList['slides.*']
|
54
52
|
default_file = slide_files.empty? ? nil : slide_files.first
|
55
53
|
|
data/lib/reveal-ck/markdown.rb
CHANGED
@@ -2,9 +2,10 @@ module RevealCK
|
|
2
2
|
# This module defines how reveal-ck works with redcarpet to produce
|
3
3
|
# slides from markdown.
|
4
4
|
module Markdown
|
5
|
-
REVEALCK_SYMBOL_FOR_DIVIDER
|
6
|
-
REVEALCK_SYMBOL_FOR_VERTICAL_START
|
7
|
-
REVEALCK_SYMBOL_FOR_VERTICAL_END
|
5
|
+
REVEALCK_SYMBOL_FOR_DIVIDER = '<div>DIVIDER</div>'
|
6
|
+
REVEALCK_SYMBOL_FOR_VERTICAL_START = '<div>VERTICAL_START</div>'
|
7
|
+
REVEALCK_SYMBOL_FOR_VERTICAL_END = '<div>VERTICAL_END</div>'
|
8
|
+
REVEALCK_SYMBOL_FOR_EMOJI_UNDERSCORE = 'EU'
|
8
9
|
end
|
9
10
|
end
|
10
11
|
|
@@ -11,6 +11,7 @@ module RevealCK
|
|
11
11
|
|
12
12
|
def process
|
13
13
|
strip_whitespace
|
14
|
+
unprotect_emojis
|
14
15
|
handle_start
|
15
16
|
handle_end
|
16
17
|
transform_symbols_to_sections
|
@@ -22,6 +23,12 @@ module RevealCK
|
|
22
23
|
@doc = doc.strip
|
23
24
|
end
|
24
25
|
|
26
|
+
def unprotect_emojis
|
27
|
+
@doc = doc.gsub(protected_emoji_regex) do |protected_emoji|
|
28
|
+
protected_emoji.gsub(emoji_underscore_symbol, '_')
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
25
32
|
def handle_start
|
26
33
|
replace_if_start_with(vertical_start_symbol, vertical_start_doc)
|
27
34
|
replace_if_start_with(divider_symbol, divider_start)
|
@@ -84,6 +91,10 @@ module RevealCK
|
|
84
91
|
"#{divider_end}\n#{divider_start}"
|
85
92
|
end
|
86
93
|
|
94
|
+
def emoji_underscore_symbol
|
95
|
+
RevealCK::Markdown::REVEALCK_SYMBOL_FOR_EMOJI_UNDERSCORE
|
96
|
+
end
|
97
|
+
|
87
98
|
def divider_symbol
|
88
99
|
RevealCK::Markdown::REVEALCK_SYMBOL_FOR_DIVIDER
|
89
100
|
end
|
@@ -96,6 +107,10 @@ module RevealCK
|
|
96
107
|
RevealCK::Markdown::REVEALCK_SYMBOL_FOR_VERTICAL_END
|
97
108
|
end
|
98
109
|
|
110
|
+
def protected_emoji_regex
|
111
|
+
/:[a-z\d_\-\+EU]*:/
|
112
|
+
end
|
113
|
+
|
99
114
|
def back_to_back_vertical_symbols_regex
|
100
115
|
vertical_end = Regexp.escape(vertical_end_symbol)
|
101
116
|
vertical_start = Regexp.escape(vertical_start_symbol)
|
@@ -11,6 +11,7 @@ module RevealCK
|
|
11
11
|
|
12
12
|
def process
|
13
13
|
strip_whitespace
|
14
|
+
protect_emojis
|
14
15
|
add_first_slide_divider_if_needed
|
15
16
|
add_last_slide_vertical_if_needed
|
16
17
|
add_last_slide_divider_if_needed
|
@@ -25,6 +26,12 @@ module RevealCK
|
|
25
26
|
@doc = doc.strip
|
26
27
|
end
|
27
28
|
|
29
|
+
def protect_emojis
|
30
|
+
@doc = doc.gsub(emoji_regex) do |emoji|
|
31
|
+
emoji.gsub(/_/, emoji_underscore_symbol)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
28
35
|
def add_first_slide_divider_if_needed
|
29
36
|
return if doc.start_with?(slide_divider)
|
30
37
|
return if doc.start_with?(slide_vertical)
|
@@ -60,6 +67,10 @@ module RevealCK
|
|
60
67
|
append(slide_vertical)
|
61
68
|
end
|
62
69
|
|
70
|
+
def emoji_regex
|
71
|
+
/:[a-z\d_\-\+]*:/
|
72
|
+
end
|
73
|
+
|
63
74
|
def slide_divider
|
64
75
|
'---'
|
65
76
|
end
|
@@ -88,6 +99,10 @@ module RevealCK
|
|
88
99
|
"\n#{s}\n"
|
89
100
|
end
|
90
101
|
|
102
|
+
def emoji_underscore_symbol
|
103
|
+
RevealCK::Markdown::REVEALCK_SYMBOL_FOR_EMOJI_UNDERSCORE
|
104
|
+
end
|
105
|
+
|
91
106
|
def divider_symbol
|
92
107
|
RevealCK::Markdown::REVEALCK_SYMBOL_FOR_DIVIDER
|
93
108
|
end
|
data/lib/reveal-ck/version.rb
CHANGED
data/rakelib/relish.rake
CHANGED
@@ -1,12 +1,10 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe 'examples/programmatic_slides.rb' do
|
4
|
-
|
5
4
|
it 'prints output from a presentation with several slides' do
|
6
5
|
expect($stdout).to receive :puts
|
7
6
|
expect do
|
8
7
|
load 'examples/programmatic_slides.rb'
|
9
8
|
end.to_not raise_error
|
10
9
|
end
|
11
|
-
|
12
10
|
end
|
@@ -8,7 +8,6 @@ module RevealCK
|
|
8
8
|
it 'creates a transformed slides file' do
|
9
9
|
Dir.mktmpdir do |dir|
|
10
10
|
Dir.chdir(dir) do
|
11
|
-
|
12
11
|
slides_file_initial = 'slides-initial.md'
|
13
12
|
File.open(slides_file_initial, 'w') do |file|
|
14
13
|
file.puts('# Slides')
|
@@ -34,7 +33,6 @@ module RevealCK
|
|
34
33
|
it 'can transform emoji' do
|
35
34
|
Dir.mktmpdir do |dir|
|
36
35
|
Dir.chdir(dir) do
|
37
|
-
|
38
36
|
slides_file_initial = 'slides-initial.md'
|
39
37
|
File.open(slides_file_initial, 'w') do |file|
|
40
38
|
file.puts('# I :heart: Slides')
|
@@ -17,7 +17,6 @@ module RevealCK
|
|
17
17
|
end
|
18
18
|
|
19
19
|
describe CreationTask do
|
20
|
-
|
21
20
|
describe '#name' do
|
22
21
|
it 'underscores the name of the Class' do
|
23
22
|
application = double
|
@@ -37,9 +36,7 @@ module RevealCK
|
|
37
36
|
end
|
38
37
|
|
39
38
|
describe 'a subclass with a complete implementation' do
|
40
|
-
|
41
39
|
describe '#prepare' do
|
42
|
-
|
43
40
|
it 'invokes setup' do
|
44
41
|
application = double
|
45
42
|
expect(application).to receive(:define_task)
|
@@ -3,8 +3,21 @@ require 'spec_helper'
|
|
3
3
|
module RevealCK
|
4
4
|
module Markdown
|
5
5
|
describe PostProcessor do
|
6
|
-
|
6
|
+
it 'unprotects emojis' do
|
7
|
+
input = ':moneyEUwithEUwings:'
|
8
|
+
output = PostProcessor.new(input).process
|
9
|
+
expect(output).to include ':money_with_wings:'
|
10
|
+
|
11
|
+
input = ':blueEUheart:'
|
12
|
+
output = PostProcessor.new(input).process
|
13
|
+
expect(output).to include ':blue_heart:'
|
14
|
+
|
15
|
+
input = ':non-potableEUwater:'
|
16
|
+
output = PostProcessor.new(input).process
|
17
|
+
expect(output).to include ':non-potable_water:'
|
18
|
+
end
|
7
19
|
|
20
|
+
context 'without vertical slides' do
|
8
21
|
let :three_slide_input do
|
9
22
|
<<-eos
|
10
23
|
<div>DIVIDER</div>
|
@@ -60,9 +73,7 @@ eos
|
|
60
73
|
end
|
61
74
|
|
62
75
|
context 'with vertical slides' do
|
63
|
-
|
64
76
|
context 'single vertical slide' do
|
65
|
-
|
66
77
|
let :single_vertical_input do
|
67
78
|
<<-eos
|
68
79
|
<div>VERTICAL_START</div>
|
@@ -120,7 +131,6 @@ eos
|
|
120
131
|
end
|
121
132
|
|
122
133
|
context 'back-to-back vertical slides' do
|
123
|
-
|
124
134
|
let :double_vertical_input do
|
125
135
|
<<-eos
|
126
136
|
<div>VERTICAL_START</div>
|
@@ -201,7 +211,6 @@ eos
|
|
201
211
|
end
|
202
212
|
|
203
213
|
context 'horizontal and vertical combinations' do
|
204
|
-
|
205
214
|
let :verticals_surrounded_by_horizontals_input do
|
206
215
|
<<-eos
|
207
216
|
<div>DIVIDER</div>
|
@@ -3,6 +3,19 @@ require 'spec_helper'
|
|
3
3
|
module RevealCK
|
4
4
|
module Markdown
|
5
5
|
describe PreProcessor do
|
6
|
+
it 'protects _s within emoji by turning them into a temporary token' do
|
7
|
+
input = ':money_with_wings:'
|
8
|
+
output = PreProcessor.new(input).process
|
9
|
+
expect(output).to include ':moneyEUwithEUwings:'
|
10
|
+
|
11
|
+
input = ':blue_heart:'
|
12
|
+
output = PreProcessor.new(input).process
|
13
|
+
expect(output).to include ':blueEUheart:'
|
14
|
+
|
15
|
+
input = ':non-potable_water:'
|
16
|
+
output = PreProcessor.new(input).process
|
17
|
+
expect(output).to include ':non-potableEUwater:'
|
18
|
+
end
|
6
19
|
|
7
20
|
let :standard_result do
|
8
21
|
<<-eos
|
@@ -85,7 +98,6 @@ eos
|
|
85
98
|
end
|
86
99
|
|
87
100
|
context 'with vertical slides' do
|
88
|
-
|
89
101
|
let :single_vertical_output do
|
90
102
|
<<-eos
|
91
103
|
<div>VERTICAL_START</div>
|
@@ -4,7 +4,6 @@ require 'tempfile'
|
|
4
4
|
module RevealCK
|
5
5
|
module Markdown
|
6
6
|
describe SlideMarkdownTemplate do
|
7
|
-
|
8
7
|
def render_markdown(markdown)
|
9
8
|
tmp_file = Tempfile.new(['test', '.md'])
|
10
9
|
File.open(tmp_file, 'w') do |test_md|
|
@@ -14,6 +13,20 @@ module RevealCK
|
|
14
13
|
template.render
|
15
14
|
end
|
16
15
|
|
16
|
+
it 'does not turn _s within a single emoji into <em>s' do
|
17
|
+
output = render_markdown <<-eos
|
18
|
+
:money_with_wings:
|
19
|
+
eos
|
20
|
+
expect(output).to include ':money_with_wings:'
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'does not turn _s between two emojis into <em>s' do
|
24
|
+
output = render_markdown <<-eos
|
25
|
+
:blue_heart: :blue_heart:
|
26
|
+
eos
|
27
|
+
expect(output).to include ':blue_heart: :blue_heart:'
|
28
|
+
end
|
29
|
+
|
17
30
|
it 'uses "---" to create "<section>"s' do
|
18
31
|
output = render_markdown <<-eos
|
19
32
|
# h1 Slide
|
@@ -2,7 +2,6 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
module RevealCK
|
4
4
|
describe PresentationDSL do
|
5
|
-
|
6
5
|
let :config do
|
7
6
|
Config.new
|
8
7
|
end
|
@@ -23,7 +22,6 @@ module RevealCK
|
|
23
22
|
end
|
24
23
|
|
25
24
|
describe 'A Presentation loaded from a dsl' do
|
26
|
-
|
27
25
|
let :html do
|
28
26
|
presentation.html
|
29
27
|
end
|
@@ -5,13 +5,11 @@ require 'fileutils'
|
|
5
5
|
module RevealCK
|
6
6
|
module Templates
|
7
7
|
describe Finder do
|
8
|
-
|
9
8
|
let :reveal_ck_dir do
|
10
9
|
Dir.pwd
|
11
10
|
end
|
12
11
|
|
13
12
|
describe '#paths' do
|
14
|
-
|
15
13
|
it 'defaults to Dir.pwd/templates and reveal-ck\'s slide templates' do
|
16
14
|
Dir.mktmpdir do |dir|
|
17
15
|
Dir.chdir(dir) do
|
@@ -33,11 +31,9 @@ module RevealCK
|
|
33
31
|
expect(finder.paths.size).to eq 2
|
34
32
|
end
|
35
33
|
end
|
36
|
-
|
37
34
|
end
|
38
35
|
|
39
36
|
describe '#find' do
|
40
|
-
|
41
37
|
let :project_templates do
|
42
38
|
spec_data 'templates', 'finder', 'templates'
|
43
39
|
end
|
@@ -3,7 +3,6 @@ require 'spec_helper'
|
|
3
3
|
module RevealCK
|
4
4
|
module Templates
|
5
5
|
describe Processor do
|
6
|
-
|
7
6
|
let :config do
|
8
7
|
Config.new
|
9
8
|
end
|
@@ -29,7 +28,6 @@ module RevealCK
|
|
29
28
|
processor = Processor.open file: haml_file, config: config
|
30
29
|
expect(processor.output).to match pretty_printed_basic
|
31
30
|
end
|
32
|
-
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reveal-ck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jed Northridge
|
@@ -560,7 +560,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
560
560
|
version: '0'
|
561
561
|
requirements: []
|
562
562
|
rubyforge_project:
|
563
|
-
rubygems_version: 2.2.
|
563
|
+
rubygems_version: 2.2.0
|
564
564
|
signing_key:
|
565
565
|
specification_version: 4
|
566
566
|
summary: A toolkit that takes a minimal description of slides and builds a reveal.js
|