From a user:
It would be cool if papermill had an option to hide code cell input when generating an output notebook. This could be very helpful when generating a nightly report and not wanting to see the code that generates the report.
Simple enough. nteract uses metadata.inputHidden as a boolean value to indicate if a cell's input is hidden.
I suppose a flag like --hide-inputs or something? Maybe if we wanted to be more opinionated about the naming we'd call it --report-mode or --mode=report?
Thus far convergence on flag name is --report-mode.
This is functionality already built into nbconvert, on the command line
this would be the flag --TemplateExporter.exclude_input=True
On Fri, Apr 6, 2018 at 15:49 Kyle Kelley notifications@github.com wrote:
From a user:
It would be cool if papermill had an option to hide code cell input when
generating an output notebook. This could be very helpful when generating a
nightly report and not wanting to see the code that generates the report.Simple enough. nteract uses metadata.inputHidden as a boolean value to
indicate if a cell's input is hidden.I suppose a flag like --hide-inputs or something? Maybe if we wanted to
be more opinionated about the naming we'd call it --report-mode or
--mode=report?—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/nteract/papermill/issues/130, or mute the thread
https://github.com/notifications/unsubscribe-auth/ACXg6PMwKbxpov_ApmkpPyhf-zOluYpRks5tl_ENgaJpZM4TKzQT
.
I like --report-mode or --mode=report over --hide-input.
Can I take a stab at this?
Sure thing! Let us know how it is going and feel free to create a PR marked as "work in progress" as soon as you feel like you have something to share (even if it is a long way from being done).
Ok, thanks! Will do so.
Since we'll only have one mode to begin with, we should just call this --report-mode for now.
@cldssty since this is already a traitlet in nbconvert you could get away with adding a flag to the papermill jupyter app and setting the value of that nbconvert option (which I mention above).
Oh wait… this isn’t a JupyterApp… is there any reason why? Doing so would make a lot of the logic in the CLI a lot simpler and make it much easier to configure other jupyter parts like the kernel manager & nbconvert.
I _think_ it would be fine if this was a JupyterApp. We were happy with using click and weren't aware of the benefits of it being a JupyterApp.
Have made an attempt - please tell me what to add/change. Thanks!
Hi, I got a question about this feature. I run papermill like this: papermill --report-mode input.ipynb output.ipynb -p ... I expected that output.ipynb will have input cells hidden if I open it with the jupyter notebook but actually input cells (e.g. code cells) are not hidden. How is this flag supposed to work?
@OrKoN This feature was relatively new, all of the tools have adopted it except jupyter classic as far I know. I looked at the code involved there and kicked a comment in https://github.com/jupyter/notebook/issues/534 to see if we can get classic to also respect it soon.
Most helpful comment
This is functionality already built into nbconvert, on the command line
this would be the flag --TemplateExporter.exclude_input=True
On Fri, Apr 6, 2018 at 15:49 Kyle Kelley notifications@github.com wrote: