gopherdata / gophernotes

The Go kernel for Jupyter notebooks and nteract.
MIT License
3.8k stars 264 forks source link

Add automatic HTML rendering in repl #168

Closed kesmit13 closed 5 years ago

kesmit13 commented 5 years ago

It would be nice if gophernotes would allow automated HTML rendering like Jupyter with Python. While the Python version uses special methods such as _reprhtml, a Go implementation would be more natural using interfaces. My proposed change would add an HTMLer interface with a method signature HTML() string. The renderResults function could then detect whether or not there were any HTMLers in the arguments and render a text/html key in the results as well as a plain/text.

cosmos72 commented 5 years ago

As discussed and agreed in issue #166, the change will be more exhaustive, and define an interface for each MIME type that gophernotes knows about - around 10 - plus multi-format interfaces.

See pull request https://github.com/gopherdata/gophernotes/pull/169