新的 ipython 笔记本模板 [英] New ipython notebook templating

查看:21
本文介绍了新的 ipython 笔记本模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以定义一些模板内容单元,所有新的 ipython 笔记本在创建时都包括在内?

我希望我的笔记本包含一些使用 您可以注入 javascript,这可能使向新笔记本添加默认内容成为可能.不过我还没有尝试过这个.

如果有兴趣,css 文件位于这里.monokai 颜色基于 .cm-s-ipython,我认为这与 sublime text 使用的类似.

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 .

解决方案

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:

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.

这篇关于新的 ipython 笔记本模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆