DEV Community

Cover image for Massively spellcheck Markdown files with Linux and MacOS
Roneo.org
Roneo.org

Posted on Originally published at roneo.org

Massively spellcheck Markdown files with Linux and MacOS

Today I've learned how to spellcheck a batch of Markdown files with Aspell, a free software spell checker supporting more than 90 different languages*

This post was written for Debian and should work with any Linux flavour: Ubuntu, Linux Mint, ArchLinux, etc.

MacOS should also be supported, I didn't test it though.

1. Install aspell

Here with the english dictionnary:

sudo apt install aspell aspell-en
Enter fullscreen mode Exit fullscreen mode

A list of available dictionnaries can be found on gnu.org

2. Open a terminal

3. Navigate to the root of your project

4. Run the following command:

grep -rlP 'title:' content/ | xargs -o -n1 sh -c 'aspell check "$@" --master=en_US --lang=en_US  --sug-mode=slow -x --mode=markdown < /dev/tty' whatever
Enter fullscreen mode Exit fullscreen mode

(You may want to adjust --master=en_US --lang=en_US)

5. Browse the suggestions and apply with a single keystroke

Shortcuts and suggestions are shown at the bottom of the screen:

A screenshot of Aspell spellchecker with Markdown files

References

*Supported languages: Arabic, Breton, Esperanto, Kurdi, Quechua, Tamil, Swahili, Yiddish, Zulu, see the complete list

Top comments (0)