[sage-devel] Re: jsmol broken on JupyterHub

2018-02-20 Thread Kwankyu Lee


On Wednesday, January 27, 2016 at 12:47:58 AM UTC+9, Volker Braun wrote:
>
> It doesn't work right now; The kernel doesn't know whether it is running 
> under jupyter or jupyterhub.
>

After lots of trial and errors, I managed to make sagemath work under 
Jupyterhub. One cause of constant confusion was that these jsmol, threejs, 
mathjax are served at /nbextensions. These are not proper nbextensions in 
Jupyter notebook ecosystem, but just static files. I suppose the proper 
place to serve them is /static, like /static/jsmol,  

Fortunately we can use a Jupyter notebook option to serve /static from 
arbitrary directory that contains jsmol, threejs, and mathjax:

c.NotebookApp.extra_static_paths = ["/path/to/extra/static/files"]

I guess that with some changes mainly replacing "/nbextensions" to 
"/static",  sage 3d and interact outputs all would work fine. 

Jupyterhub serves static files at /hub/static, so it would be necessary to 
forward(alias) /static to /hub/static for sage 3d and interact outputs to 
work. 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: jsmol broken on JupyterHub

2016-01-26 Thread Volker Braun
It doesn't work right now; The kernel doesn't know whether it is running 
under jupyter or jupyterhub.



On Tuesday, January 26, 2016 at 10:44:33 AM UTC-5, Christoph Ruegge wrote:
>
> Hi.
>
> I'm trying to get the jsmol applet running on JupyterHub. I'm using 
> JupyterHub 0.3.0 (installed via pip) and Sage 6.10. The applet works nicely 
> in a locally running Jupyter, but inside JupyterHub, it fails. I tried to 
> "jupyter nbextension install" jsmol, without success.
>
> I did some searching, and it seems as if the jsmol nbextension, in 
> particular JSmol.min.js, is referenced via the path /nbextensions/jsmol 
> from e.g. script tags, which is fine for Jupyter, but for JupyterHub 
> probably needs to be prefixed with /user/$USER. Most requests under / 
> apparently get redirected to /hub, where the JupyterHub API resides, but 
> not the nbextensions. There is an option path_to_jsmol in the JSMolHtml 
> class which might be used for this purpose, but it is apparently not 
> properly set from backend_ipython.py.
>
> I would be grateful for any advice.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.