Show More
@@ -55,10 +55,6 b' class RevealExporter(BasicHTMLExporter):' | |||||
55 | }, |
|
55 | }, | |
56 | 'RevealHelpTransformer':{ |
|
56 | 'RevealHelpTransformer':{ | |
57 | 'enabled':True, |
|
57 | 'enabled':True, | |
58 | 'url_prefix':'//cdn.jsdelivr.net/reveal.js/2.4.0', |
|
|||
59 | # If you want to use a local reveal.js library, just |
|
|||
60 | # comment the previous line and uncomment the next one. |
|
|||
61 | #'url_prefix':'reveal.js', |
|
|||
62 | }, |
|
58 | }, | |
63 | }) |
|
59 | }) | |
64 | c.merge(super(RevealExporter,self).default_config) |
|
60 | c.merge(super(RevealExporter,self).default_config) |
@@ -13,7 +13,7 b'' | |||||
13 | #----------------------------------------------------------------------------- |
|
13 | #----------------------------------------------------------------------------- | |
14 |
|
14 | |||
15 | from .base import ConfigurableTransformer |
|
15 | from .base import ConfigurableTransformer | |
16 |
from IPython.utils.traitlets import |
|
16 | from IPython.utils.traitlets import Unicode | |
17 |
|
17 | |||
18 | #----------------------------------------------------------------------------- |
|
18 | #----------------------------------------------------------------------------- | |
19 | # Classes and functions |
|
19 | # Classes and functions | |
@@ -21,12 +21,15 b' from IPython.utils.traitlets import Bytes' | |||||
21 |
|
21 | |||
22 | class RevealHelpTransformer(ConfigurableTransformer): |
|
22 | class RevealHelpTransformer(ConfigurableTransformer): | |
23 |
|
23 | |||
24 | url_prefix = Bytes("", config=True, help="url prefix to get reveal.js files") |
|
24 | url_prefix = Unicode('//cdn.jsdelivr.net/reveal.js/2.4.0', | |
|
25 | config=True, | |||
|
26 | help="""If you want to use a local reveal.js library, | |||
|
27 | use 'url_prefix':'reveal.js' in your config object.""") | |||
25 |
|
28 | |||
26 | def call(self, nb, resources): |
|
29 | def call(self, nb, resources): | |
27 | """ |
|
30 | """ | |
28 | Called once to 'transform' contents of the notebook. |
|
31 | Called once to 'transform' contents of the notebook. | |
29 |
|
32 | |||
30 | Parameters |
|
33 | Parameters | |
31 | ---------- |
|
34 | ---------- | |
32 | nb : NotebookNode |
|
35 | nb : NotebookNode | |
@@ -35,8 +38,8 b' class RevealHelpTransformer(ConfigurableTransformer):' | |||||
35 | Additional resources used in the conversion process. Allows |
|
38 | Additional resources used in the conversion process. Allows | |
36 | transformers to pass variables into the Jinja engine. |
|
39 | transformers to pass variables into the Jinja engine. | |
37 | """ |
|
40 | """ | |
38 |
|
41 | |||
39 |
|
42 | |||
40 | for worksheet in nb.worksheets : |
|
43 | for worksheet in nb.worksheets : | |
41 | for i, cell in enumerate(worksheet.cells): |
|
44 | for i, cell in enumerate(worksheet.cells): | |
42 |
|
45 | |||
@@ -51,9 +54,8 b' class RevealHelpTransformer(ConfigurableTransformer):' | |||||
51 | if cell.metadata.slide_type in ['subslide']: |
|
54 | if cell.metadata.slide_type in ['subslide']: | |
52 | worksheet.cells[i - 1].metadata.slide_helper = 'subslide_end' |
|
55 | worksheet.cells[i - 1].metadata.slide_helper = 'subslide_end' | |
53 |
|
56 | |||
54 |
|
57 | |||
55 | resources['reveal'] = {} |
|
58 | resources['reveal'] = {} | |
56 |
resources['reveal']['url_prefix'] = self.url_prefix |
|
59 | resources['reveal']['url_prefix'] = self.url_prefix | |
57 |
|
60 | |||
58 | return nb, resources |
|
61 | return nb, resources | |
59 | No newline at end of file |
|
General Comments 0
You need to be logged in to leave comments.
Login now