-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(unstable): add Deno.jupyter.display API #20819
Conversation
f95a0e6
to
461903c
Compare
af2f2f7
to
d88fbec
Compare
Could you elaborate what do you mean by type information here? In general when new APIs are added then the type declarations shipped with Deno should be updated - the
Yes, I think we can do that with
We can add
Then in a test file you can do: |
I can update the type definitions. Are we not able to write typescript that would get transpiled and then included in the resulting Deno binary?
What's the best way for me to pass the execution count into the
Awesome, I'll do that. |
f297f24
to
be1771b
Compare
You can write TypeScript in internal code and it will get transpiled automatically, but for public APIs (think all
Create a CallArgument {
value: Some(Value::Number(execution_count)),
..Default::default()
} and pass it in |
796bddb
to
169dffc
Compare
cc @manzt -- bringing |
0a9b4f2
to
89b591f
Compare
Super exciting! Thanks for pinging me. Maybe there is a way anywidget could also integrate more deeply but for now I think it makes sense to keep the APIs in userland. |
The big piece we likely need for |
89b591f
to
5620747
Compare
b88b183
to
4c86bb5
Compare
133844e
to
c4e916c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, this is a fantastic functionality @rgbkrk 🚀
This brings in [`display`](https://github.com/rgbkrk/display.js) as part of the `Deno.jupyter` namespace. Additionally these APIs were added: - "Deno.jupyter.md" - "Deno.jupyter.html" - "Deno.jupyter.svg" - "Deno.jupyter.format" These APIs greatly extend capabilities of rendering output in Jupyter notebooks. --------- Co-authored-by: Bartek Iwańczuk <[email protected]>
This brings in
display
as part of theDeno.jupyter
namespace. I went ahead and hooked up ourexecute_result
handling to useDeno.jupyter.format
so that DataFrames, Canvas, and other objects can be displayed nicely (even without implementation in the respective libraries).cli/tsc/dts/lib.deno.unstable.d.ts