更改 Jupyter notebook 版本 4.x+ 徽标

Change Jupyter notebook version 4.x+ logo

在IPython笔记本版本2.x中,您可以通过自定义文件夹添加徽标.ipython/profile_name/static/base/images/logo.png,它会在笔记本的页眉显示我们制作的自定义徽标。

在 Jupyter 笔记本版本 4.x 中,我们知道他们将目录移动到 .jupyter/,而不是 .jupyter/base/.jupyter/custom/custom.css。但是,当我尝试在 ~/.jupyter/base/images/logo.png 中自定义默认配置文件时,我无法再自定义徽标了。

问题是:如何在Jupyter notebook版本中自定义logo 4.x。我想知道是否有自定义 Jupyter notebook 徽标(版本 4.x)的解决方案。我把以前版本2.x自定义笔记本标志的示例截图放下面。

感谢@Eric 的评论(参考this post),这里是快速解决方案。首先,我将 logo.png 添加到 .jupyter/custom/logo.png 中。然后将以下行添加到 .jupyter/custom/custom.css 以加载徽标。

#ipython_notebook img{                                                                                        
    display:block;
    /* logo url here */
    background: url("logo.png") no-repeat;
    background-size: contain;
    width: 233px;
    height: 33px;
    padding-left: 233px;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

您还可以添加此 css 标签以增加徽标填充高度,方法是添加:

#ipython_notebook {
    height: 40px !important;
}

logo.png 添加到 .jupyter/custom/logo.png。然后将以下行添加到 .jupyter/custom/custom.css 以加载徽标。使用正方形尺寸时,我在使用 titipad 的 CSS 时看到了笔记本名称的偏移量。这修复了它。

    #ipython_notebook img{                                                                                        
        display:block;
        background: url(logo.png) no-repeat;
        background-size: contain;
        width: 33px;
        height: 33px;
        padding-left: 33px;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
    }

    #header-container {
        display: flex;
        justify-content: space-between;
    }

    span#login_widget {
        flex-grow: 1;
        order: 4;
        display: flex;
        justify-content: flex-end;
    }

    span#save_widget {
        flex-grow: 40;
    }