reveal-ck 0.4.1 → 0.4.2
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/bin/reveal-ck +4 -4
- data/lib/reveal-ck.rb +5 -0
- data/lib/reveal-ck/config.rb +0 -1
- data/lib/reveal-ck/markdown/slide_markdown.rb +14 -5
- data/lib/reveal-ck/version.rb +1 -1
- data/spec/lib/reveal-ck/markdown/slide_markdown_template_spec.rb +11 -0
- 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: 6f1e06722b9bd3463bd12f98d3e2a6018318263e
|
4
|
+
data.tar.gz: 5c72f4aae233bbc7fabe1b7743e3a9f5649f55d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f3820c5a88605bb342220cd4acf4d9bea0f6034ff9d72b4f2ec624a0081e319dd83cf79753fc5105be3fdd311799e9ddce31e0cc8a3b53abf70b12790ee8216
|
7
|
+
data.tar.gz: a4ba292644a45d989db76a75631cb0fd7be287558ed879f9c6c007f1ba548719135d95d0ff3b8dcda941284f74d27bb7d9efca442c1b728556502894d5cebfc9
|
data/bin/reveal-ck
CHANGED
@@ -2,13 +2,13 @@
|
|
2
2
|
require 'gli'
|
3
3
|
require 'reveal-ck'
|
4
4
|
|
5
|
-
|
5
|
+
class RevealCKExecutable
|
6
|
+
extend GLI::App
|
6
7
|
|
7
|
-
program_desc 'A reveal.js construction kit'
|
8
|
+
program_desc 'A reveal.js construction kit'
|
8
9
|
|
9
|
-
version RevealCK::VERSION
|
10
|
+
version RevealCK::VERSION
|
10
11
|
|
11
|
-
class RevealCKExecutable
|
12
12
|
desc 'Generate reveal.js slides'
|
13
13
|
command :generate do |c|
|
14
14
|
|
data/lib/reveal-ck.rb
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
# The following require adds "#to_json" to Hash. This is needed in
|
2
|
+
# script.js.erb. We do it here to provide as much clarity as is
|
3
|
+
# possible.
|
4
|
+
require 'json'
|
5
|
+
|
1
6
|
require_relative 'reveal-ck/version'
|
2
7
|
require_relative 'reveal-ck/config'
|
3
8
|
require_relative 'reveal-ck/retrieve'
|
data/lib/reveal-ck/config.rb
CHANGED
@@ -7,9 +7,18 @@ module RevealCK
|
|
7
7
|
HR = '<hr>'
|
8
8
|
HR_NEWLINE = "<hr>\n"
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
HTML_SLIDE_START = '<section>'
|
11
|
+
HTML_SLIDE_END = '</section>'
|
12
|
+
HTML_SLIDE_DIVIDER = "#{HTML_SLIDE_END}\n#{HTML_SLIDE_START}"
|
13
|
+
|
14
|
+
MARKDOWN_SLIDE_DIVIDER = '---'
|
15
|
+
MARKDOWN_SLIDE_DIVIDER_REGEX = /^---$/
|
16
|
+
MARKDOWN_SLIDE_DIVIDER_WITH_NEWLINES = "\n---\n"
|
17
|
+
|
18
|
+
def preprocess(doc)
|
19
|
+
doc.gsub(MARKDOWN_SLIDE_DIVIDER_REGEX,
|
20
|
+
MARKDOWN_SLIDE_DIVIDER_WITH_NEWLINES)
|
21
|
+
end
|
13
22
|
|
14
23
|
def postprocess(doc)
|
15
24
|
doc = doc[HR.size, doc.size - 1] if doc.start_with?(HR)
|
@@ -17,8 +26,8 @@ module RevealCK
|
|
17
26
|
if doc.end_with?(HR_NEWLINE)
|
18
27
|
doc = doc[0, doc.size - 1 - HR_NEWLINE.size]
|
19
28
|
end
|
20
|
-
doc = doc.gsub(HR,
|
21
|
-
"#{
|
29
|
+
doc = doc.gsub(HR, HTML_SLIDE_DIVIDER)
|
30
|
+
"#{HTML_SLIDE_START}\n#{doc}\n#{HTML_SLIDE_END}"
|
22
31
|
end
|
23
32
|
|
24
33
|
def block_code(code, language)
|
data/lib/reveal-ck/version.rb
CHANGED
@@ -66,6 +66,17 @@ eos
|
|
66
66
|
expect(output).to include "<aside class='notes'"
|
67
67
|
expect(output).to include 'This is a note'
|
68
68
|
end
|
69
|
+
|
70
|
+
it 'works when there is no space surrounding the ---' do
|
71
|
+
output = render_markdown <<-eos
|
72
|
+
# Your headline
|
73
|
+
* Bullet 1
|
74
|
+
* Bullet 2
|
75
|
+
---
|
76
|
+
# Next Slide
|
77
|
+
eos
|
78
|
+
expect(output).to include "</section>\n<section>"
|
79
|
+
end
|
69
80
|
end
|
70
81
|
end
|
71
82
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reveal-ck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jed Northridge
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: RedCloth
|