ouseful-testing / nbsearch

Datasette based notebook search extension
MIT License
3 stars 1 forks source link

Load static assets (css / js) in Jupyter-server-proxy mode #3

Closed psychemedia closed 4 years ago

psychemedia commented 4 years ago

Additional static css and js files are successfully loaded in the command line server mode, but in the Jupyter proxy server the path is incorrect and the files are not loaded. A workaround hack replaces missing markdown and codestyling functions with an identity mapping.

Related datasette issue here and additional urls matters here.

psychemedia commented 4 years ago

A possible hack for now would be to have a path modifier that could prefix the linked notebook URL paths, entered via a textbox; and additional regex checkbox could allow the path modifier to be specified as a regular expression.

psychemedia commented 4 years ago

Currently doesn't work with MyBinder. Static link loads a <link rel="stylesheet" href="/-/static-plugins/nbsearch/prism.css"> which resolves to eg https://notebooks.gesis.org/hub/-/static-plugins/nbsearch/prism.css rather than required URL of form https://notebooks.gesis.org/binder/jupyter/user/ouseful-testing-nbsearch-0fx1mx67/nbsearch/-/static-plugins/nbsearch/prism.css

Related issue: https://github.com/simonw/datasette/issues/838

psychemedia commented 4 years ago

Seems to be resolved now?