##// END OF EJS Templates
Move html templates into separate folder
Thomas Kluyver -
Show More
@@ -12,6 +12,8 b''
12 # Imports
12 # Imports
13 #-----------------------------------------------------------------------------
13 #-----------------------------------------------------------------------------
14
14
15 import os
16
15 from IPython.nbconvert import preprocessors
17 from IPython.nbconvert import preprocessors
16 from IPython.config import Config
18 from IPython.config import Config
17
19
@@ -32,8 +34,11 b' class HTMLExporter(TemplateExporter):'
32 def _file_extension_default(self):
34 def _file_extension_default(self):
33 return 'html'
35 return 'html'
34
36
37 def _default_template_path_default(self):
38 return os.path.join("..", "templates", "html")
39
35 def _template_file_default(self):
40 def _template_file_default(self):
36 return 'html_full'
41 return 'full'
37
42
38 output_mimetype = 'text/html'
43 output_mimetype = 'text/html'
39
44
@@ -43,9 +43,8 b' class LatexExporter(TemplateExporter):'
43 return 'article'
43 return 'article'
44
44
45 #Latex constants
45 #Latex constants
46 default_template_path = Unicode(
46 def _default_template_path_default(self):
47 os.path.join("..", "templates", "latex"), config=True,
47 return os.path.join("..", "templates", "latex")
48 help="Path where the template files are located.")
49
48
50 template_skeleton_path = Unicode(
49 template_skeleton_path = Unicode(
51 os.path.join("..", "templates", "latex", "skeleton"), config=True,
50 os.path.join("..", "templates", "latex", "skeleton"), config=True,
@@ -47,7 +47,7 b' class TestHTMLExporter(ExportersTestsBase):'
47 """
47 """
48 Can a HTMLExporter export using the 'basic' template?
48 Can a HTMLExporter export using the 'basic' template?
49 """
49 """
50 (output, resources) = HTMLExporter(template_file='html_basic').from_filename(self._get_notebook())
50 (output, resources) = HTMLExporter(template_file='basic').from_filename(self._get_notebook())
51 assert len(output) > 0
51 assert len(output) > 0
52
52
53
53
@@ -56,6 +56,6 b' class TestHTMLExporter(ExportersTestsBase):'
56 """
56 """
57 Can a HTMLExporter export using the 'full' template?
57 Can a HTMLExporter export using the 'full' template?
58 """
58 """
59 (output, resources) = HTMLExporter(template_file='html_full').from_filename(self._get_notebook())
59 (output, resources) = HTMLExporter(template_file='full').from_filename(self._get_notebook())
60 assert len(output) > 0
60 assert len(output) > 0
61
61
1 NO CONTENT: file renamed from IPython/nbconvert/templates/html_basic.tpl to IPython/nbconvert/templates/html/basic.tpl
NO CONTENT: file renamed from IPython/nbconvert/templates/html_basic.tpl to IPython/nbconvert/templates/html/basic.tpl
@@ -1,4 +1,4 b''
1 {%- extends 'html_basic.tpl' -%}
1 {%- extends 'basic.tpl' -%}
2
2
3
3
4 {%- block header -%}
4 {%- block header -%}
@@ -67,4 +67,4 b' init_mathjax();'
67
67
68 {% block footer %}
68 {% block footer %}
69 </html>
69 </html>
70 {% endblock footer %} No newline at end of file
70 {% endblock footer %}
@@ -1,4 +1,4 b''
1 {%- extends 'html_basic.tpl' -%}
1 {%- extends 'basic.tpl' -%}
2
2
3
3
4 {%- block any_cell scoped -%}
4 {%- block any_cell scoped -%}
1 NO CONTENT: file renamed from IPython/nbconvert/templates/reveal_internals/slides.tpl to IPython/nbconvert/templates/html/reveal_internals/slides.tpl
NO CONTENT: file renamed from IPython/nbconvert/templates/reveal_internals/slides.tpl to IPython/nbconvert/templates/html/reveal_internals/slides.tpl
1 NO CONTENT: file renamed from IPython/nbconvert/templates/reveal_internals/subslides.tpl to IPython/nbconvert/templates/html/reveal_internals/subslides.tpl
NO CONTENT: file renamed from IPython/nbconvert/templates/reveal_internals/subslides.tpl to IPython/nbconvert/templates/html/reveal_internals/subslides.tpl
1 NO CONTENT: file renamed from IPython/nbconvert/templates/slides_reveal.tpl to IPython/nbconvert/templates/html/slides_reveal.tpl
NO CONTENT: file renamed from IPython/nbconvert/templates/slides_reveal.tpl to IPython/nbconvert/templates/html/slides_reveal.tpl
@@ -123,7 +123,7 b' class TestNbConvertApp(TestsBase):'
123 """Is embedded png data well formed in HTML?"""
123 """Is embedded png data well formed in HTML?"""
124 with self.create_temp_cwd(['notebook2.ipynb']):
124 with self.create_temp_cwd(['notebook2.ipynb']):
125 self.call('nbconvert --log-level 0 --to HTML '
125 self.call('nbconvert --log-level 0 --to HTML '
126 'notebook2.ipynb --template html_full')
126 'notebook2.ipynb --template full')
127 assert os.path.isfile('notebook2.html')
127 assert os.path.isfile('notebook2.html')
128 with open('notebook2.html') as f:
128 with open('notebook2.html') as f:
129 assert "data:image/png;base64,b'" not in f.read()
129 assert "data:image/png;base64,b'" not in f.read()
General Comments 0
You need to be logged in to leave comments. Login now