[IPython-dev] Hook to save a notebook

MinRK benjaminrk at gmail.com
Wed Apr 29 13:20:02 EDT 2015


On Wed, Apr 29, 2015 at 1:47 AM, Tony.Hirst <tony.hirst at open.ac.uk> wrote:

>
> >I have a toolbar button extension that zips up HTML  and ipynb versions
> >of the current notebook into a single zip file, but I would also like to
> >force the notebook to save and checkpoint when I initiate this action.
> >What do I have to call to force that action?
> ----
> >
> >IPython.notebook.save_checkpoint()
> >
> >-MinRK
>
>
> Thanks...
>
> I've also noticed that the js customisations don't always run, I think
> because of a reace between a call on $ and jquery loading?

I'm using
> chrome on os/x - and guess this is a cache issue?



custom.js is always run, regardless of caching. If there's a race, you
probably need to make sure you express your dependencies with
`require(['jquery', 'etc.'], function ($) { ... })` to ensure dependencies
are loaded before you try to use them.



> (I was also wondering
> whether the notebook load event is guaranteed to fire or can cacheing
> break that too?
>

No, the load event will always fire and will not be affected by caching.

-MinRK


>
> tony
>
> -- The Open University is incorporated by Royal Charter (RC 000391), an
> exempt charity in England & Wales and a charity registered in Scotland (SC
> 038302). The Open University is authorised and regulated by the Financial
> Conduct Authority.
> _______________________________________________
> 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/20150429/917f28fe/attachment.html>


More information about the IPython-dev mailing list