New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No input flag #825

Merged
merged 3 commits into from Sep 4, 2018

Conversation

Projects
None yet
4 participants
@mpacer
Copy link
Member

mpacer commented Jun 5, 2018

This adds a new --no-input as talked about in few places. This removes prompts and input areas, leaving only the outputs.

This also adds a new test for this feature and removes some of the warnings and extraneous printing that was being done in our tests.

@t-makaro

This comment has been minimized.

Copy link
Contributor

t-makaro commented Jul 3, 2018

I believe exclude_input=True does take out the input prompt with it since it removes the whole block, so having exclude_input_prompt=True seems redundant. I also don't see how a custom template could overwrite that behaviour. I'm not complaining. Really, I just want to make sure that my templates have the expected behaviour.

Also, for symmetry, should there be a --no-output?

@MSeal MSeal referenced this pull request Jul 25, 2018

Merged

Add option for hiding input #135

@mpacer

This comment has been minimized.

Copy link
Member Author

mpacer commented Aug 23, 2018

@t-makaro

Yes you're right it is redundant.
A custom template would need to override the null.tpl itself… which is definitely a bizarre anti-pattern that we shouldn't be coding for.

In theory we could include a --no-output flag… but I'm somewhat opposed. Our CLI is already pretty bloated, and I don't think anyone has actually asked for that (since there is always the ClearOutputPreprocessor that can be enabled).

For historical context:
A lot of this functionality was introduced because you couldn't implement a Preprocessor for removing input because then it would not be a valid notebook file. This comes from our constraint that Preprocessors are notebook → notebook transforms… which is one of the cleanest constraints we've got in nbconvert.

@t-makaro

This comment has been minimized.

Copy link
Contributor

t-makaro commented Aug 23, 2018

I was under the impression that the ClearOutputPreprocessor actually overwrote the file. Though I think that only the --clear-output flag does that (since it defaults to inplace if I'm not wrong). So, long as there is a way to convert to another format without outputs and without clearing the original notebook file of outputs then --no-output really isn't needed.

I've definitely seen people ask for no input for generating reports. I personally don't see myself using either no-input or no-output.

@MSeal

This comment has been minimized.

Copy link
Contributor

MSeal commented Aug 26, 2018

--no-input has a lot of value for reporting purposes. If someone wants outputs hidden for this we can always discuss it in a new issue / pull request

@mpacer mpacer requested review from MSeal and blink1073 Sep 3, 2018

@mpacer

This comment has been minimized.

Copy link
Member Author

mpacer commented Sep 3, 2018

So I'd like to see this in 5.4 if we're going to be doing the release and there seems to be agreement that this is a good feature that people have been asking for for some time.

@blink1073
Copy link
Member

blink1073 left a comment

LGTM, thanks!

@MSeal

MSeal approved these changes Sep 4, 2018

@MSeal MSeal merged commit 8b47cf1 into jupyter:master Sep 4, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@mpacer mpacer added this to the 5.4 milestone Sep 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment