Skip to content
Browse files

Fixed #22141 -- Added a spelling checker for documentation.

  • Loading branch information...
1 parent 8f9c3d0 commit a0f252520291924f8fb7cb0d85f1680294508560 @beregond beregond committed with timgraham
Showing with 770 additions and 0 deletions.
  1. +8 −0 docs/Makefile
  2. +11 −0 docs/
  3. +24 −0 docs/internals/contributing/writing-documentation.txt
  4. +727 −0 docs/spelling_wordlist
8 docs/Makefile
@@ -37,6 +37,8 @@ help:
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
+ @echo " spelling to check for typos in documentation"
-rm -rf $(BUILDDIR)/*
@@ -143,3 +145,9 @@ doctest:
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
+ $(SPHINXBUILD) -b spelling $(ALLSPHINXOPTS) $(BUILDDIR)/spelling
+ @echo
+ @echo "Check finished. Wrong words can be found in " \
+ "$(BUILDDIR)/spelling/output.txt."
11 docs/
@@ -33,6 +33,17 @@
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ["djangodocs", "sphinx.ext.intersphinx"]
+# Spelling check needs an additional module that is not installed by default.
+# Add it only if spelling check is requested so docs can be generated without it.
+if 'spelling' in sys.argv:
+ extensions.append("sphinxcontrib.spelling")
+# Spelling language.
+spelling_lang = 'en_US'
+# Location of word list.
+spelling_word_list_filename = 'spelling_wordlist'
# Add any paths that contain templates here, relative to this directory.
# templates_path = []
24 docs/internals/contributing/writing-documentation.txt
@@ -348,3 +348,27 @@ look better:
(that's a tilde) to get just the "last bit" of that path. So
``:class:`~django.contrib.contenttypes.models.ContentType``` will just
display a link with the title "ContentType".
+Spelling check
+Before you commit your docs, it's a good idea to run the spelling checker.
+You'll need to install a couple packages first:
+* `pyenchant <>`_ (which requires
+ `enchant <>`_)
+* `sphinxcontrib-spelling
+ <>`_
+Then from the ``docs`` directory, run ``make spelling``. Wrong words (if any)
+along with the file and line number where they occur will be saved to
+If you encounter false-positives (error output that actually is correct), do
+one of the following:
+* Surround inline code or brand/technology names with grave accents (`).
+* Find synonyms that the spell checker recognizes.
+* If, and only if, you are sure the word you are using is correct - add it
+ to ``docs/spelling_wordlist`` (please keep the list in alphabetical order).
727 docs/spelling_wordlist
@@ -0,0 +1,727 @@

0 comments on commit a0f2525

Please sign in to comment.
Something went wrong with that request. Please try again.