hypothesis / vision

Envisioning the future of the Hypothesis.
https://github.com/hypothesis/vision/issues/
40 stars 8 forks source link

Feature request: access to jupyter kernels from h #203

Open judell opened 8 years ago

judell commented 8 years ago

[transplanted from https://github.com/hypothesis/h/issues/2972 on behalf of https://github.com/jibe-b]

Hi there!

I love hypothes.is and I use it more and more. One feature would be great, beyond annotation: the possibility to run code inside the h sidebar.

For sure, it is already possible to paste code inside a h.is note and let people run it on their own computer. But the same way as jupyter notebooks enable to run code inside the document, it would enable to run code in the same annotation layer. It could then be used for academics to discuss a publication, or simply by fact-checkers.

Developing a plugin that would enable it would require to add a server-side dependency, of something like a fiddle. Another way (for a less broad audience unfortunately) would be to make h have access to the jupyter kernel, thus displaying the results of the calculation.

This is simply an idea of feature. If I find time, I may try to develop something like this myself.

By the way, I expect that there be javascript limitations that apply here. Are there any?

judell commented 8 years ago

That would be sweet. If you try this, please let us know how it goes! I know little (read: nothing) about Jupyter integration so can't comment on JS issues there.

Related to this, btw, we've imagined annotating Jupyter notebooks using selectors that know about the internal JSON format, vs the rendered HTML.

jibe-b commented 8 years ago

ok.

There is development done on an http API to communicate to the jupyter kernels : https://github.com/jupyter-incubator/kernel_gateway/issues/105

jibe-b commented 8 years ago

It seems that using the jupyter kernel gateway would make it almost straigth forward, at least for the development phase (say jupyter and h running on my server). So I will try in the next weeks (but don't expect it too quickly) and I may ask here if I reach a problem.

judell commented 8 years ago

may ask here if I reach a problem.

Please do! We're thrilled you are looking into this.

judell commented 8 years ago

Hi @jibe-b,

I was just scanning through various communications and saw this again. If/when you suss out what would be involved for Hypothesis and Jupyter to intertwingle their APIs, we would love to hear about it.