diff --git a/docs/Makefile b/docs/Makefile index be69e9d88281..027b6a0092e4 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -19,7 +19,7 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) sou # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest spellcheck gettext help: @echo "Please use \`make ' where is one of" @@ -45,6 +45,7 @@ help: @echo " pseudoxml to make pseudoxml-XML files for display purposes" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" + @echo " spellcheck to spell check all files" clean: rm -rf $(BUILDDIR)/* @@ -166,6 +167,12 @@ doctest: @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." +spellcheck: + $(SPHINXBUILD) -b spelling $(ALLSPHINXOPTS) $(BUILDDIR)/spellcheck + @echo + @echo "Spell check complete; look for any errors in the above output," \ + "or in $(BUILDDIR)/spellcheck/output.txt." + xml: $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml @echo diff --git a/docs/dictionary.txt b/docs/dictionary.txt new file mode 100644 index 000000000000..93f8d5028d6f --- /dev/null +++ b/docs/dictionary.txt @@ -0,0 +1,78 @@ +Async +CPython +Cobertura +Cython +Dataclasses +Docstring +Enums +Indices +JUnit +Metaclass +Metaclasses +Posix +Pythonic +Typeshed +Unfollowed +Zulip +api +arity +async +attr +attrs +builtin +bytecode +cdef +codebase +config +contravariant +contravariantly +covariantly +cpdef +deserialization +devs +dict +dmypy +downloadable +fallback +genericity +indices +ing +inline +ints +iterable +iterables +linters +macOS +metaclass +metaclasses +metaprogramming +mypy +namespace +py +rebased +redownloading +repo +runtimes +stdlib +subclassable +subclassed +subclassing +subpackages +subprotocols +subtyping +superclasses +supertype +tarball +toplevel +tradeoff +typecheck +typechecks +typeshed +unfollowed +unicode +webcrawler +wiki +wildcard +wildcards +workflow +workflows diff --git a/docs/make.bat b/docs/make.bat index 1e3d84320174..5d6ac78365eb 100755 --- a/docs/make.bat +++ b/docs/make.bat @@ -37,6 +37,7 @@ if "%1" == "help" ( echo. pseudoxml to make pseudoxml-XML files for display purposes echo. linkcheck to check all external links for integrity echo. doctest to run all doctests embedded in the documentation if enabled + echo. spellcheck to spell check all files goto end ) @@ -223,6 +224,15 @@ results in %BUILDDIR%/doctest/output.txt. goto end ) +if "%1" == "spellcheck" ( + %SPHINXBUILD% -b spelling %ALLSPHINXOPTS% %BUILDDIR%/spellcheck + if errorlevel 1 exit /b 1 + echo. + echo.Spell check complete; look for any errors in the above output ^ +or in %BUILDDIR%/spellcheck/output.txt. + goto end +) + if "%1" == "xml" ( %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml if errorlevel 1 exit /b 1 diff --git a/docs/requirements-docs.txt b/docs/requirements-docs.txt index d20641e7edf5..d259c8184c7f 100644 --- a/docs/requirements-docs.txt +++ b/docs/requirements-docs.txt @@ -1,2 +1,3 @@ Sphinx >= 1.4.4 sphinx-rtd-theme >= 0.1.9 +sphinxcontrib-spelling >= 4.2.0 diff --git a/docs/source/conf.py b/docs/source/conf.py index cf64842ce454..2cacb2a11b57 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -30,7 +30,7 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = [] +extensions = [ 'sphinxcontrib.spelling' ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -266,3 +266,16 @@ #texinfo_no_detailmenu = False rst_prolog = '.. |...| unicode:: U+2026 .. ellipsis\n' + + +# -- Options for spelling extension ---------------------------------------------- + +spelling_lang='en_US' + +# String specifying a file containing a list of words known to be spelled +# correctly but that do not appear in the language dictionary selected by +# spelling_lang. The file should contain one word per line. +spelling_word_list_filename='../dictionary.txt' + +# Boolean controlling whether suggestions for misspelled words are printed. +spelling_show_suggestions=True diff --git a/docs/source/revision_history.rst b/docs/source/revision_history.rst index a4d2cc4d4bad..8a3f2b8e066a 100644 --- a/docs/source/revision_history.rst +++ b/docs/source/revision_history.rst @@ -331,7 +331,7 @@ detailed release notes): Split the HTML documentation into multiple pages. -- Sep 2014 +- Sept 2014 Migrated docs to Sphinx. - Aug 2014