##// END OF EJS Templates
Added ipython styling through a method inside the converter. Modified the template to adjust to the new method. Rewritten of some css slyling through reveal_html.css.
damianavila -
Show More
@@ -0,0 +1,27 b''
1 /* Overrides of notebook CSS for static HTML export
2
3 */
4
5 .reveal {
6 font-size: 20px;
7 }
8 .reveal pre {
9 width: 100%;
10 padding: 0.2em;
11 margin: 0px auto;
12 font-size: 0.8em;
13 box-shadow: 0px 0px 0px rgba(0, 0, 0, 0);
14 }
15 div.prompt {
16 width: 11ex;
17 padding: 0.0em;
18 margin: 0px;
19 font-family: monospace;
20 }
21 div.output_subarea {
22 padding: 0.0em 0.0em 0.0em 0.0em;
23 }
24 div.output_prompt {
25 /* 5px right shift to account for margin in parent container */
26 margin: 0 5px 0 -5px;
27 }
@@ -3,6 +3,8 b' from __future__ import absolute_import'
3 from converters.html import ConverterHTML
3 from converters.html import ConverterHTML
4 from converters.utils import text_cell
4 from converters.utils import text_cell
5 from converters.utils import highlight, coalesce_streams
5 from converters.utils import highlight, coalesce_streams
6
7 from IPython.utils import path
6 from markdown import markdown
8 from markdown import markdown
7
9
8 import os
10 import os
@@ -181,6 +183,39 b' class ConverterReveal(ConverterHTML):'
181 f.write(self.output)
183 f.write(self.output)
182 return os.path.abspath(outfile)
184 return os.path.abspath(outfile)
183
185
186 def header_body(self):
187 """Return the body of the header as a list of strings."""
188
189 from pygments.formatters import HtmlFormatter
190
191 header = []
192 static = os.path.join(path.get_ipython_package_dir(),
193 'frontend', 'html', 'notebook', 'static',
194 )
195 here = os.path.split(os.path.realpath(__file__))[0]
196 css = os.path.join(static, 'css')
197 for sheet in [
198 # do we need jquery and prettify?
199 # os.path.join(static, 'jquery', 'css', 'themes', 'base',
200 # 'jquery-ui.min.css'),
201 # os.path.join(static, 'prettify', 'prettify.css'),
202 os.path.join(css, 'boilerplate.css'),
203 os.path.join(css, 'fbm.css'),
204 os.path.join(css, 'notebook.css'),
205 os.path.join(css, 'renderedhtml.css'),
206 # our overrides:
207 os.path.join(here, '..', 'css', 'reveal_html.css'),
208 ]:
209 header.extend(self._stylesheet(sheet))
210
211 # pygments css
212 pygments_css = HtmlFormatter().get_style_defs('.highlight')
213 header.extend(['<meta charset="UTF-8">'])
214 header.extend(self.in_tag('style', pygments_css,
215 dict(type='"text/css"')))
216
217 return header
218
184 def template_read(self):
219 def template_read(self):
185 "read the reveal_template.html"
220 "read the reveal_template.html"
186 here = os.path.split(os.path.realpath(__file__))[0]
221 here = os.path.split(os.path.realpath(__file__))[0]
@@ -200,8 +235,11 b' class ConverterReveal(ConverterHTML):'
200
235
201 def optional_header(self):
236 def optional_header(self):
202 optional_header_body = self.template_split()
237 optional_header_body = self.template_split()
203 return optional_header_body[0]
238 #return optional_header_body[0]
239 return ['<!DOCTYPE html>', '<html>', '<head>'] + \
240 optional_header_body[0] + self.header_body() + \
241 ['</head>', '<body>']
204
242
205 def optional_footer(self):
243 def optional_footer(self):
206 optional_footer_body = self.template_split()
244 optional_footer_body = self.template_split()
207 return optional_footer_body[1] No newline at end of file
245 return optional_footer_body[1] + ['</body>', '</html>'] No newline at end of file
@@ -1,6 +1,4 b''
1 <!DOCTYPE html>
1
2 <html>
3 <head>
4 <meta charset="utf-8" />
2 <meta charset="utf-8" />
5 <meta http-equiv="X-UA-Compatible" content="chrome=1">
3 <meta http-equiv="X-UA-Compatible" content="chrome=1">
6
4
@@ -10,8 +8,6 b''
10 <link rel="stylesheet" href="reveal/css/reveal.css">
8 <link rel="stylesheet" href="reveal/css/reveal.css">
11 <link rel="stylesheet" href="reveal/css/theme/default.css" id="theme">
9 <link rel="stylesheet" href="reveal/css/theme/default.css" id="theme">
12
10
13 <link rel="stylesheet" href="css/ipython.css">
14
15 <!-- For syntax highlighting -->
11 <!-- For syntax highlighting -->
16 <link rel="stylesheet" href="reveal/lib/css/zenburn.css">
12 <link rel="stylesheet" href="reveal/lib/css/zenburn.css">
17
13
@@ -24,8 +20,6 b''
24 <script src="reveal/lib/js/html5shiv.js"></script>
20 <script src="reveal/lib/js/html5shiv.js"></script>
25 <![endif]-->
21 <![endif]-->
26
22
27 </head>
28
29 %slides%
23 %slides%
30
24
31 <script src="reveal/lib/js/head.min.js"></script>
25 <script src="reveal/lib/js/head.min.js"></script>
@@ -46,8 +40,6 b''
46 // Optional libraries used to extend on reveal.js
40 // Optional libraries used to extend on reveal.js
47 dependencies: [
41 dependencies: [
48 { src: 'reveal/lib/js/classList.js', condition: function() { return !document.body.classList; } },
42 { src: 'reveal/lib/js/classList.js', condition: function() { return !document.body.classList; } },
49 { src: 'reveal/plugin/markdown/showdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
50 { src: 'reveal/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
51 { src: 'reveal/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
43 { src: 'reveal/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
52 { src: 'reveal/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
44 { src: 'reveal/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
53 { src: 'reveal/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },
45 { src: 'reveal/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },
@@ -63,5 +55,4 b''
63 });
55 });
64 </script>
56 </script>
65
57
66 </body>
58
67 </html>
1 NO CONTENT: file was removed
NO CONTENT: file was removed
This diff has been collapsed as it changes many lines, (739 lines changed) Show them Hide them
General Comments 0
You need to be logged in to leave comments. Login now