HeinrichApfelmus / hyper-haskell

The strongly hyped Haskell interpreter.
Other
360 stars 24 forks source link

Add URL cells #12

Open ggreif opened 7 years ago

ggreif commented 7 years ago

These can probably modeled just like text cells. I have no idea whether the JS part supports URL-loading, though.

In the meantime I found a stop-gap solution for showing locally stored html/svg files:

import qualified Data.Text.IO (readFile)
import System.IO.Unsafe (unsafePerformIO)

readSVG = html . unsafePerformIO . Data.Text.IO.readFile

Then in an evaluation cell you can put readSVG "my.svg". The bad thing is that I have to re-evaluate those cells after opening the worksheet.

HeinrichApfelmus commented 7 years ago

I am not sure I understand. Could you describe in more detail what you mean by "URL cell"? The closest comparison I know is Mathematica, and I have never seen this concept there before.

ggreif commented 7 years ago

You create an URL-cell, enter http://wikipedia.org/some.svg and it appears in the displayed part as an image. For e.g. illustration purposes.

ggreif commented 7 years ago

Browsing a bit gave me webview

ggreif commented 7 years ago

I tried this and it (almost) worked:

import Data.Text
html $ pack "<webview src='https://rawgit.com/ggreif/omega/wiki/Letrec.svg'/>"

Working on better integration now.

ggreif commented 7 years ago

ggreif@7070b9c7d98d28392f3d384563d76fef64e7433d contains a glimpse of what I am implementing. Still missing: