[IPython-dev] Playing with cells in the notebook... and some problems.

Matthias BUSSONNIER bussonniermatthias@gmail....
Wed Aug 7 02:40:15 CDT 2013


Le 7 août 2013 à 07:23, Damián Avila a écrit :

> 
> Ah... if I "wrapinner", the cell is executed without problems, but I 
> need to wrap outer, I mean add html elements enclosing the current cell...

Cell object are attached to a DOM element, if yo wrap outer, you "change" this element
so the binding do not exist anymore.

it's  like this slight difference between (teleporting someone), and (cloning him and burn the original immediately)
from an outsider perspective it's the same.

You could probably re-attach cell.element to the wrapped tag, I think it is doable. But code mirror might also 
have some assumption on the DOM.

I don't quite remember how are cell inserted and everything, but I would try when wrapping to do 
	cell.to_json,
	create the sections 
	create n <div>
	cell.from_json on each of theses div.

-- 
Matthias


More information about the IPython-dev mailing list