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