Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 400
Salvador Dali Avatar asked Sep 05 '16 04:09

Salvador Dali


People also ask

How do you highlight a word in Jupyter Notebook markdown?

Highlight Code If you want to highlight a function or some code within a plain text paragraph, you can use one backtick on each side of the text like this: `Here is some code!`

How do you highlight text in a Jupyter Notebook?

1 Answer. Show activity on this post. Then a button with a lightbulb icon will appear on your Jupyter notebook toolbar. Pressing that button will highlight the selected lines (or, if there is no selection, the current line) in the current code cell.

Does Jupyter Notebook have syntax highlighting?

Upon launching the notebook, there is syntax highlighting (I am guessing default syntax highlighting for Python). As soon as it connects to the Julia kernel, there is no syntax highlighting at all.

Is there Spell check in Jupyter Notebook?

It's also important to check spelling in projects, but there is no spell check in the default Jupyter Notebook setup. Extensions to the rescue! The Table of Contents (2) extension will add a table of contents based on notebook Markdown headings as a sidebar to your notebook.


2 Answers

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.

like image 156
Maged Saeed Avatar answered Nov 03 '22 20:11

Maged Saeed


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                      } }) 
like image 28
Tony Vincent Avatar answered Nov 03 '22 20:11

Tony Vincent