https://github.com/christopherkenny/spellcheck
A Quarto filter to print misspelled words to the console using Hunspell
https://github.com/christopherkenny/spellcheck
quarto quarto-extension quarto-filter quartopub
Last synced: about 1 year ago
JSON representation
A Quarto filter to print misspelled words to the console using Hunspell
- Host: GitHub
- URL: https://github.com/christopherkenny/spellcheck
- Owner: christopherkenny
- License: other
- Created: 2024-08-05T13:38:31.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-19T03:45:06.000Z (about 1 year ago)
- Last Synced: 2025-03-19T04:29:06.856Z (about 1 year ago)
- Topics: quarto, quarto-extension, quarto-filter, quartopub
- Language: Lua
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# spellcheck Extension For Quarto
This extension provides a filter to run [Hunspell](https://hunspell.github.io/) 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](https://community.chocolatey.org/packages/hunspell.portable) seems to run well (`choco install hunspell.portable`).
On Mac, you can install with Homebrew (`brew install hunspell`).
## Installing
From a directory with an existing Quarto file or project, run:
```bash
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.
## Using
Add the following to your metadata after installing as above.
```yaml
filters:
- spellcheck
```
This will print to the console, something which looks like:
```bash
Possibly misspelled words:
--------------------------
consol
listd
spelld
--------------------------
```
The default language used is `en_US`. This can be configured by setting:
```yaml
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:
```yaml
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.
## Example
Here is the source code for a minimal example: [example.qmd](example.qmd).
## Licensing
The original Lua filter for pandoc is licensed under MIT from [John MacFarlane](https://github.com/pandoc/lua-filters/blob/master/spellcheck/spellcheck.lua).
All modifications by me are licensed under the MIT license.
See the [license file](LICENSE) for futher details.