0

I'm working on a jupyter notebook (from a local installation of jupyterhub) that I want to be able to copy and distribute to my coworkers. Some of them are a little 'code-phobic' so I want to be able to portions of the code from them.

I can use the hide input extension to very prettily hide the code in my own notebook, however when I make a copy the cell meta-data for hide input reverts to "hide_input": false, and the code is all automatically visible.

Is there a way to keep cell meta data in the copying process?

I can find a lot of online discussions/documentation about keeping hide input functionality with nbconvert, however I don't want to convert to html because I still need the users to be able to actually run code.

Is there a way to use nbconvert to make a copy of a notebook and not actually convert it?

Thanks.

zarmin
  • 45
  • 4

2 Answers2

0

I'm confused - because for me cell metadata is preserved when copied. Are you sure you are actually saving the notebook after you have changed the cell metadata?

Regardless, you can use nbconvert to "convert" a notebook into a notebook; use the command:

jupyter nbconvert --to notebook --execute mynotebook.ipynb

From the docs: https://nbconvert.readthedocs.io/en/latest/usage.html#notebook-and-preprocessors

Louise Davies
  • 14,781
  • 6
  • 38
  • 41
0

If you use the Toggle selected cell input button or individually edit cell metadata the individual cell hide input status was not preserved. But when I used the Hide codecell inputs to hide the input of all the cells; then it was preserved after copying.

zarmin
  • 45
  • 4