[IPython-User] _repr_html_ CSS and javascripts?
Matthias BUSSONNIER
bussonniermatthias@gmail....
Mon Aug 6 12:34:29 CDT 2012
Le 6 août 2012 à 19:22, reckoner a écrit :
> I'm happily using the _repr_html_ method in my object with basic HTML.
> Since I can't find any further documentation on this, can I use CSS
> styles and/or javascript in my renderings?
for javascript use _repr_javascript_
from IPython.display import Javascript
…
def _repr_js_(self) :
…..
js= Javascript(…)
return js._repr_javascript()
is the easiest.
QtConsole does not support Javascript, and
Javascript created element are not stored so not viewable when converting/reloading notebooks.
So having HTML fallback is always a good idea.
--
matthias
>
> Thanks!
>
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
More information about the IPython-User
mailing list