load_template_environment¶
- 
nbreport.templating.load_template_environment(context_path=None, extra_context=None, system_context=None)¶ Load the context (
cookiecutter.json) and Jinja template environment.Parameters: - context_path : 
pathlib.Pathorstr, optional Path to the
cookiecutter.jsoncontext file, if available. If a path isn’t provided, no template context is gathered from acookiecutter.jsonfile.- extra_context : 
dict, optional A dictionary of key-value terms (equivalent to the
cookiecutter.jsonfile’s structure) that override values obtained from anycookiecutter.jsonfile (atcontext_path).If
context_pathis None, then the context is populated entirely fromextra_context.- system_context : 
dict, optional A dictionary of key-value terms that are available to templates, but outside the
cookiecuttercontext. This argument is used bynbreport.instance.ReportInstance.renderto pass system metadata from thenbreport.yamlfile into the Jinja context.
Returns: - context : 
dict The context is a dictionary with a key called
'cookiecutter'that is adictwith template key-value pairs obtained from the combination of thecontext_pathandextra_context.This context dictionary can be used directly by Jinja to render a template.
- jinja_env : 
cookiecutter.environment.StrictEnvironment The Jinja template environment that is pre-loaded with the context.
Notes
Internally this function uses
cookiecutter.generate.generate_contextto combine acookiecutter.jsonfile withextra_context.- context_path :