Show More
@@ -55,10 +55,6 class RevealExporter(BasicHTMLExporter): | |||
|
55 | 55 | }, |
|
56 | 56 | 'RevealHelpTransformer':{ |
|
57 | 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 | 60 | c.merge(super(RevealExporter,self).default_config) |
@@ -13,7 +13,7 | |||
|
13 | 13 | #----------------------------------------------------------------------------- |
|
14 | 14 | |
|
15 | 15 | from .base import ConfigurableTransformer |
|
16 |
from IPython.utils.traitlets import |
|
|
16 | from IPython.utils.traitlets import Unicode | |
|
17 | 17 | |
|
18 | 18 | #----------------------------------------------------------------------------- |
|
19 | 19 | # Classes and functions |
@@ -21,12 +21,15 from IPython.utils.traitlets import Bytes | |||
|
21 | 21 | |
|
22 | 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 | 29 | def call(self, nb, resources): |
|
27 | 30 | """ |
|
28 | 31 | Called once to 'transform' contents of the notebook. |
|
29 | ||
|
32 | ||
|
30 | 33 | Parameters |
|
31 | 34 | ---------- |
|
32 | 35 | nb : NotebookNode |
@@ -35,8 +38,8 class RevealHelpTransformer(ConfigurableTransformer): | |||
|
35 | 38 | Additional resources used in the conversion process. Allows |
|
36 | 39 | transformers to pass variables into the Jinja engine. |
|
37 | 40 | """ |
|
38 | ||
|
39 | ||
|
41 | ||
|
42 | ||
|
40 | 43 | for worksheet in nb.worksheets : |
|
41 | 44 | for i, cell in enumerate(worksheet.cells): |
|
42 | 45 | |
@@ -51,9 +54,8 class RevealHelpTransformer(ConfigurableTransformer): | |||
|
51 | 54 | if cell.metadata.slide_type in ['subslide']: |
|
52 | 55 | worksheet.cells[i - 1].metadata.slide_helper = 'subslide_end' |
|
53 | 56 | |
|
54 | ||
|
57 | ||
|
55 | 58 | resources['reveal'] = {} |
|
56 |
resources['reveal']['url_prefix'] = self.url_prefix |
|
|
57 | ||
|
59 | resources['reveal']['url_prefix'] = self.url_prefix | |
|
60 | ||
|
58 | 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