joouha / euporie

Jupyter notebooks in the terminal
https://euporie.readthedocs.io
MIT License
1.54k stars 36 forks source link

How to hide cell output? #35

Closed raffaem closed 1 year ago

raffaem commented 1 year ago

Sorry for the question here but I couldn't find a discussion section nor a IRC chat.

How can I hide the output of a cell?

joouha commented 1 year ago

Hi,

Do you mean toggling the visibility of the output of a single cell (like the "Collapse Selected Output" command in Jupyter Lab)? That's not currently supported, but should be fairly straight forward to implement - I'll add it to my to-do list.

You can clear the output of a cell by converting it to a raw cell (r) then converting it back to a code cell (y).

raffaem commented 1 year ago

Do you mean toggling the visibility of the output of a single cell (like the "Collapse Selected Output" command in Jupyter Lab)?

Yes, I meant that :)

That's not currently supported, but should be fairly straight forward to implement - I'll add it to my to-do list.

Thank you very much!

joouha commented 1 year ago

I've implemented this in a52d4b82fc59a75d2848dce67114f1aa1fd097aa, and it will be included in the next release.

You can now click on the cell's prompt areas to toggle the visibility of a cell's inputs / outputs, or used the "Expand / Collapse / Toggle cell inputs / outputs" commands from the command palette.

raffaem commented 1 year ago

Oh, thank you very much!

  1. Are there any keybindings for "Toggle cell input / output"?
  2. What the "Toggle expand" (mapped to W) is supposed to do?
  3. It takes a long time for the "Search for a command" window to show up every time I start euporie. It works correctly the 2nd- 3rd- etc. time I call it
joouha commented 1 year ago

You're welcome!

  1. I've not set a default key-binding for this, but it should be possible to configure a custom key-binding.

    The relevant commands are: show_cell_inputs, hide_cell_inputs, toggle_cell_inputs, show_cell_outputs, hide_cell_outputs, & toggle_cell_outputs

    If you can suggest something logical and suitable I might consider adding a default.

  2. Notebooks have a maximum display width (set by the max_notebook_width configuration variable). If your terminal is wide enough, the notebook will not exceed this width. If expand is set to True, the maximum notebook width limit will be ignored. This video demonstrates this:

    _toggle-expand.webm

  3. How long is it taking to open the command palette? Which operating system and version of Python are you using? I'm able to open the command palette almost immediately after first launch, so am a bit puzzled by this one.

raffaem commented 1 year ago

oh thanks for 1 and 2.

Opening a new issue for 3 :)