Show More
@@ -14,8 +14,8 b' import itertools' | |||||
14 |
|
14 | |||
15 | class ConverterReveal(ConverterHTML): |
|
15 | class ConverterReveal(ConverterHTML): | |
16 | #""" |
|
16 | #""" | |
17 | #Convert a ipython notebook to a html slideshow |
|
17 | # Convert a ipython notebook to a html slideshow | |
18 | #based in reveal.js library. |
|
18 | # based in reveal.js library. | |
19 | #""" |
|
19 | #""" | |
20 |
|
20 | |||
21 | @text_cell |
|
21 | @text_cell | |
@@ -136,13 +136,25 b' class ConverterReveal(ConverterHTML):' | |||||
136 | right = '</section>' |
|
136 | right = '</section>' | |
137 | notes_start = '<aside class="notes">' |
|
137 | notes_start = '<aside class="notes">' | |
138 | notes_end = '</aside>' |
|
138 | notes_end = '</aside>' | |
139 | set_delim = self.delim[:6] |
|
139 | set_delim_skip = self.delim[:6] # to skip adjacent skkiped cells | |
|
140 | set_delim_notes = self.delim[:5] # to show adjacent speaker notes | |||
140 | #elimination of skipped cells |
|
141 | #elimination of skipped cells | |
141 | for i, j in enumerate(text): |
|
142 | for i, j in enumerate(text): | |
142 | if j == u'slide_type = skip': |
|
143 | if j == u'slide_type = skip': | |
143 | text.pop(i) |
|
144 | text.pop(i) | |
144 | while not text[i] in set_delim: |
|
145 | while not text[i] in set_delim_skip: | |
145 | text.pop(i) |
|
146 | text.pop(i) | |
|
147 | #encapsulation of notes cells | |||
|
148 | for i, j in enumerate(text): | |||
|
149 | if j == u'slide_type = notes': | |||
|
150 | text.pop(i) | |||
|
151 | temp_list = [] | |||
|
152 | while not text[i] in set_delim_notes: | |||
|
153 | temp_list.append(text.pop(i)) | |||
|
154 | else: | |||
|
155 | temp_list.insert(0, notes_start) | |||
|
156 | temp_list.append(notes_end) | |||
|
157 | text[i:i] = temp_list | |||
146 | # elimination of none names |
|
158 | # elimination of none names | |
147 | for i, j in enumerate(text): |
|
159 | for i, j in enumerate(text): | |
148 | if j in [u'slide_type = untouched', u'slide_type = -']: |
|
160 | if j in [u'slide_type = untouched', u'slide_type = -']: | |
@@ -159,11 +171,6 b' class ConverterReveal(ConverterHTML):' | |||||
159 | slide.pop(i) |
|
171 | slide.pop(i) | |
160 | slide[i] = slide[i][:4] + \ |
|
172 | slide[i] = slide[i][:4] + \ | |
161 | ' class="fragment"' + slide[i][4:] |
|
173 | ' class="fragment"' + slide[i][4:] | |
162 | # encapsulation of each speaker note |
|
|||
163 | for i, j in enumerate(slide): |
|
|||
164 | if j == u'slide_type = notes': |
|
|||
165 | slide[i] = notes_start |
|
|||
166 | slide.append(notes_end) # the notes at the slide end |
|
|||
167 | # encapsulation of each nested slide |
|
174 | # encapsulation of each nested slide | |
168 | if u'slide_type = slide' in slide: |
|
175 | if u'slide_type = slide' in slide: | |
169 | slide.insert(0, '<section>') |
|
176 | slide.insert(0, '<section>') |
@@ -151,6 +151,28 b'' | |||||
151 | }, |
|
151 | }, | |
152 | { |
|
152 | { | |
153 | "cell_type": "markdown", |
|
153 | "cell_type": "markdown", | |
|
154 | "metadata": { | |||
|
155 | "slideshow": { | |||
|
156 | "slide_type": "notes" | |||
|
157 | } | |||
|
158 | }, | |||
|
159 | "source": [ | |||
|
160 | "This is a speaker note in the middle of the slide..." | |||
|
161 | ] | |||
|
162 | }, | |||
|
163 | { | |||
|
164 | "cell_type": "markdown", | |||
|
165 | "metadata": { | |||
|
166 | "slideshow": { | |||
|
167 | "slide_type": "notes" | |||
|
168 | } | |||
|
169 | }, | |||
|
170 | "source": [ | |||
|
171 | "And also another speaker note..." | |||
|
172 | ] | |||
|
173 | }, | |||
|
174 | { | |||
|
175 | "cell_type": "markdown", | |||
154 | "metadata": {}, |
|
176 | "metadata": {}, | |
155 | "source": [ |
|
177 | "source": [ | |
156 | "IPython adds an 'inline' matplotlib backend,\n", |
|
178 | "IPython adds an 'inline' matplotlib backend,\n", |
General Comments 0
You need to be logged in to leave comments.
Login now