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

ipywidgets no longer rendering #458

Closed
ClementPinard opened this issue Nov 10, 2022 · 4 comments · Fixed by #491
Closed

ipywidgets no longer rendering #458

ClementPinard opened this issue Nov 10, 2022 · 4 comments · Fixed by #491
Labels
bug Something isn't working

Comments

@ClementPinard
Copy link

Describe the bug

expectation/bug
the ipywidget should appear in the docs, but doesn't

By looking at the issues history, seems like a recurrent problem, and it is back.

Ipywidgets no longer appear in rendered html pages, and you can actually see it in the official docs :

See it appearing for 0.16
https://myst-nb.readthedocs.io/en/v0.16.0/render/interactive.html#ipywidgets

And see it not appearing for 0.17
https://myst-nb.readthedocs.io/en/v0.16.0/render/interactive.html#ipywidgets

I can confirm for my own docs that 0.17.0 does not show ipywidgets

Interestingly, widgets do appear in the next page about inline code in the official docs, see https://myst-nb.readthedocs.io/en/v0.17.0/render/inline.html#inserting-different-output-types

Reproduce the bug

just building this repo doc will do I believe.

I also tried to build docs with 0.16 and it didn't work as well, contrary to online docs.

List your environment

Jupyter Book : 0.13.1
External ToC : 0.2.4
MyST-Parser : 0.18.1
MyST-NB : 0.17.1
Sphinx Book Theme : 0.3.3
Jupyter-Cache : 0.5.0
NbClient : 0.5.13

@ClementPinard ClementPinard added the bug Something isn't working label Nov 10, 2022
@welcome
Copy link

welcome bot commented Nov 10, 2022

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@agoose77
Copy link
Collaborator

Are you using _config.yml? Does the following addition to your configuration file work?

sphinx:
  recursive_update: true
  config:
    nb_ipywidgets_js:
        # Load RequireJS, used by the IPywidgets for dependency management
        "https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js": 
            "integrity": "sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA="
            "crossorigin": "anonymous"
        # Load IPywidgets bundle for embedding.
        "https://cdn.jsdelivr.net/npm/@jupyter-widgets/html-manager@*/dist/embed-amd.js":
            "data-jupyter-widgets-cdn": "https://cdn.jsdelivr.net/npm/"
            "crossorigin": "anonymous"

@ClementPinard
Copy link
Author

Hi, I suppose you are talking about jupyterbook ?

I didn't use it to build the docs, I used sphinx-build instead, using the conf.py in the docs folder. Should I do it another way ?

@agoose77
Copy link
Collaborator

Right - I was trying to determine whether you use JB or raw Sphinx.

nb_ipywidgets_js = {
   "https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js": {
      "integrity": "sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=",
      "crossorigin": "anonymous"
    },
    "https://cdn.jsdelivr.net/npm/@jupyter-widgets/html-manager@*/dist/embed-amd.js": {
      "data-jupyter-widgets-cdn": "https://cdn.jsdelivr.net/npm/",
      "crossorigin": "anonymous"
    }
}

Try this in your conf.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants