[IPython-dev] "Freezing" dynamic content with nbconvert, was ANN: Exhibitionist
Thu Mar 7 10:48:51 CST 2013
I've been giving matthias's comment some thought re nbviewer support
due to security-concerns.
Here is a solution to both issues that I'd like to suggest:
There's a need to separate static HTML from HTML bearing
My suggestion is that the display protocol be modified so that the semantics of
`_repr_html_` would mean static HTML only, and a new `_repr_jshtml_` (however named)
magic method would be supported, under which objects would implement
This provides the following benefits:
- Objects can provide HTML representation of themselves suiting
the environment they are in. It's the front end that chooses the
representation it supports. So there will be no further need to sniff
qtconsole vs. IPNB via `get_ipython().config`.
In particular, nbviewer could leverage this to allow even dynamic views
to gracefully degrading in order to cooperate.
- For security reasons, the use of '_repr_jshtml_' view by IPYthon would be behind
an opt-in mechanism, and the static `_repr_html_` would be sanitized/sandboxed.
The IPython.core.display functions could be extended accordingly to
obey the currently active security policy.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev