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

fix: allow custom template files outside of the template system #1429

Merged
merged 1 commit into from
Sep 30, 2020

Conversation

maartenbreddels
Copy link
Collaborator

As discussed over a videocall with @MSeal and @SylvainCorlay, this PR:

In #1292, we kind of 'tricked' the template system, by replacing the template_name by the parent directory name of the template_file. That caused an override of the template name. If we don't do that, but simply add that directory to the template search path, the whole template system machinery works with us. This allows .e.g:

$ python -m nbconvert --to html --execute --template material --TemplateExporter.template_file=nbconvert/exporters/tests/files/lablike.html.j2 ~/src/QuantStack/voila/notebooks/basics.ipynb

So we use a particular template (material in this case, but could be labl) but override the template_file.

Copy link
Contributor

@MSeal MSeal left a comment

Choose a reason for hiding this comment

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

Thanks! I tested some of the reported issues. We should probably also do a PR to update documentation for backwards compatibility. I'll get the basic template PR up later today to wrap up the other half of the implementation from the larger PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TemplateNotFound error when extending built-in template
2 participants