How to embed an interactive Jupyter notebook into html?

假如想象 提交于 2019-12-05 04:47:10
Jaime

To embed the Jupyter environment, you may consider to use an iframe.

  • Note that current browsers require correct configuration of the Content Security Policy (CSP) of your applications (your custom-Jupyter) to run.
  • You can activate the Developer's console in your browser (e.g. in Chrome) to check the CSP errors that may occur.
  • There are two issues (the one and the other) in Github which responses show you how to deal with that configuration.

To read and store your notebooks in Github, you probably need to check other projects such as mybinder and Everware, and/or modify the source code of your custom-Jupyter.

  • You may check a "cost estimation" example using mybinder. The mybynder is configured to show an specific Github repository. It starts a docker single-user Jupyter server and shows an interactive session in your browser. There are other examples here and here.
  • The source code of mybinder is in Github
  • I think you may consider the Everware project (in beta at this moment) too. The source code is in Github.

You cannot.

  • Either the user view a static version as static html (you can host it anywhere a static site host is provided), or
  • let the user access the JupyterHub services directly.

This could be done. If the kernel of Jupyter (e.g. Python) can be interpreted by JavaScript. Then the user could have evaluate the code via their web browser. However Jupyter does not offer this feature yet.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!