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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to specify a jupyter widget which currently not published on npmjs.com #167

Open
omanges opened this issue Sep 22, 2020 · 11 comments
Open
Labels

Comments

@omanges
Copy link

omanges commented Sep 22, 2020

Hi, I am trying to build interactive documentation using jupyter-sphinx, but I am not able to view the output, following are the error I am getting, I think it ie because the widget is not published on npmjs.com 馃

image

@akhmerov
Copy link
Member

That's a tough one! We're using the jupyter widget machinery to render everything with the corresponding mimetype. So to see if you can influence that you should probably ask in the widgets repository.

Without interfering with widgets, I think you have the following options. If you have a non-widget way to render your data, you could serve data as a custom mimetype, and include the rendering javascript separately. Or you could return the html that includes the rendering code.

@omanges
Copy link
Author

omanges commented Sep 22, 2020

Is there no way to use locally installed jupyter widget extension, like I can install it locally and tell jupyter-sphinx to use it, rather than searching in npmjs.com ?

@akhmerov
Copy link
Member

You'd need to figure out two things:

  • How to modify the way the jupyter widgets resolve the extension code
  • How to package your extension together with the generated documentation

@omanges
Copy link
Author

omanges commented Sep 22, 2020

So what I thik is the call for npmjs.com is made by nbconvert while trying to execute the code cell.

@akhmerov
Copy link
Member

That you wouldn't see in your browser logs. Also the npmjs calls are made by the browser, and therefore are unrelated to nbconvert.

@omanges
Copy link
Author

omanges commented Sep 23, 2020

No, I was talking about who initiated it i.e the require.min.js 馃槄

@omanges
Copy link
Author

omanges commented Sep 23, 2020

@akhmerov jupyter-sphinx uses nbconvert to execute jupyter code right?

@akhmerov
Copy link
Member

Correct. To be more precise, it uses nbclient, the former nbconvert execute preprocessor.

@omanges
Copy link
Author

omanges commented Oct 14, 2020

It seems we need to set the data-jupyter-widgets-cdn as specified here https://ipywidgets.readthedocs.io/en/latest/embedding.html#the-case-of-custom-widget-libraries , but now the question is how can we set this from an rst file or Sphinx config 馃

@omanges
Copy link
Author

omanges commented Oct 14, 2020

Like we need to find how can we set the data-jupyter-widgets-cdn in the following script tag generated for documentation

<script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="here-map-widget" src="https://unpkg.com/here-map-widget@^0.1.0/dist/index.js"></script>

@12rambau
Copy link
Contributor

Hi @omanges is this issue still bothering you ? I'm a new maintainer of the repository and I try to find where I can be useful and where people have dropped the gantlet for a very long time.

Since 2020 did you publish your widgets on npm ? Did you managed to do it on your own ?

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

No branches or pull requests

3 participants