IScala
IScala copied to clipboard
Support for Rich Output
Thank you for starting this exciting project.
I was wondering if iScala can be used to produce output that is not restricted to raw text?
The iPython framework supports many various formats.
At the very least, can iScala we used to produce Markdown, Latex, and/or HTML text?
Hi, I made some simple support in my fork: https://github.com/DocX/IScala
see README. Basically you can use raw_output(mime, string) built-in function that sends arbitrary output to ipy notebook. By that You can print raw HTML or use shortcuts for displaying images and so.
Was this something that could be merged in?
OK, so I finally implemented a preliminary version of display framework. You can see the results in https://github.com/mattpap/IScala/blob/master/examples/Display.ipynb. To get this working, you have to run the kernel with -m com.scalatags::scalatags:0.4.1,io.continuum.bokeh::bokeh:0.2-SNAPSHOT
to get the dependencies right (the above is equivalent to libraryDependencies ++= Seq(...)
and :
has the same meaning as %
in sbt).
Thank you for taking on the display work. I'm getting the exception below when I run line 6 ("
scala.reflect.internal.MissingRequirementError: object $line1.$display.$iw not found. scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:16) scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:17) scala.reflect.internal.Mirrors$RootsBase.ensureModuleSymbol(Mirrors.scala:126) scala.reflect.internal.Mirrors$RootsBase.staticModule(Mirrors.scala:161) scala.reflect.internal.Mirrors$RootsBase.staticModule(Mirrors.scala:21) org.refptr.iscala.Interpreter.runCode(Interpreter.scala:118) org.refptr.iscala.Interpreter.display(Interpreter.scala:162) org.refptr.iscala.Interpreter$$anonfun$10.apply(Interpreter.scala:206) org.refptr.iscala.Interpreter$$anonfun$10.apply(Interpreter.scala:206) org.refptr.iscala.Interpreter.withException(Interpreter.scala:97) org.refptr.iscala.Interpreter.loadAndRunReq(Interpreter.scala:206) org.refptr.iscala.Interpreter$$anonfun$interpret$1.apply(Interpreter.scala:236) org.refptr.iscala.Interpreter$$anonfun$interpret$1.apply(Interpreter.scala:236) org.refptr.iscala.Runner$Execution$$anonfun$1.apply$mcV$sp(Runner.scala:28) org.refptr.iscala.IOUtil$$anon$2.run(Util.scala:21) java.lang.Thread.run(Thread.java:745)
@paulomagalhaes, I presume you're a osx user? If so, there is an issue with case-sensitive class names. I will fix this soon.
@mattpap, thx for the quick reply. Yes I got this error on osx. I just tested on Linux and got the same error, though.
@paulomagalhaes, this should be fixed by now. If now, you should get at least a more meaningful error message.
@mattpap I tested and it is working. Thanks
@mattpap I'm doing some testing using IScala with Spark. The addition of the rich output is very helpful Thanks!