-
Notifications
You must be signed in to change notification settings - Fork 83
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
👌 IMPROVE: Use configured nb_render_plugin
for glue nodes
#337
👌 IMPROVE: Use configured nb_render_plugin
for glue nodes
#337
Conversation
The cell output bundle should be rendered by the user's choice, instead of being hardcoded to the default renderer.
FYI, my extension is now publicly available on PyPI: https://pypi.org/project/myst-nb-bokeh/ and ReadTheDocs: https://myst-nb-bokeh.readthedocs.io/en/stable/ I'd appreciate a review of this PR so that I don't have to install MyST-NB from a branch in my fork 😄 Thanks! |
This seems a sensible request, boosting the signal 😉 |
It seems correct to make this configuration work like that. So if a plugin is used, is it meant to strictly extend the default behavior? Or is that environment variable expected to be set on a per notebook level or something? Maybe I'm not understanding how this particular extension point works well enough Also just an FYI the docs failures are because the Myst docs changed, not because of this PR, but we should fix that on master |
Codecov Report
@@ Coverage Diff @@
## master #337 +/- ##
=======================================
Coverage 87.35% 87.35%
=======================================
Files 12 12
Lines 1368 1368
=======================================
Hits 1195 1195
Misses 173 173
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
The way I interpreted the requirement for a plugin is that you have to provide a rendering function for all of the mimetypes that are present in your documents. Whether that comes by extending the built-in rendering class, or writing everything from scratch, is immaterial as long as all the mimetypes are handled. I'm not sure that's correct though. This setting is configured globally in
Thanks, that's what I figured based on the error message but good to have confirmation 😊 |
Renderers and thus this logic will be significantly changing soon (in https://github.com/executablebooks/MyST-NB/tree/refactor-mystnb). |
nb_render_plugin
for glue nodes
Pull request executablebooks/MyST-NB#337 was merged, but a new release hasn't been made yet.
Pull request executablebooks/MyST-NB#337 was merged, but a new release hasn't been made yet.
Pull request executablebooks/MyST-NB#337 was merged, but a new release hasn't been made yet.
In the process of creating an extension to render Bokeh outputs, I found that the CellOutputBundleNode was always using the default renderer. The fix is to set the renderer to the user-configured value.
I wasn't sure if a similar change should be made to the inline-type nodes.