Skip to content

Commit 5ad94a9

Browse files
committed
Add configuration for Sphinx Spelling checker
This is an optional extension that checks for spelling better than the system spell.
1 parent 6890554 commit 5ad94a9

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ images: $(PDFs)
6363
clean:
6464
rm -rf $(BUILDDIR)/*
6565

66+
.PHONY: spelling
67+
spelling:
68+
SPHINX_SPELL=1 $(SPHINXBUILD) -b spelling $(ALLSPHINXOPTS) $(BUILDDIR)/spelling
69+
@echo
70+
@echo "Spelling checker messages are written to $(BUILDDIR)/spelling/output.txt"
71+
6672
.PHONY: cleanpdf
6773
rm $(PDFs)
6874

conf.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# add these directories to sys.path here. If the directory is relative to the
1717
# documentation root, use os.path.abspath to make it absolute, like shown here.
1818
#
19-
# import os
19+
import os
2020
import sys
2121
from subprocess import check_output
2222
# sys.path.insert(0, os.path.abspath('.'))
@@ -44,6 +44,11 @@ def open(filename):
4444
'sphinx.ext.githubpages',
4545
]
4646

47+
spelling = os.getenv('SPHINX_SPELL') # Enable the optional spell check.
48+
49+
if spelling:
50+
extensions.append('sphinxcontrib.spelling')
51+
4752
numfig = True
4853

4954
# Add any paths that contain templates here, relative to this directory.
@@ -104,6 +109,8 @@ def open(filename):
104109
# directories to ignore when looking for source files.
105110
# This patterns also effect to html_static_path and html_extra_path
106111
exclude_patterns = ['build', 'Thumbs.db', '.DS_Store', '**README.rst']
112+
if spelling:
113+
exclude_patterns += ['**bibliography.rst', 'stamp.rst']
107114

108115
# The reST default role (used for this markup: `text`) to use for all
109116
# documents.

spelling_wordlist.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Ai
2+
CCF
3+
Fi
4+
LAnguage
5+
Napierian
6+
PSA
7+
REgular
8+
Ri
9+
Schematron
10+
datatype
11+
datatypes
12+
formulae
13+
iff
14+
lognormal
15+
nand
16+
schemas
17+
xor

0 commit comments

Comments
 (0)