diff --git a/IPython/nbconvert/exporters/html.py b/IPython/nbconvert/exporters/html.py index 88fae5f..aca6b97 100644 --- a/IPython/nbconvert/exporters/html.py +++ b/IPython/nbconvert/exporters/html.py @@ -12,6 +12,8 @@ # Imports #----------------------------------------------------------------------------- +import os + from IPython.nbconvert import preprocessors from IPython.config import Config @@ -32,8 +34,11 @@ class HTMLExporter(TemplateExporter): def _file_extension_default(self): return 'html' + def _default_template_path_default(self): + return os.path.join("..", "templates", "html") + def _template_file_default(self): - return 'html_full' + return 'full' output_mimetype = 'text/html' diff --git a/IPython/nbconvert/exporters/latex.py b/IPython/nbconvert/exporters/latex.py index 2ee5a44..fc1d780 100644 --- a/IPython/nbconvert/exporters/latex.py +++ b/IPython/nbconvert/exporters/latex.py @@ -43,9 +43,8 @@ class LatexExporter(TemplateExporter): return 'article' #Latex constants - default_template_path = Unicode( - os.path.join("..", "templates", "latex"), config=True, - help="Path where the template files are located.") + def _default_template_path_default(self): + return os.path.join("..", "templates", "latex") template_skeleton_path = Unicode( os.path.join("..", "templates", "latex", "skeleton"), config=True, diff --git a/IPython/nbconvert/exporters/tests/test_html.py b/IPython/nbconvert/exporters/tests/test_html.py index f6d6e33..f2c9f6c 100644 --- a/IPython/nbconvert/exporters/tests/test_html.py +++ b/IPython/nbconvert/exporters/tests/test_html.py @@ -47,7 +47,7 @@ class TestHTMLExporter(ExportersTestsBase): """ Can a HTMLExporter export using the 'basic' template? """ - (output, resources) = HTMLExporter(template_file='html_basic').from_filename(self._get_notebook()) + (output, resources) = HTMLExporter(template_file='basic').from_filename(self._get_notebook()) assert len(output) > 0 @@ -56,6 +56,6 @@ class TestHTMLExporter(ExportersTestsBase): """ Can a HTMLExporter export using the 'full' template? """ - (output, resources) = HTMLExporter(template_file='html_full').from_filename(self._get_notebook()) + (output, resources) = HTMLExporter(template_file='full').from_filename(self._get_notebook()) assert len(output) > 0 diff --git a/IPython/nbconvert/templates/html_basic.tpl b/IPython/nbconvert/templates/html/basic.tpl similarity index 100% rename from IPython/nbconvert/templates/html_basic.tpl rename to IPython/nbconvert/templates/html/basic.tpl diff --git a/IPython/nbconvert/templates/html_full.tpl b/IPython/nbconvert/templates/html/full.tpl similarity index 98% rename from IPython/nbconvert/templates/html_full.tpl rename to IPython/nbconvert/templates/html/full.tpl index cfc4516..21ab93c 100644 --- a/IPython/nbconvert/templates/html_full.tpl +++ b/IPython/nbconvert/templates/html/full.tpl @@ -1,4 +1,4 @@ -{%- extends 'html_basic.tpl' -%} +{%- extends 'basic.tpl' -%} {%- block header -%} @@ -67,4 +67,4 @@ init_mathjax(); {% block footer %} </html> -{% endblock footer %} \ No newline at end of file +{% endblock footer %} diff --git a/IPython/nbconvert/templates/reveal_internals/reveal_cells.tpl b/IPython/nbconvert/templates/html/reveal_internals/reveal_cells.tpl similarity index 94% rename from IPython/nbconvert/templates/reveal_internals/reveal_cells.tpl rename to IPython/nbconvert/templates/html/reveal_internals/reveal_cells.tpl index c733f06..51fa997 100644 --- a/IPython/nbconvert/templates/reveal_internals/reveal_cells.tpl +++ b/IPython/nbconvert/templates/html/reveal_internals/reveal_cells.tpl @@ -1,4 +1,4 @@ -{%- extends 'html_basic.tpl' -%} +{%- extends 'basic.tpl' -%} {%- block any_cell scoped -%} diff --git a/IPython/nbconvert/templates/reveal_internals/slides.tpl b/IPython/nbconvert/templates/html/reveal_internals/slides.tpl similarity index 100% rename from IPython/nbconvert/templates/reveal_internals/slides.tpl rename to IPython/nbconvert/templates/html/reveal_internals/slides.tpl diff --git a/IPython/nbconvert/templates/reveal_internals/subslides.tpl b/IPython/nbconvert/templates/html/reveal_internals/subslides.tpl similarity index 100% rename from IPython/nbconvert/templates/reveal_internals/subslides.tpl rename to IPython/nbconvert/templates/html/reveal_internals/subslides.tpl diff --git a/IPython/nbconvert/templates/slides_reveal.tpl b/IPython/nbconvert/templates/html/slides_reveal.tpl similarity index 100% rename from IPython/nbconvert/templates/slides_reveal.tpl rename to IPython/nbconvert/templates/html/slides_reveal.tpl diff --git a/IPython/nbconvert/tests/test_nbconvertapp.py b/IPython/nbconvert/tests/test_nbconvertapp.py index a6a0475..58eb067 100644 --- a/IPython/nbconvert/tests/test_nbconvertapp.py +++ b/IPython/nbconvert/tests/test_nbconvertapp.py @@ -123,7 +123,7 @@ class TestNbConvertApp(TestsBase): """Is embedded png data well formed in HTML?""" with self.create_temp_cwd(['notebook2.ipynb']): self.call('nbconvert --log-level 0 --to HTML ' - 'notebook2.ipynb --template html_full') + 'notebook2.ipynb --template full') assert os.path.isfile('notebook2.html') with open('notebook2.html') as f: assert "data:image/png;base64,b'" not in f.read()