jupyter / jupyter/nbformat

outputs_hidden vs collapsed metadata

Open
#137 17 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
313
Forks
176
PR merge metrics
No merged PRs in 30d

Description

I'm trying to implement the appropriate semantics for `collapsed`/`jupyter.outputs_hidden` metadata in JupyterLab.

The format docs seem ambiguous to me about the difference between the cell `collapsed` vs `jupyter.outputs_hidden` metadata.

In the [nbformat docs](https://nbformat.readthedocs.io/en/latest/format_description.html#cell-metadata), we have the following descriptions:

`collapsed`: Whether the cell’s output container should be collapsed
`jupyter.outputs_hidden`: Whether the cell’s outputs should be shown

In the discussion introducing `outputs_hidden` (https://github.com/jupyter/nbformat/pull/94), @ellisonbg mentions [the confusion](https://github.com/jupyter/nbformat/pull/94#issuecomment-309911943), and @rgbkrk and @damianavila mention in the next [two](https://github.com/jupyter/nbformat/pull/94#issuecomment-309945633) [comments](https://github.com/jupyter/nbformat/pull/94#issuecomment-310041620) that they view `collapsed` as essentially setting a small fixed height for the output, while `outputs_hidden` is completely hiding the outputs. (To me, the separate `scrolled` metadata is about setting a height for the outputs.)

How has this played out in practice over the last several years since the `outputs_hidden` field was defined? Classic notebook still only sets `collapsed`, and setting it hides the outputs, not just shortening them (`scrolled` metadata shortens the output region). As far as I can tell, the classic notebook doesn't recognize the `jupyter.outputs_hidden` metadata.

Does anyone else respect the `jupyter.outputs_hidden` metadata, or treat it differently from the `collapsed` metadata?

CC @rgbkrk, @mpacer, @ellisonbg

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.