12

Is it possible to define some template content cells which all new ipython notebooks include when being created?

I'd like my notebooks to include some standard CSS using this method and possibly also have a markdown cell with links I'm frequently using .

Community
  • 1
  • 1
pandita
  • 4,739
  • 6
  • 29
  • 51
  • 1
    to include custom CSS in any notebook (new and old) the custom.css file can be used. – Jakob Nov 08 '13 at 23:38
  • @Jacob thanks for the pointer. Is there somewhere a description of the css classes? – pandita Nov 09 '13 at 04:46
  • You may check http://zulko.wordpress.com/2013/04/14/customize-your-ipython-notebook-with-css/ and http://www.reddit.com/r/Python/comments/1cbn2p/ipython_notebook_10_allows_custom_styling_with/ so far I'm not aware of any real documentation. – Jakob Nov 09 '13 at 08:09

1 Answers1

9

Thanks to @Jakob for the help.

To get permanent customised CSS within the notebooks, I needed to create <myprofile>/static/custom/custom.css in my .ipython user folder folder.

This worked quite ok. I used the firefox's webdev tools to find the css items and classes in the ipython notebook and managed to get a monokai-ish style:

ipython notebook with monokai style

I also learned from here that you can inject javascript which might make it possible to add default content to new notebooks. I haven't tried this one yet though.

Edit: if interested, the css file lives here. The monokai colors are based on .cm-s-ipython, which I think is similar what sublime text is using.

pandita
  • 4,739
  • 6
  • 29
  • 51