【发布时间】:2013-11-29 16:53:06
【问题描述】:
我想在 ipython 笔记本上添加一个新的工具栏按钮。我有一个很好的link 提到了这一点。
所以我创建了一个新文件:~/.ipython/profile_default/static/custom/custom.js,内容如下
$([IPython.events]).on('notebook_loaded.Notebook', function(){
IPython.toolbar.add_buttons_group([
{
'label' : 'run qtconsole',
'icon' : 'ui-icon-calculator', // select your icon from http://jqueryui.com/themeroller/
'callback': function(){IPython.notebook.kernel.execute('%qtconsole')}
}
// add more button here if needed.
]);
});
重启 ipython notebook 并加载 ipython 文档。 我可以在工具栏的右侧看到一个按钮。
这个问题是图标显示不正确。
但我想它应该看起来像 ui-icon-calculator。
ui-icon-calculator 可以在themeroller 找到,但我不确定是否需要将其下载到本地磁盘。
【问题讨论】: