Open jtpio opened 2 years ago
- There is still this issue to fix: https://github.com/jupyterlab/jupyterlab/issues/11531
Looks like the client code does not have access to that header:
@yuvipanda probably the nbss server should expose the Access-Control-Expose-Headers
header?
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers
@jtpio this has been deployed, can you try again?
Just tried with the following snippet locally:
<!DOCTYPE html>
<html>
<body>
<script>
(async function () {
const response = await fetch('https://notebooksharing.space/api/v1/notebook/5533e15101253d29023833f671a3e5c8ecf6a56946ab7e34b19e940eff2cf94d');
const contentType = response.headers.get('content-type');
const contentDisposition = response.headers.get('content-disposition');
console.log({contentType, contentDisposition});
}())
</script>
</body>
</html>
Looks like the header is not part of the response headers?
Hey there - I am fascinated with the possibilities of this integration - and would love to know how hard it would be to make this happen. You guys are amazing!
Apparently today was the day. Who chooses what day what work gets done on? Not me, apparently.
Anyway, there's now an 'open in jupyterlite' button on all notebooks! https://notebooksharing.space/view/39c6004af2056337fe6304f719c3c7c4883551cf89843eafdfe4a52d7d74f9e8#displayOptions= for example, has this:
Clicking that will take you to https://notebooksharing.space/jupyterlite/lab/?fromURL=/api/v1/notebook/39c6004af2056337fe6304f719c3c7c4883551cf89843eafdfe4a52d7d74f9e8/hls_applications_example(1).ipynb, which works as you would expect (yay).
It's stuck in JupyterLab 3.x, until https://github.com/jupyterlab-contrib/jupyterlab-open-url-parameter/pull/11 can be merged.
There are no pre-installed python packages though, and I'll probably keep it that way.
Thanks to @jtpio for https://github.com/jupyterlab-contrib/jupyterlab-open-url-parameter, which was an important part of this :)
Once we move to jupyterlab 4.0, I'll have notebook 7 and lab as options, and default to notebook 7.
I'm just adding ipywidgets so they would work. But I don't wanna add too much though.
cc @yuvipanda as a follow-up to the conversation started on another channel
It would be nice to have a button to open a notebook in JupyterLite, for example:
Listing a couple of ideas here on how this could work. Probably the main challenge would be fetch the content from the nbss storage. The simplest for now might be:
memoryStorageDriver
: https://jupyterlite.readthedocs.io/en/latest/configuring.html#local-storage-drivers