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

deprecate postprocessors #582

Open
minrk opened this issue May 5, 2017 · 10 comments
Open

deprecate postprocessors #582

minrk opened this issue May 5, 2017 · 10 comments

Comments

@minrk
Copy link
Member

minrk commented May 5, 2017

We've been slowly moving away from having postprocessors (PDFPostProcessor became PDFExporter), and before we get as far as adding new postprocessor features (#395), we should consider deprecating the concept of postprocessors entirely. nbconvert --post serve is the only existing postprocessor, and might be better turned into a dedicated nbconvert serve-slides entrypoint, so that re-rendering isn't required for serving. Plus, postprocessors don't run when used from the Python API.

#566, for instance, might be more logically implemented as a 'Writer', because its intent is to change what files are created, not create additional files, which is what a postprocessor would logically do.

@takluyver
Copy link
Member

👍 I think postprocessors were an overgeneralisation that we don't really need.

I'm not even entirely convinced that we need a general notion of 'preprocessors', as opposed to a collection of utility functions and options on exporters. But as there are quite a few of those, that would involve a much more invasive change.

@damianavila
Copy link
Member

damianavila commented May 8, 2017

+ 1 on the proposed change.

@nfultz
Copy link

nfultz commented May 25, 2017

I use postprocessors in nb2mail, please ping me if you deprecate postprocessors and let me know what I am supposed to use instead.

@takluyver
Copy link
Member

One possible alternative is to use a writer class - so sending the email would replace the stage where output is written to disk. Alternatively, you could create a separate nb2mail command line script which uses the nbconvert Python API and then does whatever you like with the returned data.

That's an interesting use case, though; maybe it indicates that we should think more carefully about this.

@t-makaro t-makaro added this to the 6.0 milestone Aug 2, 2019
@SylvainCorlay
Copy link
Member

I'm not even entirely convinced that we need a general notion of 'preprocessors', as opposed to a collection of utility functions and options on exporters.

I think that this is essentially what preprocessor became in 6.0.

On postprocessors, +1 to deprecate them.

@MSeal
Copy link
Contributor

MSeal commented Aug 20, 2020

I had taken a stab at this: #1289 -- but there was concerns around breaking existing usage. I'm still pro simplifying things but I think any significant change there would need to be post the 6.0 release unless we want it to delay that release substantially

@t-makaro
Copy link
Contributor

t-makaro commented Aug 20, 2020

We could remove postprocessors without any changes to preprocessors. I have seen a couple interesting use cases for postprocessors (when you don't want to make an exporter config option or template option it serves as a nice place for post conversion changes). However, I think that we either need to make better use of postprocessors or remove them.

Our only built in postprocessor is the ServePostProcessor.

@MSeal
Copy link
Contributor

MSeal commented Aug 20, 2020

True

@MSeal
Copy link
Contributor

MSeal commented Aug 21, 2020

Do we want to remove ServePostProcessor and cut to just PreProcessors? @maartenbreddels to get his input as well ?

@MSeal MSeal mentioned this issue Aug 24, 2020
4 tasks
@damianavila
Copy link
Member

Do we want to remove ServePostProcessor and cut to just PreProcessors?

I would be OK with that as long as we have something replacing what that postprocessor does...

nbconvert --post serve is the only existing postprocessor, and might be better turned into a dedicated nbconvert serve-slides entrypoint, so that re-rendering isn't required for serving

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

No branches or pull requests

7 participants