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
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
(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:
References
- Original post: Massively spellcheck Markdown files with Aspell on roneo.org
- Aspell's presentation on Wikipedia
- This post was inspired by vendelin.org
*Supported languages: Arabic, Breton, Esperanto, Kurdi, Quechua, Tamil, Swahili, Yiddish, Zulu, see the complete list
Top comments (0)