如何在 Chromium 的 Ubuntu 上增加 Jupyter notebook 中输入单元格的选定文本的突出显示?

How do I increase highlight for selected text of input cells in Jupyter notebook on Ubuntu in Chromium?

当我在 Chromium Ubuntu 上 select Jupyter Notebook 中输入单元格的文本时,我几乎看不到突出显示。像这样(突出显示“100”之后的所有内容):

在输出单元格上,我可以很容易地看到突出显示的文本(蓝色背景):

我该如何解决这个问题?当我几乎看不到我编辑的内容时,很难在输入单元格上进行复制粘贴编辑。selected。

按照以下步骤操作:

  1. 找到你的配置文件夹(我假设它是~/.jupyter
    import jupyter_core
    jupyter_core.paths.jupyter_config_dir()
    

    如果需要,您可以轻松找到 Windows 的对应目录。

  2. 创建一个文件夹 ~/.jupyter/custom,如果它不存在。 其他文件夹也可能有效 ()。

  3. 创建一个空文件~/.jupyter/custom/custom.css,如果它不存在。

  4. 添加

    .cm-s-ipython div.CodeMirror-selected {
        background: #859900 !important;
    }
    

    给你的custom.css。 使用合适的颜色。

  5. 在浏览器中重新加载您的笔记本,立即获得结果。

我通过从终端(不是 anaconda)加载 jupyter notebook 来解​​决,加载后,我在终端 window 中加载的执行文件中查找 .css,并找到样式文件。

文件名为style.min.css

/home/<user>/anaconda3/lib/python3.6/site-packages/notebook/static/style/style.min.css

ctrl + f 浏览文件和你的集合!

仅供参考,我的 jn 版本:

$ jupyter notebook --version
6.0.0