Skip to content

Commit

Permalink
renaming: .tplx->.tex .tpl->.j2, article.tex->index.tex
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenbreddels committed Aug 20, 2019
1 parent ba2d46f commit cc487ef
Show file tree
Hide file tree
Showing 23 changed files with 33 additions and 51 deletions.
2 changes: 1 addition & 1 deletion nbconvert/exporters/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ScriptExporter(TemplateExporter):

@default('template_file')
def _template_file_default(self):
return 'script.tpl'
return 'script.j2'

@default('template_name')
def _template_name_default(self):
Expand Down
23 changes: 3 additions & 20 deletions nbconvert/exporters/tests/test_latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,6 @@ def test_export_book(self):
assert len(output) > 0


@onlyif_cmds_exist('pandoc')
def test_export_basic(self):
"""
Can a LatexExporter export using 'article' template?
"""
(output, resources) = LatexExporter(template_file='article').from_filename(self._get_notebook())
assert len(output) > 0


@onlyif_cmds_exist('pandoc')
def test_export_article(self):
"""
Can a LatexExporter export using 'article' template?
"""
(output, resources) = LatexExporter(template_file='article').from_filename(self._get_notebook())
assert len(output) > 0

@onlyif_cmds_exist('pandoc')
def test_very_long_cells(self):
"""
Expand Down Expand Up @@ -104,7 +87,7 @@ def test_very_long_cells(self):
with open(nbfile, 'w') as f:
write(nb, f, 4)

(output, resources) = LatexExporter(template_file='article').from_filename(nbfile)
(output, resources) = LatexExporter().from_filename(nbfile)
assert len(output) > 0

@onlyif_cmds_exist('pandoc')
Expand Down Expand Up @@ -133,7 +116,7 @@ def test_prompt_number_color_ipython(self):
"""
my_loader_tplx = DictLoader({'my_template':
"""
((* extends 'style_ipython.tplx' *))
((* extends 'style_ipython.tex' *))
((* block docclass *))
\documentclass[11pt]{article}
Expand Down Expand Up @@ -184,7 +167,7 @@ def test_in_memory_template_tplx(self):
# Loads in an in memory latex template (.tplx) using jinja2.DictLoader
# creates a class that uses this template with the template_file argument
# converts an empty notebook using this mechanism
my_loader_tplx = DictLoader({'my_template': "{%- extends 'article' -%}"})
my_loader_tplx = DictLoader({'my_template': "{%- extends 'index' -%}"})

class MyExporter(LatexExporter):
template_file = 'my_template'
Expand Down
2 changes: 1 addition & 1 deletion share/jupyter/nbconvert/templates/asciidoc/index.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'display_priority.tpl' %}
{% extends 'display_priority.j2' %}


{% block input %}
Expand Down
2 changes: 1 addition & 1 deletion share/jupyter/nbconvert/templates/base/base.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{%- extends 'display_priority.tpl' -%}
{%- extends 'display_priority.j2' -%}


{% block codecell %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{%- extends 'null.tpl' -%}
{%- extends 'null.j2' -%}

{#display data priority#}

Expand Down
2 changes: 1 addition & 1 deletion share/jupyter/nbconvert/templates/lab/base.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{%- extends 'display_priority.tpl' -%}
{%- extends 'display_priority.j2' -%}

{% block codecell %}
{%- if not cell.outputs -%}
Expand Down
17 changes: 0 additions & 17 deletions share/jupyter/nbconvert/templates/latex/article.tex

This file was deleted.

2 changes: 1 addition & 1 deletion share/jupyter/nbconvert/templates/latex/base.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
functions. Figures, data_text,
This template does not define a docclass, the inheriting class must define this.=))

((*- extends 'document_contents.tplx' -*))
((*- extends 'document_contents.tex' -*))

%===============================================================================
% Abstract overrides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
To edit this file, please refer to ../../skeleton/README.md =))


((*- extends 'null.tplx' -*))
((*- extends 'null.j2' -*))

((=display data priority=))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
((*- extends 'display_priority.tplx' -*))
((*- extends 'display_priority.j2' -*))

%===============================================================================
% Support blocks
Expand Down
18 changes: 17 additions & 1 deletion share/jupyter/nbconvert/templates/latex/index.tex
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
((* extends 'article.tex' *))

((=- Default to the notebook output style -=))
((* if not cell_style is defined *))
((* set cell_style = 'style_jupyter.tex' *))
((* endif *))

((=- Inherit from the specified cell style. -=))
((* extends cell_style *))


%===============================================================================
% Latex Article
%===============================================================================

((* block docclass *))
\documentclass[11pt]{article}
((* endblock docclass *))
2 changes: 1 addition & 1 deletion share/jupyter/nbconvert/templates/latex/report.tex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

% Default to the notebook output style
((* if not cell_style is defined *))
((* set cell_style = 'style_ipython.tplx' *))
((* set cell_style = 'style_ipython.tex' *))
((* endif *))

% Inherit from the specified cell style.
Expand Down
2 changes: 1 addition & 1 deletion share/jupyter/nbconvert/templates/markdown/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'display_priority.tpl' %}
{% extends 'display_priority.j2' %}


{% block in_prompt %}
Expand Down
2 changes: 1 addition & 1 deletion share/jupyter/nbconvert/templates/python/index.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{%- extends 'null.tpl' -%}
{%- extends 'null.j2' -%}

{%- block header -%}
#!/usr/bin/env python
Expand Down
2 changes: 1 addition & 1 deletion share/jupyter/nbconvert/templates/rst/index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{%- extends 'display_priority.tpl' -%}
{%- extends 'display_priority.j2' -%}


{% block in_prompt %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{%- extends 'null.tpl' -%}
{%- extends 'null.j2' -%}

{% block input %}
{{ cell.source }}
Expand Down

0 comments on commit cc487ef

Please sign in to comment.