This extension provides a filter to run Hunspell every time a .qmd
file is rendered and prints any misspellings to the console.
You must have Hunspell installed for this to run.
For Windows, the portable version from Chocolately seems to run well (choco install hunspell.portable
).
On Mac, you can install with Homebrew (brew install hunspell
).
From a directory with an existing Quarto file or project, run:
quarto add christopherkenny/spellcheck
This will install the extension under the _extensions
subdirectory.
If you're using version control, you will want to check in this directory.
Add the following to your metadata after installing as above.
filters:
- spellcheck
This will print to the console, something which looks like:
Possibly misspelled words:
--------------------------
consol
listd
spelld
--------------------------
The default language used is en_US
. This can be configured by setting:
spellcheck-lang: en_US
If you specify a spelling language which cannot be found by Hunspell, the program will error.
You can also specify words to ignore:
spellcheck-ignore:
- words
Note: This will create a file .spellcheck.txt
in the current directory which will be automaticaly removed, during normal functioning. If it fails during the Hunspell step, then you may need to remove that file.
Here is the source code for a minimal example: example.qmd.
The original Lua filter for pandoc is licensed under MIT from John MacFarlane. All modifications by me are licensed under the MIT license. See the license file for futher details.