sagemathinc / cocalc

CoCalc: Collaborative Calculation in the Cloud
https://CoCalc.com
Other
1.17k stars 216 forks source link

sagews: render html code of objects with _repr_html_() #4127

Open haraldschilly opened 5 years ago

haraldschilly commented 5 years ago

e.g. in the code below, the ipython display object has a method _repr_html_(). If SageWS's display mechanism doesn't know what to do, it could check if that method exists and render the output as html.

from IPython.display import VimeoVideo, display
x = VimeoVideo('350941221', width=600, height=400)
html(x._repr_html_())

desired result: just VimeoVideo(...) should be enough to see it.

williamstein commented 5 years ago

WORKAROUND: Use a Jupyter notebook instead.