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

Build breaks for newest nbconvert #186

Closed
ageorgou opened this issue Oct 16, 2020 · 2 comments · Fixed by #214
Closed

Build breaks for newest nbconvert #186

ageorgou opened this issue Oct 16, 2020 · 2 comments · Fixed by #214
Labels
2020-21 Issues raised ahead of/during the 2020-21 teaching year build

Comments

@ageorgou
Copy link
Contributor

ageorgou commented Oct 16, 2020

When building the pages, the command

jupyter nbconvert --to html  --template jekyll.tpl --stdout ch00python/00pythons.nbconvert.ipynb > ch00python/00pythons.html

errors with

[snip]
 File "/home/travis/build/UCL/rsd-engineeringcourse/jekyll.tpl", line 1, in top-level template code
    {%- extends 'basic.tpl' -%}
jinja2.exceptions.TemplateNotFound: basic.tpl

This seems to be because of a change in how nbconvert templates are defined in the newest major version (this was using nbconvert 6.0.7).

See also jupyter/nbconvert#1369 for more examples, the docs on the new structure for custom templates and another overview of the new system. For now we can specify an earlier version, but changing the template may not be too complex either.

@ageorgou ageorgou added build 2020-21 Issues raised ahead of/during the 2020-21 teaching year labels Oct 16, 2020
@ageorgou
Copy link
Contributor Author

Looks like the template we need to extend in the new version is classic/base.html.j2 (in the very latest versions, this is also available as basic/index.html.j2). This looks very similar to the old basic.tpl which is what we are extending in our jekyll.tpl.

This may be a case of writing a simple JSON file and changing the name in jekyll.tpl.

ageorgou added a commit that referenced this issue Oct 3, 2022
We don't use Jinja directly but nbconvert does. Jinja version 3.1.x
has API changes (removing `contextfilter`) which don't work with
older nbconvert versions (nbconvert issue 1742). The newer version
of nbconvert should fix it, but we have pinned an older version
because of #186.
This is a temporary fix to get the build working again, but we
should eventually resolve the issuse in #186.
@ageorgou
Copy link
Contributor Author

ageorgou commented Oct 3, 2022

This is causing more issues, as newer versions of Jinja (3.1.0 onward) have a different API, which doesn't work with older nbconvert. It may be worth sorting this out for both this repository and UCL-RITS/doctoral-programming-intro#19.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2020-21 Issues raised ahead of/during the 2020-21 teaching year build
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant