突出显示jupyter笔记本降价中的拼写错误

时间:2016-09-05 04:41:29

标签: jupyter jupyter-notebook

当我在jupyter notebook markdown字段中写一些东西时,拼写错误没有突出显示,我经常得到这样的东西:

enter image description here

在我到目前为止使用的几乎所有IDE中,拼写错误都以粗体下划线突出显示,这对我来说非常方便。像这样:

enter image description here

到目前为止,我还没有发现任何可以让我看到这种类型的亮点。它存在吗?

3 个答案:

答案 0 :(得分:40)

流行的Jupyter Notebook软件包extension from Jupyter-contrib包含spell checker。您可以安装并启用此功能(具有管理员权限),如下所示:

pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
jupyter nbextension enable spellchecker/main

这可能是Jupyter Notebooks最受欢迎的拼写检查程序,但请注意,它只是突出显示不在其词典中的单词,并且不提供更正。

如果扩展安装正确,您将在命令行中看到此消息:

enter image description here

现在,在浏览器中,打开Jupyter后,您将看到标有" abc"的按钮。在键盘按钮旁边,您可以切换以启用/禁用拼写检查:

enter image description here

jupyter-contrib库还有许多其他有用的模块,例如code foldingtable of contents

答案 1 :(得分:3)

在终端中运行以下命令:

ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-spell-check-1.0.zip
ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-document-tools-1.0.zip
ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-cell-tools-1.0.zip
jupyter nbextension enable calico-spell-check

你可以看到错字 enter image description here 找出more

之后,您需要在Jupyter笔记本中激活拼写检查:

%%javascript
IPython.notebook.config.update({
  "load_extensions": {"calico-spell-check":true,
                      "calico-document-tools":true,
                      "calico-cell-tools":true
                     }
})

答案 2 :(得分:1)

来自jupyter_contrib_nbextensions的拼写检查器和其他一些扩展与ipython version 5.8.0.及更高版本不兼容。 (发现它在某些情况下适用于version 5.0.0 [请参见相同的问题页面]。我不知道它与5.0.0.5.8.0.之间的ipython版本的兼容性。如果有人知道,请发表评论)。 可在https://bitbucket.org/ipre/calico/downloads/calico-spell-check-1.0.zip获得的calico的nbextension'spellchecker'是一个过时的版本[日期为2015]。但是calico已更新了其nbextensions,并在github repository [于2018年最新发布]中可用。它适用于ipython version 5.8.0

安装

git clone https://github.com/Calysto/notebook-extensions.git
cd notebook-extensions

jupyter nbextension install calysto --user

jupyter nbextension enable calysto/spell-check/main

检查其状态:

jupyter nbextension list

现在打开或重新加载笔记本时,将显示一个新按钮,该按钮旁边带有复选标记图标,以打开命令面板。您可以单击它来检查降价单元格中的拼写错误。