Show More
@@ -0,0 +1,17 b'' | |||
|
1 | {%- extends 'reveal_cells.tpl' -%} | |
|
2 | ||
|
3 | ||
|
4 | ||
|
5 | {%- block any_cell scoped -%} | |
|
6 | {%- if cell.metadata.align_type in ['Left'] -%} | |
|
7 | {{ super() }} | |
|
8 | {%- elif cell.metadata.align_type in ['center'] -%} | |
|
9 | <div style="text-align:center"> | |
|
10 | {{ super() }} | |
|
11 | </div> | |
|
12 | {%- elif cell.metadata.align_type in ['right'] -%} | |
|
13 | <div style="text-align:right"> | |
|
14 | {{ super() }} | |
|
15 | </div> | |
|
16 | {%- endif -%} | |
|
17 | {%- endblock any_cell -%} |
@@ -1,15 +1,15 b'' | |||
|
1 | {%- extends 'reveal_cells.tpl' -%} | |
|
1 | {%- extends 'align_reveal_cells.tpl' -%} | |
|
2 | 2 | |
|
3 | 3 | |
|
4 | 4 | |
|
5 | 5 | {%- block any_cell scoped -%} |
|
6 | 6 | {%- if cell.metadata.slide_type in ['subslide'] -%} |
|
7 | 7 | <section> |
|
8 | 8 | {%- endif -%} |
|
9 | 9 | |
|
10 | 10 | {{ super() }} |
|
11 | 11 | |
|
12 | 12 | {%- if cell.metadata.slide_helper in ['subslide_end'] -%} |
|
13 | 13 | </section> |
|
14 | 14 | {%- endif -%} |
|
15 | 15 | {%- endblock any_cell -%} |
@@ -1,51 +1,52 b'' | |||
|
1 | 1 | """Module that pre-processes the notebook for export via Reveal. |
|
2 | 2 | """ |
|
3 | 3 | #----------------------------------------------------------------------------- |
|
4 | 4 | # Copyright (c) 2013, the IPython Development Team. |
|
5 | 5 | # |
|
6 | 6 | # Distributed under the terms of the Modified BSD License. |
|
7 | 7 | # |
|
8 | 8 | # The full license is in the file COPYING.txt, distributed with this software. |
|
9 | 9 | #----------------------------------------------------------------------------- |
|
10 | 10 | |
|
11 | 11 | #----------------------------------------------------------------------------- |
|
12 | 12 | # Imports |
|
13 | 13 | #----------------------------------------------------------------------------- |
|
14 | 14 | |
|
15 | 15 | from .base import ConfigurableTransformer |
|
16 | 16 | |
|
17 | 17 | #----------------------------------------------------------------------------- |
|
18 | 18 | # Classes and functions |
|
19 | 19 | #----------------------------------------------------------------------------- |
|
20 | 20 | |
|
21 | 21 | class RevealHelpTransformer(ConfigurableTransformer): |
|
22 | 22 | |
|
23 | 23 | def call(self, nb, resources): |
|
24 | 24 | """ |
|
25 | 25 | Called once to 'transform' contents of the notebook. |
|
26 | 26 | |
|
27 | 27 | Parameters |
|
28 | 28 | ---------- |
|
29 | 29 | nb : NotebookNode |
|
30 | 30 | Notebook being converted |
|
31 | 31 | resources : dictionary |
|
32 | 32 | Additional resources used in the conversion process. Allows |
|
33 | 33 | transformers to pass variables into the Jinja engine. |
|
34 | 34 | """ |
|
35 | 35 | |
|
36 | 36 | |
|
37 | 37 | for worksheet in nb.worksheets : |
|
38 | 38 | for i, cell in enumerate(worksheet.cells): |
|
39 | 39 | |
|
40 | 40 | #Make sure the cell has slideshow metadata. |
|
41 | cell.metadata.align_type = cell.get('metadata', {}).get('slideshow', {}).get('align_type', 'Left') | |
|
41 | 42 | cell.metadata.slide_type = cell.get('metadata', {}).get('slideshow', {}).get('slide_type', '-') |
|
42 | 43 | |
|
43 | 44 | #Get the slide type. If type is start of subslide or slide, |
|
44 | 45 | #end the last subslide/slide. |
|
45 | 46 | if cell.metadata.slide_type in ['slide']: |
|
46 | 47 | worksheet.cells[i - 1].metadata.slide_helper = 'slide_end' |
|
47 | 48 | if cell.metadata.slide_type in ['subslide']: |
|
48 | 49 | worksheet.cells[i - 1].metadata.slide_helper = 'subslide_end' |
|
49 | 50 | |
|
50 | 51 | return nb, resources |
|
51 | 52 | No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now