Skip to content
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
Merged

No input flag #825

merged 3 commits into from
Sep 4, 2018

Conversation

mpacer
Copy link
Member

@mpacer 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
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?

@mpacer
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
Copy link
Contributor

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
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 September 3, 2018 23:00
@mpacer
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.

Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants