render_notebook¶
-
nbreport.templating.render_notebook(notebook, context, jinja_env)¶ Render the Jinja-templated cells of a notebook.
Parameters: - notebook :
nbformat.NotebookNode The notebook document. This can be created programatically via
nbformat.v4.new_notebookor created from anipynbfile withnbformat.read. Thisnotebookis modified in place, though the function also returns the modifiednotebook.- context :
dict-like The template context. Usually this is constructed via
cookiecutter.generate.generate_context.- jinja_env :
cookiecutter.environment.StrictEnvironment The Jinja environment.
Returns: - notebook :
nbformat.NotebookNode The notebook document with templated cells rendered.
Notes
This function operates on the
sourcemember of each cell in the notebook. Cell sources are treated as individual Jinja templates.- notebook :