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

Extend cell metadata standards #3700

Open
mwouts opened this issue Jun 19, 2018 · 3 comments
Open

Extend cell metadata standards #3700

mwouts opened this issue Jun 19, 2018 · 3 comments

Comments

@mwouts
Copy link

mwouts commented Jun 19, 2018

The official documentation says that Metadata fields officially defined for Jupyter notebooks are (...) collapsed, autoscroll, deletable, format, name and tags.

In practice, it would be useful to have standard fields for, at least

  • hiding cell input (this conversation mentions hide_input, is that already a standard?)
  • hiding cell text output (and possibly, distinguish between printed messages, warnings and errors)
  • displaying raw output (i.e. what we can achieve currently with the Markdown display, cf here)

Note I am aware that the current way to apply the same filtering operation on all cells is with templates, but here I am asking for a cell specific filtering. Also, the same conversation explains how to use cell tags to then filter specific cells, but again I'm afraid tags there are not standard (yet?) neither.

@mwouts
Copy link
Author

mwouts commented Jun 21, 2018

There is a documentation on a jupyter extension that uses hide_input and hide_output metadata at http://jupyter-contrib-nbextensions.readthedocs.io/en/latest/nbextensions/runtools/readme.html. These cell metadata only become effective, however, when used with the conversion template hide_input_output.tpl.

I note that this is a very common demand. See also

@williamstein
Copy link

@jasongrout shared a bunch of relevant wisdom in comments here

I personally wish the editable metadata flag, which I guess some extensions (and nbgrader?) use, were also documented in the current official docs. Both Jupyter classic and JupyterLab do indeed prevent "editing" of the cell. But the meaning of "editing" a cell is ambiguous, which is why it would be nice to document a choice... since I am implementing this for CoCalc.com, and have to make a choice. For example, I did a quick check, and it seems to me that if a cell has {editable:false} then in Jupyter classic it cannot be deleted, but in JupyterLab it can be deleted. Which should I choose? (I'm choosing the Jupyter classic behavior, which seems more likely to be what end users expect, though it is less flexible.)

@haraldschilly
Copy link

IMHO it isn't a good idea to prevent deleting of cells that shouldn't be edited ... i.e. the jupyter lab behavior is more straight forward and has less surprises. That way, overall there are more options available.

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

3 participants