ipython-contrib / jupyter_contrib_nbextensions

A collection of various notebook extensions for Jupyter
http://jupyter-contrib-nbextensions.readthedocs.io/en/latest
Other
5.24k stars 807 forks source link

Add spell checker #521

Closed jankatins closed 8 years ago

jankatins commented 8 years ago

This project seems to implement a spell checker without the need to use a local server: https://github.com/NextStepWebs/codemirror-spell-checker

Their quickstart looks easy to integrate (though I have no clue how to hock that into the current codemirror startup in the notebook).

Seems to be en_US only for now: https://github.com/NextStepWebs/codemirror-spell-checker/blob/master/src/js/spell-checker.js#L15 :-(

jankatins commented 8 years ago

There is also this here: https://github.com/codemirror/CodeMirror/issues/1017#issuecomment-52249542 and then https://github.com/codemirror/CodeMirror/blob/a196861f9a44db63f946bbe68119f8ab903f3bd5/doc/manual.html#L365

<dt id="option_inputStyle"><code><strong>inputStyle</strong>: string</code></dt>
      <dd>Selects the way CodeMirror handles input and focus. The core
      library defines the <code>"textarea"</code>
      and <code>"contenteditable"</code> input models. On mobile
      browsers, the default is <code>"contenteditable"</code>. On
      desktop browsers, the default is <code>"textarea"</code>.
      Support for IME and screen readers is better in
      the <code>"contenteditable"</code> model. The intention is to
      make it the default on modern desktop browsers in the
      future.</dd>

If I read that right, then there is a second codemirror way and that way has spell checking?

juhasch commented 8 years ago

There is the Calysto one here: https://github.com/Calysto/notebook-extensions Also, it looks like the language files used by NextStepWebs can be imported from other spell checkers, i.e. there are other languages available.

jcb91 commented 8 years ago

I've started making something based loosely on the NextStepWebs one (which uses typo.js for the actual spell-checking, then, incidentally, defines a CodeMirror overlayMode in a very similar way to the Calysto one, which uses a json object as a wordlist for spell-checking). It has configurable urls for the dictionaries, so you can use others, they're hunspell-style dictionaries. There are some comments in various places that typo.js doesn't cope very well with accents though, I think...

jcb91 commented 8 years ago

see #530

juhasch commented 8 years ago

Obsolete, we now have a spellchecker extension.