spellchecker icon indicating copy to clipboard operation
spellchecker copied to clipboard

Overview/list of all mis-spelt words in the notebook/script

Open krassowski opened this issue 3 years ago • 5 comments

Sometimes I have long notebooks that I created a while ago. When I go back I sometimes spot errors, but it requires me to enter the markdown cell to see those. I would like to be able to see a summary of mis-spelt words somewhere to be able to navigate to those easily.

Design ideas:

  • something like the diagnostics panel from jupyterlab-lsp:
    • + intuitive, easy to navigate
    • - takes up space, the action of spellchecking entire notebook would be likely performed only once, not continuously as it happens with diagnostics
  • "list all typos" dialog window:
    • + only shows up when needed
    • - needs to be opened after fixing each typo, unless is complex enough that it can handle correction from the dialog, but might not be worth the effort
  • "list of typos" sidebar item:
    • could potentially be dismissible, as is the sidecar (extension)
    • + would not take too much space when not in use

The listing would ideally include:

  • the misspelt-word,
  • context (fragment of the sentence, e.g. +/-5 tokens from markdown cell)
  • an interaction allowing to scroll to appropriate place in the notebook/editor
  • a way to immediately choose a fix suggestion if available
  • a way to add the typo to ignored

krassowski avatar Apr 13 '21 22:04 krassowski

I fully agree, I have the same problem with the notebooks. Your solutions are well listed, but at the beginning, if we spot a misspelt word in the notebook, in your case the markdown cell is not in edit mode. Can we update the cell without open the cell for rerendering? I mean if we can do this, then I think a solution should be to have something like an interactive task which checks the notebook completely and then ask if a misspelt word should be changed or not like a normal text editor? I totally agree that the context is necessary and should be editable as well ;-)

ocordes avatar Apr 16 '21 11:04 ocordes

Good points.

in your case the markdown cell is not in edit mode. Can we update the cell without open the cell for rerendering?

the search & replace function in JupyterLab silently switches all Markdown cells to edit mode when it analyses notebook, and then keeps cells with matches in the edit mode. We could do the same in the interactive spellchecking task. Edit: to directly answer the question, yes I believe that we can also modify the cells whether they are in editing or rendering mode.

Another idea would be to modify markdown renderer to make it to highlight typos; I do not know how feasible it is, but I would like to be able to see these without entering the cell indeed.

krassowski avatar Apr 16 '21 11:04 krassowski

Oh, I never tested the search & replace function but this looks similar what I think one can use for the interactive spellchecking task. Highlighting typos in rendered cells sounds good, but for myself when I use a notebook during a lecture I don't want to have a highlight in the cell. I mean highlighting typos are good, but sometimes I have words which are spelled correctly but are not in the word list. Then the mark is somewhat annoying ...

ocordes avatar Apr 16 '21 13:04 ocordes

Highlighting typos in rendered cells sounds good, but for myself when I use a notebook during a lecture I don't want to have a highlight in the cell. I mean highlighting typos are good, but sometimes I have words which are spelled correctly but are not in the word list. Then the mark is somewhat annoying ...

I agree, if such functionality gets introduced it should be optional. We could also take care to turn it off in the presenter mode.

krassowski avatar Apr 16 '21 13:04 krassowski

As for the sidebar option and providing the context, I implemented something similar in jupyterlab-citation-manager extension.

krassowski avatar Jul 30 '21 20:07 krassowski