nbreport.templating.render_notebook(notebook, context, jinja_env)

Render the Jinja-templated cells of a notebook.

notebook : nbformat.NotebookNode

The notebook document. This can be created programatically via nbformat.v4.new_notebook or created from an ipynb file with This notebook is modified in place, though the function also returns the modified notebook.

context : dict-like

The template context. Usually this is constructed via cookiecutter.generate.generate_context.

jinja_env : cookiecutter.environment.StrictEnvironment

The Jinja environment.

notebook : nbformat.NotebookNode

The notebook document with templated cells rendered.


This function operates on the source member of each cell in the notebook. Cell sources are treated as individual Jinja templates.