Accessing notebook metadata in template

27 views
Skip to first unread message

Eric Matthes

unread,
Jun 9, 2017, 1:57:02 AM6/9/17
to Project Jupyter
Once I've set a custom cell metadata property, I can access that property easily in a template:

{% if cell.metadata.get('my_property')... %}

I see that I can edit notebook metadata, but I can't figure out how to access that metadata in a template. This fails, because notebook is not defined:

{% if notebook.metadata.get("my_notebook_property")... %}

Is there a straightforward way to access notebook metadata in a template?

Eric Matthes

unread,
Jun 9, 2017, 2:11:51 AM6/9/17
to Project Jupyter
I just found it. 

{% if nb.metadata.get("my_notebook_property")... %}
Reply all
Reply to author
Forward
0 new messages