reveal-ck 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 20df888fb9730d42a8b435a14262eb5f8cc0dde5
4
- data.tar.gz: 8365f52f718af3bcc11d3d1a81942a0b76d0c02d
3
+ metadata.gz: 6f1e06722b9bd3463bd12f98d3e2a6018318263e
4
+ data.tar.gz: 5c72f4aae233bbc7fabe1b7743e3a9f5649f55d2
5
5
  SHA512:
6
- metadata.gz: 0a98af3b6f6e73674c666609941caa3933e9cb573a883e9710abf86057d334c1a3d8da437248c7ad01d4300ec9267ae9083b62bb5802d955bd6ab99d064cd96c
7
- data.tar.gz: f73f05b2cec5b986447ec8cc6ae19b5d97d8c6bd0f275506c343bed3dd4dcba9a11f39038b6cc54215e5485682aaec98b2f131d54a97fe4304f66710b5dea8fa
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
- include GLI::App
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'
@@ -1,5 +1,4 @@
1
1
  require 'ostruct'
2
- require 'json'
3
2
 
4
3
  module RevealCK
5
4
  # A Config represents core configuration options within
@@ -7,9 +7,18 @@ module RevealCK
7
7
  HR = '<hr>'
8
8
  HR_NEWLINE = "<hr>\n"
9
9
 
10
- SLIDE_START = '<section>'
11
- SLIDE_END = '</section>'
12
- SLIDE_DIVIDER = "#{SLIDE_END}\n#{SLIDE_START}"
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, SLIDE_DIVIDER)
21
- "#{SLIDE_START}\n#{doc}\n#{SLIDE_END}"
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)
@@ -1,4 +1,4 @@
1
1
  # RevealCK::VERSION is the current version of reveal-ck
2
2
  module RevealCK
3
- VERSION = '0.4.1'
3
+ VERSION = '0.4.2'
4
4
  end
@@ -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.1
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-07-16 00:00:00.000000000 Z
11
+ date: 2014-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: RedCloth