Skip to content

add javascript support #49

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

Merged
merged 2 commits into from
Jun 1, 2019
Merged

Conversation

basnijholt
Copy link
Contributor

@basnijholt basnijholt commented May 31, 2019

With this we can (for example) include HoloViews, Bokeh, or plotly plots in the docs.

This is already used in https://adaptive.readthedocs.io

With this we can (for example) include HoloViews, Bohek, or plotly plots in the docs.

This is already used in https://adaptive.readthedocs.io
@basnijholt basnijholt force-pushed the javascript_support branch from ab93087 to e18b555 Compare May 31, 2019 17:36
@akhmerov
Copy link
Member

Thanks!

There are really two parts to this PR:

  • How to include JS output if it ever appears. This is rather uncontroversial, and as far as I can tell looks good.
  • Making JS output the highest priority after widget type. This is user-controllable, so it cannot lead to dramatic failures (the users may specify a different priority if the default one doesn't suit their needs). On the other hand, the default behavior should be reasonable. I believe the main use for javascript output is pre-jupyterlab libraries injecting their javascript into the notebook after one calls something like init_notebook. This justifies making JS a high priority. This also matches the current behavior of nbconvert's HTML exporter.

Therefore I suggest to merge as is, but I'd like @SylvainCorlay's opinion—he dealt with JS in notebooks more than I did.

@SylvainCorlay
Copy link
Member

I believe the main use for javascript output is pre-jupyterlab libraries injecting their javascript into the notebook after one calls something like init_notebook.

Yeah, it is unfortunate that some packages like bokeh use javascript injection instead of relying on notebook extensions.

Plotly plots should already work with jupyter-sphinx without javascript output since plotly moved to using jupyter interactive widgets.

JavaScript injection pauses other issues. I am fine with adding it here since we can assume that the documentation content is trusted however I don't have an opinion on the precedence order.

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.

3 participants