UCL / rsd-engineeringcourse

Course materials for Research Software Engineering course.
http://github-pages.ucl.ac.uk/rsd-engineeringcourse/
Other
118 stars 101 forks source link

Build breaks for newest nbconvert #186

Closed ageorgou closed 1 year ago

ageorgou commented 3 years ago

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 commented 3 years ago

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 commented 2 years ago

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.