jupyterlab / jupyterlab

JupyterLab computational environment.
https://jupyterlab.readthedocs.io/
Other
14.23k stars 3.41k forks source link

Can't read custom.js #9191

Closed kwon14 closed 4 years ago

kwon14 commented 4 years ago

Hi.

Thank you for your hard work.

I'm using notebook and jupyterlab that the version is as follows. 'notebook=6.1.4' 'jupyterlab=2.2.8'

There are many other extensions in use.

I want to add a button on the left sidebar of Jupyterlab using custom.js. The referenced material was applied by looking at the guide below.

https://jupyter-notebook.readthedocs.io/en/latest/examples/Notebook/JavaScript%20Notebook%20Extensions.html#custom.js

To test with Exercise, after inserting the alert("hello world from custom.js") code in custom.js at the top, I restarted Jupyterlab Didn't work. https://jupyter-notebook.readthedocs.io/en/latest/examples/Notebook/JavaScript%20Notebook%20Extensions.html#Exercise-:

Ask where you need to look for custom.js to work.

Please answer, and always thank you. screen

jasongrout commented 4 years ago

Using custom.js is only for the classic Jupyter Notebook. For JupyterLab, currently, you need to write an JupyterLab extension. See the tutorial at https://jupyterlab.readthedocs.io/en/stable/developer/extension_tutorial.html for a generic tutorial, and https://github.com/jupyterlab/extension-examples for many more examples. For your specific case, you could modify the Astronomy Picture of the Day example to add the widget to the sidebar, changing app.shell.add(widget, 'main'); to app.shell.add(widget, 'right');

kwon14 commented 4 years ago

thx for answer me :)