From eda8c84cab1e45de2ddcc4000da40ec81f34c7a7 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 16 Apr 2014 14:59:17 -0400 Subject: [PATCH] Add optional spell checker target Add a tox target using sphinxcontrib-spelling to let authors run a spell checker against documents before submitting them. Based on nova-specs change: If519fb63bc4b0923a48df9e0435125fd66ab5c0c Change-Id: I5b5bb10fada71c14ae1753e72a450e16d0683cb0 --- doc/source/conf.py | 10 +++++++++- tox.ini | 7 +++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 5113e8e..257f4d6 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -30,9 +30,17 @@ extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.viewcode', - 'oslosphinx' + 'oslosphinx', ] +# Optionally allow the use of sphinxcontrib.spelling to verify the +# spelling of the documents. +try: + import sphinxcontrib.spelling + extensions.append('sphinxcontrib.spelling') +except ImportError: + pass + todo_include_todos = True # Add any paths that contain templates here, relative to this directory. diff --git a/tox.ini b/tox.ini index aacefbe..f7d64c1 100644 --- a/tox.ini +++ b/tox.ini @@ -14,3 +14,10 @@ commands = {posargs} [testenv:docs] commands = python setup.py build_sphinx + +[testenv:spelling] +deps = + -r{toxinidir}/requirements.txt + sphinxcontrib-spelling + PyEnchant +commands = sphinx-build -b spelling doc/source doc/build/spelling