Highlight typos in the jupyter notebook markdown

后端 未结 3 820
孤街浪徒
孤街浪徒 2020-12-13 06:19

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

In almost all ID

相关标签:
3条回答
  • 2020-12-13 06:37

    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.

    0 讨论(0)
  • 2020-12-13 06:46

    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:

    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:

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

    0 讨论(0)
  • 2020-12-13 06:46

    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 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
                         }
    })
    
    0 讨论(0)
提交回复
热议问题