[IPython-dev] 2 questions about notebooks : disabling cells for edition and best hiding menu bar process

Matthias BUSSONNIER bussonniermatthias at gmail.com
Wed May 28 09:08:26 EDT 2014

Le 28 mai 2014 à 14:32, Benjamin Ninassi a écrit :

> Hello there, 
> It's a great work you're doing !
> I intend  to use notebooks for making exercices in a mooc and i have 2 questions for notebooks customizations :
> - is-it possible to "disable" the edition of some cells in browsers, maybe with some parameters in the json ? I'd like to get within a browser a notebook with some cells non-editable (instructions) et some cells editable (code for execution) but i can't find how to do this …

It should be possible by directly setting the read-only mode to some cell in CodeMiror itself, but it will require a bit of javscript:


> - i've tried to use the custom.js file to hide the top panel, doing :
> $([IPython.events]).on('notebook_loaded.Notebook', function(){
> $('div#header').hide()
> $('div#menubar').hide()
> IPython.layout_manager.do_resize();
> })
> but the panels appears quickly before hiding - not nice :/
> Is-there another way to do this where the panels that i want to hide don't show at all, or making a loading picture appears while the page is loading, and replace it when the page is completely loaded ?

I suppose css with the same target and display:none in custom.css should works.

> I can't find a list of the IPython.events ... or maybe by css ?

No, there is no list. You can grep through the source for IPython.events out should give yo an idea of existing event, 

The rest depend if when using IPython for a MOOC you will be providing the sever,in which case you can customize it a lot 
or if you plan on users to install IPython in which case you probably want to avoid too aggressive customization. 

> Thanks !
> Benjamin
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140528/38a168aa/attachment.html>

More information about the IPython-dev mailing list