iracket icon indicating copy to clipboard operation
iracket copied to clipboard

Rendering HTML in cell output

Open lihebi opened this issue 5 years ago • 1 comments

The python kernel supports outputing HTML via the IPython.display module:

from IPython.core.display import display, HTML
display(HTML('<h1>Hello, world!</h1>'))

In Julia, one can do the same thing via (from this post):

display("text/html", "<script>alert('hello')</script>")

I see iracket already supported rendering images, but I'm not sure how it is implemented. Maybe expose some API for HTML rendering? My use case is to generate some file links for downloading.

lihebi avatar Aug 07 '20 09:08 lihebi

Here are some snippets that may be related:

https://github.com/rmculpepper/iracket/blob/d2ffb50c63a20df68a52359214697657eb9fb850/private/jupyter.rkt#L106-L124

https://github.com/rmculpepper/iracket/blob/d2ffb50c63a20df68a52359214697657eb9fb850/private/kernel.rkt#L133-L135

https://github.com/rmculpepper/iracket/blob/d2ffb50c63a20df68a52359214697657eb9fb850/private/kernel.rkt#L154-L174

lihebi avatar Aug 07 '20 09:08 lihebi