RISE icon indicating copy to clipboard operation
RISE copied to clipboard

Hide magic lines in slides?

Open abingham opened this issue 9 years ago • 7 comments

Would it be possible (or is there already a way) to hide magics in slides? For example, I'm using ipytest to demo pytest in a notebook slideshow, and all of my demo slides look like:

%%run_pytest -q --disable-pytest-warnings

def test_something():
    . . . blah blah blah . . .

The magic has to be in each cell for them to function, but it also clutters up the slides and feels unnecessary. So I'd like it if there were some way to hide the magic slides.

Perhaps there's some CSS trick I could use, and that would be perfectly fine. But if not, and if it wouldn't be too hard to add to RISE, I think it would be a great addition.

abingham avatar Jan 04 '17 18:01 abingham

Since the magic is in the cell content, I don't see an easy way to hide it. We could eventually think in some kind of workaround but not sure how valuable would be this "hide" option for others, so a native solution would have a low priority, I guess...

damianavila avatar Jan 05 '17 15:01 damianavila

I would agree that hiding all magics in all cells would be going a little too far, as there are many cases where removing them could create confusion for readers

parmentelat avatar Jun 15 '17 03:06 parmentelat

there are many cases where removing them could create confusion for readers

I completely agree. If there's any support for hiding magic, it should be optional and off by default.

abingham avatar Jun 15 '17 06:06 abingham

Is there any progress on hiding cells from a presentation but still running them?

ziyuang avatar Sep 21 '23 23:09 ziyuang

within nbclassic there are - or at least there used to be - a hide-input extension that allowed to declare a cell as 'hide-input' through its metadata; the output area would still show up, which IIUC is what you're trying to achieve I remember having used this already within rise slideshows, and I expect it should still work; I don't remember the actual details though...

parmentelat avatar Sep 22 '23 07:09 parmentelat

within nbclassic there are - or at least there used to be - a hide-input extension that allowed to declare a cell as 'hide-input' through its metadata; the output area would still show up, which IIUC is what you're trying to achieve I remember having used this already within rise slideshows, and I expect it should still work; I don't remember the actual details though...

Do you mean Hide all Input?

ziyuang avatar Sep 22 '23 08:09 ziyuang

no I was meaning this one: https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/nbextensions/hide_input/readme.html

parmentelat avatar Sep 22 '23 10:09 parmentelat