##// END OF EJS Templates
Added new delimiters to build vertical (nested slides). We also update the example_slide.ipynb to show the new functionality
damianavila -
Show More
@@ -5,7 +5,12 b' import os'
5 5 class ConverterReveal(ConverterMarkdown):
6 6 """Convert a notebook to a html slideshow.
7 7
8 It generates a static html slideshow based in markdown and reveal.js.
8 It generates a static html slideshow based in markdown and reveal.js.
9 You have four ways to delimit the the slides:
10 ##--- delimit horizontal slides
11 ##<<< open vertical slides
12 ##>>> close vertical slides
13 ##>>><<< close vertical slides and open new vertical slides.
9 14 """
10 15
11 16 def __init__(self, infile, highlight_source=False, show_prompts=True,
@@ -34,12 +39,18 b' class ConverterReveal(ConverterMarkdown):'
34 39 """
35 40 lines = []
36 41 lines.extend(self.optional_header())
37 top = '<section data-markdown><script type="text/template">'
38 bottom = '</script></section>'
42 left = '<section data-markdown><script type="text/template">'
43 right = '</script></section>'
39 44 text = self.main_body(cell_separator)
40 45 for i,j in enumerate(text):
41 if j == u'---':
42 text[i] = bottom + top
46 if j == u'##---':
47 text[i] = right + left
48 if j == u'##<<<':
49 text[i] = right + '<section>' + left
50 if j == u'##>>>':
51 text[i] = right + '</section>' + left
52 if j == u'##>>><<<':
53 text[i] = right + '</section><section>' + left
43 54 lines.extend(text)
44 55 lines.extend(self.optional_footer())
45 56 return u'\n'.join(lines)
@@ -1,6 +1,6 b''
1 1 {
2 2 "metadata": {
3 "name": "test_example_slide"
3 "name": "example_slide"
4 4 },
5 5 "nbformat": 3,
6 6 "nbformat_minor": 0,
@@ -33,7 +33,7 b''
33 33 "cell_type": "markdown",
34 34 "metadata": {},
35 35 "source": [
36 "---"
36 "##<<<"
37 37 ]
38 38 },
39 39 {
@@ -55,7 +55,7 b''
55 55 "cell_type": "markdown",
56 56 "metadata": {},
57 57 "source": [
58 "---"
58 "##---"
59 59 ]
60 60 },
61 61 {
@@ -69,7 +69,7 b''
69 69 "cell_type": "markdown",
70 70 "metadata": {},
71 71 "source": [
72 "---"
72 "##---"
73 73 ]
74 74 },
75 75 {
@@ -85,7 +85,7 b''
85 85 "cell_type": "markdown",
86 86 "metadata": {},
87 87 "source": [
88 "---"
88 "##>>><<<"
89 89 ]
90 90 },
91 91 {
@@ -111,7 +111,7 b''
111 111 "cell_type": "markdown",
112 112 "metadata": {},
113 113 "source": [
114 "---"
114 "##---"
115 115 ]
116 116 },
117 117 {
@@ -125,7 +125,7 b''
125 125 "cell_type": "markdown",
126 126 "metadata": {},
127 127 "source": [
128 "---"
128 "##---"
129 129 ]
130 130 },
131 131 {
@@ -150,7 +150,7 b''
150 150 "cell_type": "markdown",
151 151 "metadata": {},
152 152 "source": [
153 "---"
153 "##>>><<<"
154 154 ]
155 155 },
156 156 {
@@ -172,7 +172,7 b''
172 172 "cell_type": "markdown",
173 173 "metadata": {},
174 174 "source": [
175 "---"
175 "##---"
176 176 ]
177 177 },
178 178 {
@@ -189,7 +189,7 b''
189 189 "cell_type": "markdown",
190 190 "metadata": {},
191 191 "source": [
192 "---"
192 "##---"
193 193 ]
194 194 },
195 195 {
@@ -205,7 +205,7 b''
205 205 "cell_type": "markdown",
206 206 "metadata": {},
207 207 "source": [
208 "---"
208 "##---"
209 209 ]
210 210 },
211 211 {
@@ -221,7 +221,7 b''
221 221 "cell_type": "markdown",
222 222 "metadata": {},
223 223 "source": [
224 "---"
224 "##>>>"
225 225 ]
226 226 },
227 227 {
@@ -245,7 +245,7 b''
245 245 "cell_type": "markdown",
246 246 "metadata": {},
247 247 "source": [
248 "---"
248 "##---"
249 249 ]
250 250 },
251 251 {
@@ -289,7 +289,7 b''
289 289 "cell_type": "markdown",
290 290 "metadata": {},
291 291 "source": [
292 "---"
292 "##---"
293 293 ]
294 294 },
295 295 {
@@ -330,7 +330,7 b''
330 330 "cell_type": "markdown",
331 331 "metadata": {},
332 332 "source": [
333 "---"
333 "##---"
334 334 ]
335 335 },
336 336 {
@@ -350,7 +350,7 b''
350 350 "cell_type": "markdown",
351 351 "metadata": {},
352 352 "source": [
353 "---"
353 "##<<<"
354 354 ]
355 355 },
356 356 {
@@ -381,7 +381,7 b''
381 381 "cell_type": "markdown",
382 382 "metadata": {},
383 383 "source": [
384 "---"
384 "##---"
385 385 ]
386 386 },
387 387 {
@@ -407,7 +407,7 b''
407 407 "cell_type": "markdown",
408 408 "metadata": {},
409 409 "source": [
410 "---"
410 "##>>>"
411 411 ]
412 412 },
413 413 {
@@ -428,7 +428,7 b''
428 428 "cell_type": "markdown",
429 429 "metadata": {},
430 430 "source": [
431 "---"
431 "##---"
432 432 ]
433 433 },
434 434 {
General Comments 0
You need to be logged in to leave comments. Login now