From 6291215ff475bce1c628f6a219cdeacab02fa5e4 Mon Sep 17 00:00:00 2001 From: eviau-artefactual Date: Wed, 8 May 2024 15:23:15 -0400 Subject: [PATCH] setting up spellchecking as a test in github --- .github/workflows/test.yml | 1 + Makefile | 5 +++++ conf.py | 10 ++++++++++ requirements.txt | 1 + 4 files changed, 17 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 63f0fa96..bf06d553 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,6 +29,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt + sudo apt-get install -y hunspell-en-ca hyphen-en-ca - name: "Run build test" run: | make test diff --git a/Makefile b/Makefile index 808bd852..0d2c8af8 100644 --- a/Makefile +++ b/Makefile @@ -224,6 +224,11 @@ dummy: @echo @echo "Build finished. Dummy builder generates no files." +spelling: + $(SPHINXBUILD) -b spelling $(ALLSPHINXOPTS) $(BUILDDIR)/spelling + @echo + @echo "Build finished. The spelling files are in $(BUILDDIR)/spelling." + .PHONY: test test: $(MAKE) html ALLSPHINXOPTS="-W --keep-going -n ." diff --git a/conf.py b/conf.py index 047b12aa..93a93ecd 100644 --- a/conf.py +++ b/conf.py @@ -36,8 +36,18 @@ extensions = [ 'sphinx.ext.extlinks', 'sphinx.ext.intersphinx', + 'sphinxcontrib.spelling', ] +# Spellchecking + +spelling_lang="en_CA" +tokenizer_lang="en_CA" + +spelling_word_list_filename = ['spelling_wordlist.txt'] + +spelling_show_suggestions=True + # Obtain intersphinx_mapping inventory = 'https://gist.githubusercontent.com/qubot/2dd2f7f96e51121061d4/raw/sphinxdoc-inventory.json' response = urlopen(inventory) diff --git a/requirements.txt b/requirements.txt index 6966869c..92ce4f80 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ sphinx +sphinxcontrib-spelling