-
Notifications
You must be signed in to change notification settings - Fork 111
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
Separate writing from filter application in toJSONFilters #49
Conversation
To expand a bit, the reason we're doing this is that we're invoking pandoc from Python, and we've found performance is significantly better if we use pandoc twice (to json, from json) and apply the filter in process than if we run pandoc and get it to run the filter in a Python subprocess. This is probably because starting a Python process has a relatively large overhead. We still want to write the filters in a compatible way, so we adapted the code a little bit so that we can apply them to the output. |
Sensible! |
Thanks John! I see we just missed a release a couple of weeks ago - any idea when this is likely to go into a release so we can rely on it? |
I made some docstring updates, bumpde the version, +++ Thomas Kluyver [Nov 05 16 12:04 ]:
|
It looks good to me. I think @michaelpacer successfully ran our machinery with the code he added, but I'll let him confirm that. |
Apologies for the delay; yes, this seems to work on my end just fine 👍 |
I've uploaded the release. +++ Michael Pacer [Nov 08 16 14:56 ]:
|
Thanks @jgm ! |
Thank you @jgm! On Wed, Nov 9, 2016 at 3:07 PM, Thomas Kluyver notifications@github.com
|
This separates the current
toJSONFilters
functionality into two parts:toJSONFilters
(which maintains the previous API, writes to stdout, reads from stdin, and extracts command line arguments)applyJSONFilters
(which works on JSON strings, iterating through and applying the filters).This is needed to be able to use JSONfilters written for pandoc within an already existing python process (related to finding a solution to jupyter/nbconvert#11 with a particular application to be found at jupyter/nbconvert#458).
With help from @takluyver & inspiration from https://github.com/takluyver/bookbook.