Reputation: 1469
Now ipython notebook could easily hide the output part of a cell by double clicking the left margin of the output. But I havn't figure out a way to hide the whole cell content.
Upvotes: 51
Views: 29454
Reputation: 14075
Yes! :) There now is one! :)
jupyter notebook extensions is a collection of extensions including, but not limited to:
The second one can be used to collapse jupyter notebooks on the headers, thus hiding entire sections of cells at once. I just found this and am currently (and probably for the next hour or so) thinking that this is the coolest invention, after sliced bread.
You can even install the whole bunch with a single anaconda command,
conda install -c conda-forge jupyter_nbextensions_configurator
This installs the extensions configurator which integrates them to jupyter and allows you to enable/disable them at will with a click.
Also, the following function should be available in the latest jupyter: triple clicking completely hides output The same happens if you press 'o' in the command mode: it hides the output of the cell in focus.
The jupyter I tried this on was:
Upvotes: 0
Reputation: 782
If you are running juptyter, then this is relevant: collapse cell in jupyter notebook
In my case, I like the hide_cost extension. Install as
pip3 install hide_code
Visit https://github.com/kirbs-/hide_code/ for more info about this extension.
Upvotes: 3
Reputation: 550
I spent a long time trying to get the codefolding extension to work with my setup, but I couldn't get it to work, even after trying many things including this stackoverflow suggestion. And I probably would have preferred that. However, I did find this page which talks about hiding code cells:
http://blog.nextgenetics.net/?e=99
I ended up putting this snippet in my custom.js and it worked perfectly:
Now under my 'View' menu, I have a 3rd option to 'toggle code cells'. It toggles to hide/show only the input, while always showing the output, which is what I'm looking for. State of toggle is not preserved across saving/reopening file as it would have been with codefolding
Upvotes: 1
Reputation: 11
I installed runtools and it works for me. You can fold one or all marked input cells.
https://github.com/ipython-contrib/IPython-notebook-extensions/tree/master/usability/runtools
Upvotes: 1
Reputation: 9044
hide_input_all extension will hide all input cell. and hide_input will hide the code cell that currently has the focus. my testing shows that all you need to do is loading the hide_input
extension.
IPython.load_extensions('usability/hide_input/main');
Upvotes: 2
Reputation: 329
I did that with jquery.
Upvotes: 2
Reputation: 2160
Not sure if this is still relevant but the following code folding extension may help:
https://github.com/ipython-contrib/IPython-notebook-extensions/wiki/Codefolding
Upvotes: 6