[fastpages] Hide code but show output?

@hamelsmu I thought I’d use some code to generate an Altair plot to illustrate a point for a new blog post, but I didn’t want to show the code because it wasn’t important, it was just there to ‘draw a picture’ for the illustration.

So I put #hide at the top of the code cell.
…And you probably know what happened: it hid both the code and the output plot. (I wasn’t expecting that.)

Is there any way to get it to show the output graph while hiding the code?

Thanks.

EDIT: it looks like #collapse-hide will leave the plot visibile but collapse the code. This is an acceptable ‘workaround’ as far as I’m concerned. If that’s the only way to do this, fine. But in case there’s a way to totally hide the code while leaving the plot, let me know! :slight_smile:

See the README https://github.com/fastai/fastpages#hide-inputoutput-cells

BTW there’s #hide_input in nbdev, and also the jupyter “hide input” extension, which nbdev respects. Both will handle this request.

3 Likes

I didn’t know about this! I’ll add to the docs and examples

1 Like

Update: I have updated the documentation for fastpages to include this as well as other features via https://github.com/fastai/fastpages/pull/148

2 Likes

Thanks gentlemen. I read the README but for some reason I didn’t see the #hide_input. It’s quite clear in the latest version of Hamel’s docs.