Highlight typos in the jupyter notebook markdown

When I write something in the jupyter notebook markdown field, the typos are not highlighted and often I ended up with something like this:

enter image description here

In almost all IDEs I have used so far, the typos are highlighted with a curly underline which was very convenient for me. Something like this:

enter image description here

Up till now I have not found anything that allows me to see this type of highlights. Does it exist?


Solution 1:

The popular Jupyter Notebook bundle extension from Jupyter-contrib contains a spell checker. You can install and enable this (with admin privileges) like so:

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

This may be the most popular spell checker for Jupyter Notebooks, but note that it simply highlights words not in its dictionary, and does not offer corrections.

If the extension installed properly, you will see this message in the command line:

enter image description here

Now, in the browser, after opening Jupyter, you will see the button labelled "abc" beside the keyboard button, which you can toggle to enable/disable spell check:

enter image description here

The jupyter-contrib library has many other useful modules such as code folding and table of contents.

Solution 2:

Run the following in a terminal:

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

You can see typos like enter image description here Find out more

Afterwards, you need to activate the spell check in the Jupyter Notebook:

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

Solution 3:

The spellchecker and some other extensions from jupyter_contrib_nbextensions is incompatible with the ipython version 5.8.0. and later. (Found that it works in some cases for the version 5.0.0 [refer issue page of the same]. I'm not aware of its compatibility for the ipython versions between 5.0.0. to 5.8.0., please do comment if anyone knows). The calico's nbextension 'spellchecker' available at https://bitbucket.org/ipre/calico/downloads/calico-spell-check-1.0.zip is an outdated version [dated 2015]. But calico had updated their nbextensions and made avaliable at the github repository [latest dated 2018]. It works fine for the ipython version 5.8.0.

Installation

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

jupyter nbextension install calysto --user

jupyter nbextension enable calysto/spell-check/main

Check its status:

jupyter nbextension list

When you now open or reload a notebook, there would be a new button visible with a check mark icon next to the button to open the command palette. You may click on it to check the spelling mistakes in the markdown cell.