[IPython-User] Start notebook with custom markdown code snippets as default?

Matthias BUSSONNIER bussonniermatthias@gmail....
Wed Nov 28 02:21:54 CST 2012


Le 27 nov. 2012 à 23:18, Norfeldt a écrit :

> Matthias Bussonnier wrote
>> If your goal is to inject Js in the notebook…. the custom.js is there to
>> do that,
>> And you could add button to the toolbar or add menu or...
>> And this without 'polluting' the ipynb file with preferences that might be
>> only yours.
>> -- 
>> Matthias
> 
> This is exactly what I want! 
> I don't know javaScript but have got a long way with copy pasting
> codesnippets together 
> 
> - What would be the easiest way to add a (or multiple) button(s) to the
> toolbar that calls a js script function ___________ ?

have a look at https://github.com/ipython/ipython/pull/2571  (js documentation)
I'll be happy o have feedback / corrections , more example.

Compiled version and the page you want would be here http://elacave.lmdb.eu/~carreau/yui/classes/IPython.customjs.html 


> 
> - Can anybody help me get started on a js script that toggles the Header off
> by default ____________ ?

$('div#header').hide()
IPython.layout_manager.do_resize();

Probably bound to 
'notebook_loaded.Notebook' event

so smth like

$([IPython.events]).on('notebook_loaded.Notebook', function(){
	$('div#header').hide()
	IPython.layout_manager.do_resize();
})

-- 
Matthias

> 
> 
> 
> 
> --
> View this message in context: http://python.6.n6.nabble.com/Start-notebook-with-custom-markdown-code-snippets-as-default-tp4997506p4997540.html
> Sent from the IPython - User mailing list archive at Nabble.com.
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20121128/6caa0f7f/attachment.html 


More information about the IPython-User mailing list