Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement an "invisible" cell tag, or metadata attribute #142

Open
ehmatthes opened this issue May 25, 2017 · 1 comment
Open

Implement an "invisible" cell tag, or metadata attribute #142

ehmatthes opened this issue May 25, 2017 · 1 comment

Comments

@ehmatthes
Copy link
Owner

There are some cells that are required for the .ipynb file to work in development, but shouldn't be shown to the end user. For example, there are some cells that need to have a resources/ directory added to the path variable for imports to work:

# This needs a "hidden" attribute in cell metadata.
import os, sys
cwd = os.getcwd()
resources_path = os.path.join(cwd, 'resources')
if resources_path not in sys.path:
    sys.path.append(resources_path)

This kind of cell needs either an invisible tag or cell metadata attribute, so it can be removed when the notebook is converted to html. This is distinct from hidden, which the user can toggle. For example, cell output can be toggled by the user.

@ehmatthes
Copy link
Owner Author

From a comment:

#   These cells can be ignored in the template.
#   {% if cell.tags contains invisible %}
#     {# don't include cell #}
#   {% else %}
#     {{ super() }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant