Show More
@@ -49,6 +49,13 class RevealExporter(BasicHTMLExporter): | |||
|
49 | 49 | |
|
50 | 50 | @property |
|
51 | 51 | def default_config(self): |
|
52 | c = Config({'CSSHTMLHeaderTransformer':{'enabled':True}}) | |
|
52 | c = Config({ | |
|
53 | 'CSSHTMLHeaderTransformer':{ | |
|
54 | 'enabled':True | |
|
55 | }, | |
|
56 | 'RevealHelpTransformer':{ | |
|
57 | 'enabled':True, | |
|
58 | }, | |
|
59 | }) | |
|
53 | 60 | c.merge(super(RevealExporter,self).default_config) |
|
54 | 61 | return c |
@@ -12,19 +12,20 | |||
|
12 | 12 | <meta name="apple-mobile-web-app-capable" content="yes" /> |
|
13 | 13 | <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /> |
|
14 | 14 | |
|
15 | <link rel="stylesheet" href="reveal.js/css/reveal.css"> | |
|
16 |
<link rel="stylesheet" href="reveal. |
|
|
15 | <!-- General and theme style sheets --> | |
|
16 | <link rel="stylesheet" href="{{resources.reveal.url_prefix}}/css/reveal.css"> | |
|
17 | <link rel="stylesheet" href="{{resources.reveal.url_prefix}}/css/theme/simple.css" id="theme"> | |
|
17 | 18 | |
|
18 | 19 | <!-- For syntax highlighting --> |
|
19 |
<link rel="stylesheet" href="reveal. |
|
|
20 | <link rel="stylesheet" href="{{resources.reveal.url_prefix}}/lib/css/zenburn.css"> | |
|
20 | 21 | |
|
21 | 22 | <!-- If the query includes 'print-pdf', use the PDF print sheet --> |
|
22 | 23 | <script> |
|
23 |
document.write( '<link rel="stylesheet" href="reveal. |
|
|
24 | document.write( '<link rel="stylesheet" href="{{resources.reveal.url_prefix}}/css/print' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' ); | |
|
24 | 25 | </script> |
|
25 | 26 | |
|
26 | 27 | <!--[if lt IE 9]> |
|
27 |
<script src="reveal. |
|
|
28 | <script src="{{resources.reveal.url_prefix}}/lib/js/html5shiv.js"></script> | |
|
28 | 29 | <![endif]--> |
|
29 | 30 | |
|
30 | 31 | {% for css in resources.inlining.css -%} |
@@ -111,9 +112,9 to get enable social buttons. | |||
|
111 | 112 | </div> |
|
112 | 113 | --> |
|
113 | 114 | |
|
114 |
<script src="reveal. |
|
|
115 | <script src="{{resources.reveal.url_prefix}}/lib/js/head.min.js"></script> | |
|
115 | 116 | |
|
116 |
<script src="reveal. |
|
|
117 | <script src="{{resources.reveal.url_prefix}}/js/reveal.js"></script> | |
|
117 | 118 | |
|
118 | 119 | <script> |
|
119 | 120 | |
@@ -128,9 +129,9 transition: Reveal.getQueryHash().transition || 'linear', // default/cube/page/c | |||
|
128 | 129 | |
|
129 | 130 | // Optional libraries used to extend on reveal.js |
|
130 | 131 | dependencies: [ |
|
131 |
{ src: |
|
|
132 |
{ src: |
|
|
133 |
{ src: |
|
|
132 | { src: "{{resources.reveal.url_prefix}}/lib/js/classList.js", condition: function() { return !document.body.classList; } }, | |
|
133 | { src: "{{resources.reveal.url_prefix}}/plugin/highlight/highlight.js", async: true, callback: function() { hljs.initHighlightingOnLoad(); } }, | |
|
134 | { src: "{{resources.reveal.url_prefix}}/plugin/notes/notes.js", async: true, condition: function() { return !!document.body.classList; } } | |
|
134 | 135 | // { src: 'http://s7.addthis.com/js/300/addthis_widget.js', async: true}, |
|
135 | 136 | ] |
|
136 | 137 | }); |
@@ -13,6 +13,7 | |||
|
13 | 13 | #----------------------------------------------------------------------------- |
|
14 | 14 | |
|
15 | 15 | from .base import ConfigurableTransformer |
|
16 | from IPython.utils.traitlets import Unicode | |
|
16 | 17 | |
|
17 | 18 | #----------------------------------------------------------------------------- |
|
18 | 19 | # Classes and functions |
@@ -20,6 +21,11 from .base import ConfigurableTransformer | |||
|
20 | 21 | |
|
21 | 22 | class RevealHelpTransformer(ConfigurableTransformer): |
|
22 | 23 | |
|
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.""") | |
|
28 | ||
|
23 | 29 | def call(self, nb, resources): |
|
24 | 30 | """ |
|
25 | 31 | Called once to 'transform' contents of the notebook. |
@@ -48,5 +54,9 class RevealHelpTransformer(ConfigurableTransformer): | |||
|
48 | 54 | if cell.metadata.slide_type in ['subslide']: |
|
49 | 55 | worksheet.cells[i - 1].metadata.slide_helper = 'subslide_end' |
|
50 | 56 | |
|
51 | return nb, resources | |
|
52 | 57 | |
|
58 | if 'reveal' not in resources: | |
|
59 | resources['reveal'] = {} | |
|
60 | resources['reveal']['url_prefix'] = self.url_prefix | |
|
61 | ||
|
62 | return nb, resources |
General Comments 0
You need to be logged in to leave comments.
Login now