Skip to content

Commit 493f976

Browse files
committed
v0.6.0. See CHANGELOG.md for details.
Merge remote-tracking branch 'origin/upcoming' * origin/upcoming: CHANGELOG and version [vertical-markdown] Added additional feature coverage [vertical-markdown] Enhanced PostProcessor coverage [vertical-markdown] Supported back-to-back verticals [vertical-markdown] Created Vertical Start+End. [vertical-markdown] Broke Pre/Post process specs out into distinct files [vertical-markdown] Started supporting '***' for vertical slides. Incomplete. [vertical-markdown] Refactored pre/postprocess toward OO [vertical-markdown] Changed up pre/post process algorithm [support-tables] Enabled various Redcarpet functionality [support-tables] Wrote up feature based on GFM Help [support-tables] Upgraded redcarpet [update-reveal.js] Switched from "master" to "dev" branch of reveal.js
2 parents 19a72ce + 79a261a commit 493f976

21 files changed

+1569
-111
lines changed

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
### 0.6.0 / 2014-11-01
2+
3+
[full changelog](https://github.com/jedcn/reveal-ck/compare/v0.5.1...v0.6.0)
4+
5+
#### Feature: Support GFM Markdown for Tables
6+
7+
This is a fix for Issue #21.
8+
9+
In short, you can now write something like this:
10+
11+
```markdown
12+
Item | Value | Quantity
13+
------------- | ------------- | ---------
14+
Apples | $1 | 18
15+
Lemonade | $2 | 20
16+
Bread | $3.50 | 2
17+
```
18+
19+
And reveal-ck should turn it into a table and apply the latest
20+
reveal.js styling to it.
21+
22+
#### Feature: Provide Markdown notation for Vertical Slides
23+
24+
People have long asked for a notation within Markdown that supports
25+
vertical slides.
26+
27+
This is now possible, and an `***` gets things going.
28+
129
### 0.5.1 / 2014-11-01
230

331
[full changelog](https://github.com/jedcn/reveal-ck/compare/v0.5.0...v0.5.1)

features/generate-with-markdown.feature

Lines changed: 277 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,21 @@ Feature: Slides with markdown
1111
Further- you can also used the triple-fence block to quickly create
1212
speaker notes. See the example below.
1313

14+
If you like to put tables in your slides, you can use the tables
15+
from [Github Flavored Markdown][github-flavored-markdown].
16+
17+
Finally-- unlike many other slide frameworks, reveal.js supports
18+
vertical slides. You can start a series of vertical slides with
19+
`***`. If you want to stop "going vertical" you can use another
20+
`***`. Once you you realize that vertical is an option, you can
21+
choose to do columns back-to-back, columns separated by horizontal
22+
slides, etc. Check out several examples below.
23+
1424
If you'd like to see the intermediate file where your `slides.md` is
1525
transformed into `.html` you can visit `slides/slides.html`
1626

1727
[redcarpet]: https://github.com/vmg/redcarpet
28+
[github-flavored-markdown]: https://help.github.com/articles/github-flavored-markdown/
1829

1930
Scenario: Generating basic slides with slides.md
2031
Given a file named "slides.md" with:
@@ -64,10 +75,6 @@ Feature: Slides with markdown
6475
"""
6576
When I run `reveal-ck generate`
6677
Then the exit status should be 0
67-
And the file "slides/slides.html" should have html matching the xpath:
68-
| //section/aside[@class="notes"] | a speaker note |
69-
| //section/aside[contains(., "This will be a speaker note")] | the first note |
70-
| //section/aside[contains(., "Another note")] | the second note |
7178
And the file "slides/index.html" should have html matching the xpath:
7279
| //section/aside[@class="notes"] | a speaker note |
7380
| //section/aside[contains(., "This will be a speaker note")] | the first note |
@@ -86,11 +93,273 @@ Feature: Slides with markdown
8693
"""
8794
When I run `reveal-ck generate`
8895
Then the exit status should be 0
89-
And the file "slides/slides.html" should have html matching the xpath:
90-
| //section[1]/h1[text()="Your headline"] | the first slide's h1 |
91-
| //section[2]/h2[text()="Next Slide"] | the second slide's h2 |
92-
| //section[3]/h3[text()="Final Slide"] | the third slide's h3 |
9396
And the file "slides/index.html" should have html matching the xpath:
9497
| //section[1]/h1[text()="Your headline"] | the first slide's h1 |
9598
| //section[2]/h2[text()="Next Slide"] | the second slide's h2 |
9699
| //section[3]/h3[text()="Final Slide"] | the third slide's h3 |
100+
101+
Scenario: Using "Github Flavored Markdown" Tables
102+
Given a file named "slides.md" with:
103+
"""
104+
# Welcome
105+
---
106+
## Superb Tables
107+
Item | Value | Quantity
108+
------------- | ------------- | ---------
109+
Apples | $1 | 18
110+
Lemonade | $2 | 20
111+
Bread | $3.50 | 2
112+
---
113+
# Thank You
114+
"""
115+
When I run `reveal-ck generate`
116+
Then the exit status should be 0
117+
And the file "slides/index.html" should have html matching the xpath:
118+
| //section[1]/h1[text()="Welcome"] | the first slide's h1 |
119+
| //section[2]/table | the table exists |
120+
| //section[2]/table/thead/tr/th[1][text()="Item"] | Column 1 Header |
121+
| //section[2]/table/thead/tr/th[2][text()="Value"] | Column 2 Header |
122+
| //section[2]/table/thead/tr/th[3][text()="Quantity"] | Column 3 Header |
123+
| //section[2]/table/tbody/tr[1]/td[1][text()="Apples"] | Column 1, Row 1 |
124+
| //section[2]/table/tbody/tr[1]/td[2][text()="$1"] | Column 1, Row 2 |
125+
| //section[2]/table/tbody/tr[1]/td[3][text()="18"] | Column 1, Row 3 |
126+
| //section[2]/table/tbody/tr[3]/td[1][text()="Bread"] | Column 3, Row 1 |
127+
| //section[2]/table/tbody/tr[3]/td[2][text()="$3.50"] | Column 3, Row 2 |
128+
| //section[2]/table/tbody/tr[3]/td[3][text()="2"] | Column 3, Row 3 |
129+
| //section[3]/h1[text()="Thank You"] | the third slide's h1 |
130+
131+
Scenario: Using "Github Flavored Markdown" Tables with "Pipes"
132+
Given a file named "slides.md" with:
133+
"""
134+
# Welcome
135+
---
136+
## Superb Tables
137+
| Item | Value | Quantity |
138+
| ------------- | ------------- | --------- |
139+
| Apples | $1 | 18 |
140+
| Lemonade | $2 | 20 |
141+
| Bread | $3.50 | 2 |
142+
---
143+
# Thank You
144+
"""
145+
When I run `reveal-ck generate`
146+
Then the exit status should be 0
147+
And the file "slides/index.html" should have html matching the xpath:
148+
| //section[1]/h1[text()="Welcome"] | the first slide's h1 |
149+
| //section[2]/table | the table exists |
150+
| //section[2]/table/thead/tr/th[1][text()="Item"] | Column 1 Header |
151+
| //section[2]/table/thead/tr/th[2][text()="Value"] | Column 2 Header |
152+
| //section[2]/table/thead/tr/th[3][text()="Quantity"] | Column 3 Header |
153+
| //section[2]/table/tbody/tr[1]/td[1][text()="Apples"] | Column 1, Row 1 |
154+
| //section[2]/table/tbody/tr[1]/td[2][text()="$1"] | Column 1, Row 2 |
155+
| //section[2]/table/tbody/tr[1]/td[3][text()="18"] | Column 1, Row 3 |
156+
| //section[2]/table/tbody/tr[3]/td[1][text()="Bread"] | Column 3, Row 1 |
157+
| //section[2]/table/tbody/tr[3]/td[2][text()="$3.50"] | Column 3, Row 2 |
158+
| //section[2]/table/tbody/tr[3]/td[3][text()="2"] | Column 3, Row 3 |
159+
| //section[3]/h1[text()="Thank You"] | the third slide's h1 |
160+
161+
Scenario: Using "Github Flavored Markdown" Tables with "Unaligned Whitespace"
162+
Given a file named "slides.md" with:
163+
"""
164+
# Welcome
165+
---
166+
## Superb Tables
167+
| Item | Value | Quantity |
168+
| -------- | ------------- | --------- |
169+
| Apples | $1 | 18 |
170+
| Lemonade | $2 | 20 |
171+
| Bread | $3.50 | 2 |
172+
---
173+
# Thank You
174+
"""
175+
When I run `reveal-ck generate`
176+
Then the exit status should be 0
177+
And the file "slides/index.html" should have html matching the xpath:
178+
| //section[1]/h1[text()="Welcome"] | the first slide's h1 |
179+
| //section[2]/table | the table exists |
180+
| //section[2]/table/thead/tr/th[1][text()="Item"] | Column 1 Header |
181+
| //section[2]/table/thead/tr/th[2][text()="Value"] | Column 2 Header |
182+
| //section[2]/table/thead/tr/th[3][text()="Quantity"] | Column 3 Header |
183+
| //section[2]/table/tbody/tr[1]/td[1][text()="Apples"] | Column 1, Row 1 |
184+
| //section[2]/table/tbody/tr[1]/td[2][text()="$1"] | Column 1, Row 2 |
185+
| //section[2]/table/tbody/tr[1]/td[3][text()="18"] | Column 1, Row 3 |
186+
| //section[2]/table/tbody/tr[3]/td[1][text()="Bread"] | Column 3, Row 1 |
187+
| //section[2]/table/tbody/tr[3]/td[2][text()="$3.50"] | Column 3, Row 2 |
188+
| //section[2]/table/tbody/tr[3]/td[3][text()="2"] | Column 3, Row 3 |
189+
| //section[3]/h1[text()="Thank You"] | the third slide's h1 |
190+
191+
Scenario: Using "Github Flavored Markdown" Tables with "Embedded Markdown"
192+
Given a file named "slides.md" with:
193+
"""
194+
# Welcome
195+
---
196+
## Superb Tables
197+
Item | Value | Quantity
198+
------------- | ------------- | ---------
199+
~~Apples~~ | $1 | ==18==
200+
Lemonade | $2 | 20
201+
_Bread_ | **$3.50** | 2
202+
---
203+
# Thank You
204+
"""
205+
When I run `reveal-ck generate`
206+
Then the exit status should be 0
207+
And the file "slides/index.html" should have html matching the xpath:
208+
| //section[1]/h1[text()="Welcome"] | the first slide's h1 |
209+
| //section[2]/table | the table exists |
210+
| //section[2]/table/thead/tr/th[1][text()="Item"] | Column 1 Header |
211+
| //section[2]/table/thead/tr/th[2][text()="Value"] | Column 2 Header |
212+
| //section[2]/table/thead/tr/th[3][text()="Quantity"] | Column 3 Header |
213+
| //section[2]/table/tbody/tr[1]/td[1]/del[text()="Apples"] | Column 1, Row 1, Struckthrough |
214+
| //section[2]/table/tbody/tr[1]/td[2][text()="$1"] | Column 1, Row 2 |
215+
| //section[2]/table/tbody/tr[1]/td[3]/mark[text()="18"] | Column 1, Row 3, Marked |
216+
| //section[2]/table/tbody/tr[3]/td[1]/em[text()="Bread"] | Column 3, Row 1, Emphasized |
217+
| //section[2]/table/tbody/tr[3]/td[2]/strong[text()="$3.50"] | Column 3, Row 2, Strong |
218+
| //section[2]/table/tbody/tr[3]/td[3][text()="2"] | Column 3, Row 3 |
219+
220+
Scenario: Using "Github Flavored Markdown" Tables with "Aligned Columns"
221+
Given a file named "slides.md" with:
222+
"""
223+
# Welcome
224+
---
225+
## Superb Tables
226+
Item | Value | Quantity
227+
:------------- | :-------------: | ---------:
228+
Apples | $1 | 18
229+
Lemonade | $2 | 20
230+
Bread | $3.50 | 2
231+
---
232+
# Thank You
233+
"""
234+
When I run `reveal-ck generate`
235+
Then the exit status should be 0
236+
And the file "slides/index.html" should have html matching the xpath:
237+
| //section[2]/table/thead/tr/th[1][@style="text-align: left"] | Left Aligned Column 1 Header |
238+
| //section[2]/table/thead/tr/th[2][@style="text-align: center"] | Center Aligned Column 2 Header |
239+
| //section[2]/table/thead/tr/th[3][@style="text-align: right"] | Right Aligned Column 3 Header |
240+
| //section[2]/table/tbody/tr[1]/td[1][@style="text-align: left"] | Left Aligned Column 1, Row 1 |
241+
| //section[2]/table/tbody/tr[1]/td[2][@style="text-align: center"] | Center Aligned Column 1, Row 2 |
242+
| //section[2]/table/tbody/tr[1]/td[3][@style="text-align: right"] | Right Aligned Column 1, Row 3 |
243+
244+
Scenario: Creating a single column of vertical slides
245+
Given a file named "slides.md" with:
246+
"""
247+
***
248+
# Column 1, Slide 1
249+
---
250+
# Column 1, Slide 2
251+
---
252+
# Column 1, Slide 3
253+
"""
254+
When I run `reveal-ck generate`
255+
Then the exit status should be 0
256+
And the file "slides/index.html" should have html matching the xpath:
257+
| //section[1]/section[1]/h1[text()="Column 1, Slide 1"] | Column 1, Slide 1 |
258+
| //section[1]/section[2]/h1[text()="Column 1, Slide 2"] | Column 1, Slide 2 |
259+
| //section[1]/section[3]/h1[text()="Column 1, Slide 3"] | Column 1, Slide 3 |
260+
261+
Scenario: Creating a single column of vertical slides
262+
Given a file named "slides.md" with:
263+
"""
264+
***
265+
# Column 1, Slide 1
266+
---
267+
# Column 1, Slide 2
268+
---
269+
# Column 1, Slide 3
270+
***
271+
"""
272+
When I run `reveal-ck generate`
273+
Then the exit status should be 0
274+
And the file "slides/index.html" should have html matching the xpath:
275+
| //section[1]/section[1]/h1[text()="Column 1, Slide 1"] | Column 1, Slide 1 |
276+
| //section[1]/section[2]/h1[text()="Column 1, Slide 2"] | Column 1, Slide 2 |
277+
| //section[1]/section[3]/h1[text()="Column 1, Slide 3"] | Column 1, Slide 3 |
278+
279+
Scenario: Creating a slide, a single column of vertical slides, and final slide
280+
Given a file named "slides.md" with:
281+
"""
282+
# First
283+
***
284+
# Column 1, Slide 1
285+
---
286+
# Column 1, Slide 2
287+
---
288+
# Column 1, Slide 3
289+
***
290+
# Last
291+
"""
292+
When I run `reveal-ck generate`
293+
Then the exit status should be 0
294+
And the file "slides/index.html" should have html matching the xpath:
295+
| //section[1]/h1[text()="First"] | First slide |
296+
| //section[2]/section[1]/h1[text()="Column 1, Slide 1"] | Column 1, Slide 1 |
297+
| //section[2]/section[2]/h1[text()="Column 1, Slide 2"] | Column 1, Slide 2 |
298+
| //section[2]/section[3]/h1[text()="Column 1, Slide 3"] | Column 1, Slide 3 |
299+
| //section[3]/h1[text()="Last"] | Last Slide |
300+
301+
Scenario: Creating a slide, two columns of vertical slides, and final slide
302+
Given a file named "slides.md" with:
303+
"""
304+
# First
305+
***
306+
# Column 1, Slide 1
307+
---
308+
# Column 1, Slide 2
309+
---
310+
# Column 1, Slide 3
311+
***
312+
***
313+
# Column 2, Slide 1
314+
---
315+
# Column 2, Slide 2
316+
---
317+
# Column 2, Slide 3
318+
***
319+
# Last
320+
"""
321+
When I run `reveal-ck generate`
322+
Then the exit status should be 0
323+
And the file "slides/index.html" should have html matching the xpath:
324+
| //section[1]/h1[text()="First"] | First slide |
325+
| //section[2]/section[1]/h1[text()="Column 1, Slide 1"] | Column 1, Slide 1 |
326+
| //section[2]/section[2]/h1[text()="Column 1, Slide 2"] | Column 1, Slide 2 |
327+
| //section[2]/section[3]/h1[text()="Column 1, Slide 3"] | Column 1, Slide 3 |
328+
| //section[3]/section[1]/h1[text()="Column 2, Slide 1"] | Column 2, Slide 1 |
329+
| //section[3]/section[2]/h1[text()="Column 2, Slide 2"] | Column 2, Slide 2 |
330+
| //section[3]/section[3]/h1[text()="Column 2, Slide 3"] | Column 2, Slide 3 |
331+
| //section[4]/h1[text()="Last"] | Last Slide |
332+
333+
Scenario: Creating a slide, a column, a slide, a column, and a final slide
334+
Given a file named "slides.md" with:
335+
"""
336+
# First
337+
***
338+
# Column 1, Slide 1
339+
---
340+
# Column 1, Slide 2
341+
---
342+
# Column 1, Slide 3
343+
***
344+
# Middle
345+
***
346+
# Column 2, Slide 1
347+
---
348+
# Column 2, Slide 2
349+
---
350+
# Column 2, Slide 3
351+
***
352+
# Last
353+
"""
354+
When I run `reveal-ck generate`
355+
Then the exit status should be 0
356+
And the file "slides/index.html" should have html matching the xpath:
357+
| //section[1]/h1[text()="First"] | First slide |
358+
| //section[2]/section[1]/h1[text()="Column 1, Slide 1"] | Column 1, Slide 1 |
359+
| //section[2]/section[2]/h1[text()="Column 1, Slide 2"] | Column 1, Slide 2 |
360+
| //section[2]/section[3]/h1[text()="Column 1, Slide 3"] | Column 1, Slide 3 |
361+
| //section[3]/h1[text()="Middle"] | Middle slide |
362+
| //section[4]/section[1]/h1[text()="Column 2, Slide 1"] | Column 2, Slide 1 |
363+
| //section[4]/section[2]/h1[text()="Column 2, Slide 2"] | Column 2, Slide 2 |
364+
| //section[4]/section[3]/h1[text()="Column 2, Slide 3"] | Column 2, Slide 3 |
365+
| //section[5]/h1[text()="Last"] | Last Slide |

files/reveal-ck/templates/index.html/body.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</div>
77

88
<script src="lib/js/head.min.js"></script>
9-
<script src="js/reveal.min.js"></script>
9+
<script src="js/reveal.js"></script>
1010

1111
<script>
1212
<%= script %>

files/reveal-ck/templates/index.html/head.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
1212

13-
<link rel="stylesheet" href="css/reveal.min.css">
13+
<link rel="stylesheet" href="css/reveal.css">
1414
<link rel="stylesheet" href="css/theme/<%= config.theme %>.css" id="theme">
1515

1616
<!-- For syntax highlighting -->

files/reveal.js

Submodule reveal.js updated 56 files

lib/reveal-ck/builders/reveal_js_files.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ def files
2626
private
2727

2828
def css
29-
FileList["#{dir}/css/reveal.min.css",
29+
FileList["#{dir}/css/reveal.css",
3030
"#{dir}/css/print/*",
3131
"#{dir}/css/theme/*.css"]
3232
end
3333

3434
def js
35-
FileList["#{dir}/js/reveal.min.js"]
35+
FileList["#{dir}/js/reveal.js"]
3636
end
3737

3838
def lib

lib/reveal-ck/markdown.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,14 @@
1+
module RevealCK
2+
# This module defines how reveal-ck works with redcarpet to produce
3+
# slides from markdown.
4+
module Markdown
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+
end
9+
end
10+
111
require_relative 'markdown/slide_markdown'
12+
require_relative 'markdown/pre_processor'
13+
require_relative 'markdown/post_processor'
214
require_relative 'markdown/slide_markdown_template'

0 commit comments

Comments
 (0)