##// END OF EJS Templates
Fixed css in reveal template and move static_html css to full_html template.
damianavila -
Show More
@@ -1,271 +1,269 b''
1 """
1 """
2 Module that regroups transformer that woudl be applied to ipynb files
2 Module that regroups transformer that woudl be applied to ipynb files
3 before going through the templating machinery.
3 before going through the templating machinery.
4
4
5 It exposes convenient classes to inherit from to access configurability
5 It exposes convenient classes to inherit from to access configurability
6 as well as decorator to simplify tasks.
6 as well as decorator to simplify tasks.
7 """
7 """
8
8
9 from __future__ import print_function
9 from __future__ import print_function
10
10
11 from IPython.config.configurable import Configurable
11 from IPython.config.configurable import Configurable
12 from IPython.utils.traitlets import Unicode, Bool, Dict, List
12 from IPython.utils.traitlets import Unicode, Bool, Dict, List
13
13
14 from converters.config import GlobalConfigurable
14 from converters.config import GlobalConfigurable
15
15
16 class ConfigurableTransformers(GlobalConfigurable):
16 class ConfigurableTransformers(GlobalConfigurable):
17 """ A configurable transformer
17 """ A configurable transformer
18
18
19 Inherit from this class if you wish to have configurability for your
19 Inherit from this class if you wish to have configurability for your
20 transformer.
20 transformer.
21
21
22 Any configurable traitlets this class exposed will be configurable in profiles
22 Any configurable traitlets this class exposed will be configurable in profiles
23 using c.SubClassName.atribute=value
23 using c.SubClassName.atribute=value
24
24
25 you can overwrite cell_transform to apply a transformation independently on each cell
25 you can overwrite cell_transform to apply a transformation independently on each cell
26 or __call__ if you prefer your own logic. See orresponding docstring for informations.
26 or __call__ if you prefer your own logic. See orresponding docstring for informations.
27
27
28
28
29 """
29 """
30
30
31 def __init__(self, config=None, **kw):
31 def __init__(self, config=None, **kw):
32 super(ConfigurableTransformers, self).__init__(config=config, **kw)
32 super(ConfigurableTransformers, self).__init__(config=config, **kw)
33
33
34 def __call__(self, nb, other):
34 def __call__(self, nb, other):
35 """transformation to apply on each notebook.
35 """transformation to apply on each notebook.
36
36
37 received a handle to the current notebook as well as a dict of resources
37 received a handle to the current notebook as well as a dict of resources
38 which structure depends on the transformer.
38 which structure depends on the transformer.
39
39
40 You should return modified nb, other.
40 You should return modified nb, other.
41
41
42 If you wish to apply on each cell, you might want to overwrite cell_transform method.
42 If you wish to apply on each cell, you might want to overwrite cell_transform method.
43 """
43 """
44 try :
44 try :
45 for worksheet in nb.worksheets :
45 for worksheet in nb.worksheets :
46 for index, cell in enumerate(worksheet.cells):
46 for index, cell in enumerate(worksheet.cells):
47 worksheet.cells[index], other = self.cell_transform(cell, other, index)
47 worksheet.cells[index], other = self.cell_transform(cell, other, index)
48 return nb, other
48 return nb, other
49 except NotImplementedError:
49 except NotImplementedError:
50 raise NotImplementedError('should be implemented by subclass')
50 raise NotImplementedError('should be implemented by subclass')
51
51
52 def cell_transform(self, cell, other, index):
52 def cell_transform(self, cell, other, index):
53 """
53 """
54 Overwrite if you want to apply a transformation on each cell,
54 Overwrite if you want to apply a transformation on each cell,
55
55
56 receive the current cell, the resource dict and the index of current cell as parameter.
56 receive the current cell, the resource dict and the index of current cell as parameter.
57
57
58 You should return modified cell and resource dict.
58 You should return modified cell and resource dict.
59 """
59 """
60 raise NotImplementedError('should be implemented by subclass')
60 raise NotImplementedError('should be implemented by subclass')
61 return cell, other
61 return cell, other
62
62
63
63
64 class ActivatableTransformer(ConfigurableTransformers):
64 class ActivatableTransformer(ConfigurableTransformers):
65 """A simple ConfigurableTransformers that have an enabled flag
65 """A simple ConfigurableTransformers that have an enabled flag
66
66
67 Inherit from that if you just want to have a transformer which is
67 Inherit from that if you just want to have a transformer which is
68 no-op by default but can be activated in profiles with
68 no-op by default but can be activated in profiles with
69
69
70 c.YourTransformerName.enabled = True
70 c.YourTransformerName.enabled = True
71 """
71 """
72
72
73 enabled = Bool(False, config=True)
73 enabled = Bool(False, config=True)
74
74
75 def __call__(self, nb, other):
75 def __call__(self, nb, other):
76 if not self.enabled :
76 if not self.enabled :
77 return nb, other
77 return nb, other
78 else :
78 else :
79 return super(ActivatableTransformer, self).__call__(nb, other)
79 return super(ActivatableTransformer, self).__call__(nb, other)
80
80
81
81
82 def cell_preprocessor(function):
82 def cell_preprocessor(function):
83 """ wrap a function to be executed on all cells of a notebook
83 """ wrap a function to be executed on all cells of a notebook
84
84
85 wrapped function parameters :
85 wrapped function parameters :
86 cell : the cell
86 cell : the cell
87 other : external resources
87 other : external resources
88 index : index of the cell
88 index : index of the cell
89 """
89 """
90 def wrappedfunc(nb, other):
90 def wrappedfunc(nb, other):
91 for worksheet in nb.worksheets :
91 for worksheet in nb.worksheets :
92 for index, cell in enumerate(worksheet.cells):
92 for index, cell in enumerate(worksheet.cells):
93 worksheet.cells[index], other = function(cell, other, index)
93 worksheet.cells[index], other = function(cell, other, index)
94 return nb, other
94 return nb, other
95 return wrappedfunc
95 return wrappedfunc
96
96
97
97
98 @cell_preprocessor
98 @cell_preprocessor
99 def haspyout_transformer(cell, other, count):
99 def haspyout_transformer(cell, other, count):
100 """
100 """
101 Add a haspyout flag to cell that have it
101 Add a haspyout flag to cell that have it
102
102
103 Easier for templating, where you can't know in advance
103 Easier for templating, where you can't know in advance
104 wether to write the out prompt
104 wether to write the out prompt
105
105
106 """
106 """
107 cell.type = cell.cell_type
107 cell.type = cell.cell_type
108 cell.haspyout = False
108 cell.haspyout = False
109 for out in cell.get('outputs', []):
109 for out in cell.get('outputs', []):
110 if out.output_type == 'pyout':
110 if out.output_type == 'pyout':
111 cell.haspyout = True
111 cell.haspyout = True
112 break
112 break
113 return cell, other
113 return cell, other
114
114
115 @cell_preprocessor
115 @cell_preprocessor
116 def coalesce_streams(cell, other, count):
116 def coalesce_streams(cell, other, count):
117 """merge consecutive sequences of stream output into single stream
117 """merge consecutive sequences of stream output into single stream
118
118
119 to prevent extra newlines inserted at flush calls
119 to prevent extra newlines inserted at flush calls
120
120
121 TODO: handle \r deletion
121 TODO: handle \r deletion
122 """
122 """
123 outputs = cell.get('outputs', [])
123 outputs = cell.get('outputs', [])
124 if not outputs:
124 if not outputs:
125 return cell, other
125 return cell, other
126 new_outputs = []
126 new_outputs = []
127 last = outputs[0]
127 last = outputs[0]
128 new_outputs = [last]
128 new_outputs = [last]
129 for output in outputs[1:]:
129 for output in outputs[1:]:
130 if (output.output_type == 'stream' and
130 if (output.output_type == 'stream' and
131 last.output_type == 'stream' and
131 last.output_type == 'stream' and
132 last.stream == output.stream
132 last.stream == output.stream
133 ):
133 ):
134 last.text += output.text
134 last.text += output.text
135 else:
135 else:
136 new_outputs.append(output)
136 new_outputs.append(output)
137
137
138 cell.outputs = new_outputs
138 cell.outputs = new_outputs
139 return cell, other
139 return cell, other
140
140
141 class ExtractFigureTransformer(ActivatableTransformer):
141 class ExtractFigureTransformer(ActivatableTransformer):
142
142
143
143
144 extra_ext_map = Dict({},
144 extra_ext_map = Dict({},
145 config=True,
145 config=True,
146 help="""extra map to override extension based on type.
146 help="""extra map to override extension based on type.
147 Usefull for latex where svg will be converted to pdf before inclusion
147 Usefull for latex where svg will be converted to pdf before inclusion
148 """
148 """
149 )
149 )
150
150
151 key_format_map = Dict({},
151 key_format_map = Dict({},
152 config=True,
152 config=True,
153 )
153 )
154
154
155 figname_format_map = Dict({},
155 figname_format_map = Dict({},
156 config=True,
156 config=True,
157 )
157 )
158
158
159
159
160 #to do change this to .format {} syntax
160 #to do change this to .format {} syntax
161 default_key_tpl = Unicode('_fig_{count:02d}.{ext}', config=True)
161 default_key_tpl = Unicode('_fig_{count:02d}.{ext}', config=True)
162
162
163 def _get_ext(self, ext):
163 def _get_ext(self, ext):
164 if ext in self.extra_ext_map :
164 if ext in self.extra_ext_map :
165 return self.extra_ext_map[ext]
165 return self.extra_ext_map[ext]
166 return ext
166 return ext
167
167
168 def _new_figure(self, data, fmt, count):
168 def _new_figure(self, data, fmt, count):
169 """Create a new figure file in the given format.
169 """Create a new figure file in the given format.
170
170
171 """
171 """
172 tplf = self.figname_format_map.get(fmt, self.default_key_tpl)
172 tplf = self.figname_format_map.get(fmt, self.default_key_tpl)
173 tplk = self.key_format_map.get(fmt, self.default_key_tpl)
173 tplk = self.key_format_map.get(fmt, self.default_key_tpl)
174
174
175 # option to pass the hash as data ?
175 # option to pass the hash as data ?
176 figname = tplf.format(count=count, ext=self._get_ext(fmt))
176 figname = tplf.format(count=count, ext=self._get_ext(fmt))
177 key = tplk.format(count=count, ext=self._get_ext(fmt))
177 key = tplk.format(count=count, ext=self._get_ext(fmt))
178
178
179 # Binary files are base64-encoded, SVG is already XML
179 # Binary files are base64-encoded, SVG is already XML
180 if fmt in ('png', 'jpg', 'pdf'):
180 if fmt in ('png', 'jpg', 'pdf'):
181 data = data.decode('base64')
181 data = data.decode('base64')
182
182
183 return figname, key, data
183 return figname, key, data
184
184
185
185
186 def cell_transform(self, cell, other, count):
186 def cell_transform(self, cell, other, count):
187 if other.get('figures', None) is None :
187 if other.get('figures', None) is None :
188 other['figures'] = {}
188 other['figures'] = {}
189 for out in cell.get('outputs', []):
189 for out in cell.get('outputs', []):
190 for out_type in self.display_data_priority:
190 for out_type in self.display_data_priority:
191 if out.hasattr(out_type):
191 if out.hasattr(out_type):
192 figname, key, data = self._new_figure(out[out_type], out_type, count)
192 figname, key, data = self._new_figure(out[out_type], out_type, count)
193 out['key_'+out_type] = figname
193 out['key_'+out_type] = figname
194 other['figures'][key] = data
194 other['figures'][key] = data
195 count = count+1
195 count = count+1
196 return cell, other
196 return cell, other
197
197
198
198
199 class RevealHelpTransformer(ConfigurableTransformers):
199 class RevealHelpTransformer(ConfigurableTransformers):
200
200
201 def __call__(self, nb, other):
201 def __call__(self, nb, other):
202 for worksheet in nb.worksheets :
202 for worksheet in nb.worksheets :
203 for i, cell in enumerate(worksheet.cells):
203 for i, cell in enumerate(worksheet.cells):
204 cell.metadata.slide_type = cell.metadata.get('slideshow', {}).get('slide_type', None)
204 cell.metadata.slide_type = cell.metadata.get('slideshow', {}).get('slide_type', None)
205 if cell.metadata.slide_type is None:
205 if cell.metadata.slide_type is None:
206 cell.metadata.slide_type = '-'
206 cell.metadata.slide_type = '-'
207 if cell.metadata.slide_type in ['slide']:
207 if cell.metadata.slide_type in ['slide']:
208 worksheet.cells[i - 1].metadata.slide_helper = 'slide_end'
208 worksheet.cells[i - 1].metadata.slide_helper = 'slide_end'
209 if cell.metadata.slide_type in ['subslide']:
209 if cell.metadata.slide_type in ['subslide']:
210 worksheet.cells[i - 1].metadata.slide_helper = 'subslide_end'
210 worksheet.cells[i - 1].metadata.slide_helper = 'subslide_end'
211 return nb, other
211 return nb, other
212
212
213
213
214 class CSSHtmlHeaderTransformer(ActivatableTransformer):
214 class CSSHtmlHeaderTransformer(ActivatableTransformer):
215
215
216 def __call__(self, nb, resources):
216 def __call__(self, nb, resources):
217 """Fetch and add css to the resource dict
217 """Fetch and add css to the resource dict
218
218
219 Fetch css from IPython adn Pygment to add at the beginning
219 Fetch css from IPython adn Pygment to add at the beginning
220 of the html files.
220 of the html files.
221
221
222 Add this css in resources in the "inlining.css" key
222 Add this css in resources in the "inlining.css" key
223 """
223 """
224 resources['inlining'] = {}
224 resources['inlining'] = {}
225 resources['inlining']['css'] = self.header
225 resources['inlining']['css'] = self.header
226 return nb, resources
226 return nb, resources
227
227
228 header = []
228 header = []
229
229
230 def __init__(self, config=None, **kw):
230 def __init__(self, config=None, **kw):
231 super(CSSHtmlHeaderTransformer, self).__init__(config=config, **kw)
231 super(CSSHtmlHeaderTransformer, self).__init__(config=config, **kw)
232 if self.enabled :
232 if self.enabled :
233 self.regen_header()
233 self.regen_header()
234
234
235 def regen_header(self):
235 def regen_header(self):
236 ## lazy load asa this might not be use in many transformers
236 ## lazy load asa this might not be use in many transformers
237 import os
237 import os
238 from IPython.utils import path
238 from IPython.utils import path
239 import io
239 import io
240 from pygments.formatters import HtmlFormatter
240 from pygments.formatters import HtmlFormatter
241 header = []
241 header = []
242 static = os.path.join(path.get_ipython_package_dir(),
242 static = os.path.join(path.get_ipython_package_dir(),
243 'frontend', 'html', 'notebook', 'static',
243 'frontend', 'html', 'notebook', 'static',
244 )
244 )
245 here = os.path.split(os.path.realpath(__file__))[0]
245 here = os.path.split(os.path.realpath(__file__))[0]
246 css = os.path.join(static, 'css')
246 css = os.path.join(static, 'css')
247 for sheet in [
247 for sheet in [
248 # do we need jquery and prettify?
248 # do we need jquery and prettify?
249 # os.path.join(static, 'jquery', 'css', 'themes', 'base',
249 # os.path.join(static, 'jquery', 'css', 'themes', 'base',
250 # 'jquery-ui.min.css'),
250 # 'jquery-ui.min.css'),
251 # os.path.join(static, 'prettify', 'prettify.css'),
251 # os.path.join(static, 'prettify', 'prettify.css'),
252 os.path.join(css, 'boilerplate.css'),
252 os.path.join(css, 'boilerplate.css'),
253 os.path.join(css, 'fbm.css'),
253 os.path.join(css, 'fbm.css'),
254 os.path.join(css, 'notebook.css'),
254 os.path.join(css, 'notebook.css'),
255 os.path.join(css, 'renderedhtml.css'),
255 os.path.join(css, 'renderedhtml.css'),
256 os.path.join(css, 'style.min.css'),
256 os.path.join(css, 'style.min.css'),
257 # our overrides:
258 os.path.join(here, '..', 'css', 'static_html.css'),
259 ]:
257 ]:
260 try:
258 try:
261 with io.open(sheet, encoding='utf-8') as f:
259 with io.open(sheet, encoding='utf-8') as f:
262 s = f.read()
260 s = f.read()
263 header.append(s)
261 header.append(s)
264 except IOError:
262 except IOError:
265 # new version of ipython with style.min.css, pass
263 # new version of ipython with style.min.css, pass
266 pass
264 pass
267
265
268 pygments_css = HtmlFormatter().get_style_defs('.highlight')
266 pygments_css = HtmlFormatter().get_style_defs('.highlight')
269 header.append(pygments_css)
267 header.append(pygments_css)
270 self.header = header
268 self.header = header
271
269
@@ -1,46 +1,58 b''
1 {%- extends 'basichtml.tpl' -%}
1 {%- extends 'basichtml.tpl' -%}
2
2
3 {%- block header -%}<!DOCTYPE html>
3 {%- block header -%}<!DOCTYPE html>
4 <html>
4 <html>
5 <head>
5 <head>
6 <meta charset="UTF-8">
6 <meta charset="UTF-8">
7 <title>[{{nb.metadata.name}}]</title>
7 <title>[{{nb.metadata.name}}]</title>
8 {% for css in resources.inlining.css -%}
8 {% for css in resources.inlining.css -%}
9 <style type="text/css">
9 <style type="text/css">
10 {{css}}
10 {{css}}
11 </style>
11 </style>
12 {% endfor %}
12 {% endfor %}
13
14 <style type="text/css">
15 /* Overrides of notebook CSS for static HTML export */
16 body {
17 overflow: visible;
18 padding: 8px;
19 }
20 .input_area {
21 padding: 0.4em;
22 }
23 </style>
24
13 <script src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" type="text/javascript">
25 <script src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" type="text/javascript">
14
26
15 </script>
27 </script>
16 <script type="text/javascript">
28 <script type="text/javascript">
17 init_mathjax = function() {
29 init_mathjax = function() {
18 if (window.MathJax) {
30 if (window.MathJax) {
19 // MathJax loaded
31 // MathJax loaded
20 MathJax.Hub.Config({
32 MathJax.Hub.Config({
21 tex2jax: {
33 tex2jax: {
22 inlineMath: [ ['$','$'], ["\\(","\\)"] ],
34 inlineMath: [ ['$','$'], ["\\(","\\)"] ],
23 displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
35 displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
24 },
36 },
25 displayAlign: 'left', // Change this to 'center' to center equations.
37 displayAlign: 'left', // Change this to 'center' to center equations.
26 "HTML-CSS": {
38 "HTML-CSS": {
27 styles: {'.MathJax_Display': {"margin": 0}}
39 styles: {'.MathJax_Display': {"margin": 0}}
28 }
40 }
29 });
41 });
30 MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
42 MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
31 }
43 }
32 }
44 }
33 init_mathjax();
45 init_mathjax();
34 </script>
46 </script>
35 </head>
47 </head>
36 {%- endblock header -%}
48 {%- endblock header -%}
37
49
38
50
39 {% block body %}
51 {% block body %}
40 <body>{{ super() }}
52 <body>{{ super() }}
41 </body>
53 </body>
42 {%- endblock body %}
54 {%- endblock body %}
43
55
44
56
45 {% block footer %}
57 {% block footer %}
46 </html>{% endblock footer %}
58 </html>{% endblock footer %}
@@ -1,148 +1,154 b''
1 {%- extends 'slides.tpl' -%}
1 {%- extends 'slides.tpl' -%}
2
2
3
3
4 {% block header %}
4 {% block header %}
5 <!DOCTYPE html>
5 <!DOCTYPE html>
6 <html>
6 <html>
7 <head>
7 <head>
8
8
9 <meta charset="utf-8" />
9 <meta charset="utf-8" />
10 <meta http-equiv="X-UA-Compatible" content="chrome=1">
10 <meta http-equiv="X-UA-Compatible" content="chrome=1">
11
11
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/css/reveal.css">
15 <link rel="stylesheet" href="reveal/css/reveal.css">
16 <link rel="stylesheet" href="reveal/css/theme/simple.css" id="theme">
16 <link rel="stylesheet" href="reveal/css/theme/simple.css" id="theme">
17
17
18 <!-- For syntax highlighting -->
18 <!-- For syntax highlighting -->
19 <link rel="stylesheet" href="reveal/lib/css/zenburn.css">
19 <link rel="stylesheet" href="reveal/lib/css/zenburn.css">
20
20
21 <!-- If the query includes 'print-pdf', use the PDF print sheet -->
21 <!-- If the query includes 'print-pdf', use the PDF print sheet -->
22 <script>
22 <script>
23 document.write( '<link rel="stylesheet" href="reveal/css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
23 document.write( '<link rel="stylesheet" href="reveal/css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
24 </script>
24 </script>
25
25
26 <!--[if lt IE 9]>
26 <!--[if lt IE 9]>
27 <script src="reveal/lib/js/html5shiv.js"></script>
27 <script src="reveal/lib/js/html5shiv.js"></script>
28 <![endif]-->
28 <![endif]-->
29
29
30 {% for css in resources.inlining.css -%}
30 {% for css in resources.inlining.css -%}
31 <style type="text/css">
31 <style type="text/css">
32 {{css}}
32 {{css}}
33 </style>
33 </style>
34 {% endfor %}
34 {% endfor %}
35
35
36 <style type="text/css">
36 <style type="text/css">
37 /* Overrides of notebook CSS for static HTML export */
37 /* Overrides of notebook CSS for static HTML export */
38
39 .reveal {
38 .reveal {
40 font-size: 20px;
39 font-size: 20px;
41 }
40 }
42 .reveal pre {
41 .reveal pre {
43 width: 100%;
42 width: 100%;
44 padding: 0.2em;
43 padding: 0.3em;
45 margin: 0px auto;
44 margin: 0px auto;
46 font-family: monospace, sans-serif;
45 font-family: monospace, sans-serif;
47 font-size: 60%;
46 font-size: 80%;
48 box-shadow: 0px 0px 0px rgba(0, 0, 0, 0);
47 box-shadow: 0px 0px 0px rgba(0, 0, 0, 0);
49 }
48 }
50 .reveal section img {
49 .reveal section img {
51 border: 0px solid black;
50 border: 0px solid black;
52 box-shadow: 0 0 10px rgba(0, 0, 0, 0);
51 box-shadow: 0 0 10px rgba(0, 0, 0, 0);
52 }
53 .reveal .slides {
54 text-align: left;
53 }
55 }
54 div.input_area {
56 div.input_area {
55 padding: 0.2em;
57 padding: 0.06em;
56 }
58 }
57 div.code_cell {
59 div.code_cell {
58 background-color: transparent;
60 background-color: transparent;
59 }
61 }
60 div.prompt {
62 div.prompt {
61 width: 11ex;
63 width: 11ex;
62 padding: 0.0em;
64 padding: 0.4em;
63 margin: 0px;
65 margin: 0px;
64 font-family: monospace;
66 font-family: monospace, sans-serif;
65 font-size: 60%;
67 font-size: 80%;
66 text-align: center;
68 text-align: right;
69 }
70 div.output_area pre {
71 font-family: monospace, sans-serif;
72 font-size: 80%;
67 }
73 }
68 div.output_prompt {
74 div.output_prompt {
69 /* 5px right shift to account for margin in parent container */
75 /* 5px right shift to account for margin in parent container */
70 margin: 5px 5px 0 -5px;
76 margin: 5px 5px 0 -5px;
71 }
77 }
72 </style>
78 </style>
73 </head>
79 </head>
74 {% endblock header%}
80 {% endblock header%}
75
81
76
82
77 {% block body %}
83 {% block body %}
78 <body>
84 <body>
79 <div class="reveal"><div class="slides">
85 <div class="reveal"><div class="slides">
80
86
81 {{ super() }}
87 {{ super() }}
82
88
83 </div></div>
89 </div></div>
84
90
85 <!-- Social buttons -->
91 <!-- Social buttons -->
86 <div class="addthis_toolbox addthis_floating_style addthis_32x32_style" style="left:20px;top:20px;">
92 <div class="addthis_toolbox addthis_floating_style addthis_32x32_style" style="left:20px;top:20px;">
87 <a class="addthis_button_twitter"></a>
93 <a class="addthis_button_twitter"></a>
88 <a class="addthis_button_google_plusone_share"></a>
94 <a class="addthis_button_google_plusone_share"></a>
89 <a class="addthis_button_linkedin"></a>
95 <a class="addthis_button_linkedin"></a>
90 <a class="addthis_button_facebook"></a>
96 <a class="addthis_button_facebook"></a>
91 <a class="addthis_button_more"></a>
97 <a class="addthis_button_more"></a>
92 </div>
98 </div>
93 <!-- End of social buttons -->
99 <!-- End of social buttons -->
94
100
95 <!-- MathJax configuration -->
101 <!-- MathJax configuration -->
96 <script type="text/x-mathjax-config">
102 <script type="text/x-mathjax-config">
97 MathJax.Hub.Config({
103 MathJax.Hub.Config({
98 tex2jax: {
104 tex2jax: {
99 inlineMath: [ ['$','$'], ["\\(","\\)"] ],
105 inlineMath: [ ['$','$'], ["\\(","\\)"] ],
100 displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
106 displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
101 },
107 },
102 displayAlign: 'center', // Change this to 'center' to center equations.
108 displayAlign: 'left', // Change this to 'center' to center equations.
103 "HTML-CSS": {
109 "HTML-CSS": {
104 styles: {'.MathJax_Display': {"margin": 0}}
110 styles: {'.MathJax_Display': {"margin": 0}}
105 }
111 }
106 });
112 });
107 </script>
113 </script>
108 <!-- End of mathjax configuration -->
114 <!-- End of mathjax configuration -->
109
115
110 <script src="reveal/lib/js/head.min.js"></script>
116 <script src="reveal/lib/js/head.min.js"></script>
111
117
112 <script src="reveal/js/reveal.min.js"></script>
118 <script src="reveal/js/reveal.min.js"></script>
113
119
114 <script>
120 <script>
115
121
116 // Full list of configuration options available here: https://github.com/hakimel/reveal.js#configuration
122 // Full list of configuration options available here: https://github.com/hakimel/reveal.js#configuration
117 Reveal.initialize({
123 Reveal.initialize({
118 controls: true,
124 controls: true,
119 progress: true,
125 progress: true,
120 history: true,
126 history: true,
121
127
122 theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
128 theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
123 transition: Reveal.getQueryHash().transition || 'linear', // default/cube/page/concave/zoom/linear/none
129 transition: Reveal.getQueryHash().transition || 'linear', // default/cube/page/concave/zoom/linear/none
124
130
125 // Optional libraries used to extend on reveal.js
131 // Optional libraries used to extend on reveal.js
126 dependencies: [
132 dependencies: [
127 { src: 'reveal/lib/js/classList.js', condition: function() { return !document.body.classList; } },
133 { src: 'reveal/lib/js/classList.js', condition: function() { return !document.body.classList; } },
128 { src: 'reveal/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
134 { src: 'reveal/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
129 { src: 'reveal/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
135 { src: 'reveal/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
130 { src: 'reveal/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },
136 { src: 'reveal/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },
131 { src: 'http://s7.addthis.com/js/300/addthis_widget.js', async: true},
137 { src: 'http://s7.addthis.com/js/300/addthis_widget.js', async: true},
132 { src: 'js/mathjax-onload.js', async: true}
138 { src: 'js/mathjax-onload.js', async: true}
133 ]
139 ]
134 });
140 });
135 </script>
141 </script>
136
142
137 <script>
143 <script>
138 Reveal.addEventListener( 'slidechanged', function( event ) {
144 Reveal.addEventListener( 'slidechanged', function( event ) {
139 MathJax.Hub.Rerender(event.currentSlide);
145 MathJax.Hub.Rerender(event.currentSlide);
140 });
146 });
141 </script>
147 </script>
142
148
143 </body>
149 </body>
144 {% endblock body %}
150 {% endblock body %}
145
151
146 {% block footer %}
152 {% block footer %}
147 </html>
153 </html>
148 {% endblock footer %} No newline at end of file
154 {% endblock footer %}
General Comments 0
You need to be logged in to leave comments. Login now