[IPython-dev] notebook startup template (not exec_lines)

MinRK benjaminrk at gmail.com
Mon Sep 15 21:09:15 EDT 2014


There are two main places you can do this:

1. in custom.js, you can check if the notebook is empty on load, and add
the desired boilerplate.
2. subclass ContentsManager, and edit the code that makes a new notebook to
copy a template notebook you specify, instead of creating an empty one.

-MinRK



On Mon, Sep 15, 2014 at 9:21 AM, Thomas Kluyver <takowl at gmail.com> wrote:

> You can probably hack something to do it in custom.js, but we don't have
> any notion of a default template for new notebooks.
>
> Thomas
>
> On 15 September 2014 08:12, Andrew Jaffe <a.h.jaffe at gmail.com> wrote:
>
>> Hi all,
>>
>> Is there any way to automatically include some boilerplate cell or cells
>> in a notebook when it is created?
>>
>> I know that I can automatically run some commands with
>>     c.IPKernelApp.exec_lines = [...]
>> but I would actually like to have the code included in a cell (executed
>> or unexecuted) at the top of the notebook (so that users on other
>> machines can have the same code in their notebooks).
>>
>> I thought I saw a related question at some point recently, but I can't
>> find it.
>>
>> Andrew
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>
>
> _______________________________________________
> 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/20140915/b89ae9d6/attachment.html>


More information about the IPython-dev mailing list