##// END OF EJS Templates
Backport PR #8196: DEV: Allow supplying jinja vars from python config....
Backport PR #8196: DEV: Allow supplying jinja vars from python config. This PR allows the user to specify a dictionary of values to `NotebookApp.jinja_template_vars` whose values are made available in the jinja templating environment. This is primarily useful in conjunction with the `get_body_data` javascript function to allow programmatic access to Python-specified values from Javascript. An example of where this is useful is when you want to use different constants in Javascript based on a deployment environment; this allows you to write code in your ipython_notebook_config that looks like: ``` env = os.environ['DEPLOYMENT_ENV'] if env == 'DEV': template_vars = dev_template_vars ...

File last commit:

r19043:61844265
r21455:37a99411
Show More
__init__.py
23 lines | 696 B | text/x-python | PythonLexer
"""The main API for the v4 notebook format."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
__all__ = ['nbformat', 'nbformat_minor', 'nbformat_schema', 'new_code_cell',
'new_markdown_cell', 'new_notebook', 'new_output', 'output_from_msg',
'reads', 'writes', 'to_notebook', 'downgrade', 'upgrade']
from .nbbase import (
nbformat, nbformat_minor, nbformat_schema,
new_code_cell, new_markdown_cell, new_notebook,
new_output, output_from_msg,
)
from .nbjson import reads, writes, to_notebook
reads_json = reads
writes_json = writes
to_notebook_json = to_notebook
from .convert import downgrade, upgrade