Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change template_path to template_paths in documentation examples #1374

Merged
merged 2 commits into from
Sep 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/api_examples/template_path/make_html.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
this script builds html files with either classic or classic_clone templates

Note: nbconvert 6.1 changed ``template_path`` to ``template_paths``
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically 6.0 changed it, but this is fine

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You know that I'm going to go back and change this ;-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I didn't want to get in the way of improvements merging :)

"""
import nbformat
from traitlets.config import Config
Expand All @@ -9,7 +11,7 @@
the_ipynb = nbformat.read(nbfile, as_version=4)

c = Config()
c.TemplateExporter.template_path = ['.', './project_templates']
c.TemplateExporter.template_paths = ['.', './project_templates']
for template in ['classic', 'classic_clone']:
c.HTMLExporter.template_name = template
html_exporter = HTMLExporter(config=c)
Expand Down
6 changes: 4 additions & 2 deletions docs/source/external_exporters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,14 @@ We are going to write an exporter that:
return '.test_ext'

@property
def template_path(self):
def template_paths(self):
"""
We want to inherit from HTML template, and have template under
``./templates/`` so append it to the search path. (see next section)

Note: nbconvert 6.1 changed ``template_path`` to ``template_paths``
"""
return super().template_path+[os.path.join(os.path.dirname(__file__), "templates")]
return super().template_paths+[os.path.join(os.path.dirname(__file__), "templates")]

def _template_file_default(self):
"""
Expand Down