diff --git a/docs/Makefile b/docs/Makefile index b4fc9a6..b2c91b5 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -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 check spelling" clean: rm -rf $(BUILDDIR)/* @@ -175,3 +176,9 @@ pseudoxml: $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml @echo @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." + +spellcheck: + $(SPHINXBUILD) -b spelling $(ALLSPHINXOPTS) $(BUILDDIR)/spelling + @echo + @echo "Spell check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/spelling/output.txt." diff --git a/docs/conf.py b/docs/conf.py index 5276dc2..319519f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -3,6 +3,21 @@ import sys import os +import re + +regex = re.compile( + r"__version__ = (?P['\"])(?P[\w.+-]+?)(?P=quot)$", ) + +with open('../src/pyownet/__init__.py') as infile: + for line in infile: + version_match = regex.match(line) + if version_match: + __version__ = version_match.group('ver') + break + else: + raise RuntimeError("Unable to find version string.") + + # -- General configuration ------------------------------------------------ @@ -20,12 +35,12 @@ # General information about the project. project = u'pyownet' -copyright = u'2014, 2015, Stefano Miccoli' +copyright = u'2014–2016, Stefano Miccoli' # The short X.Y version. -version = '0.8' +version = '0.9' # The full version, including alpha/beta/rc tags. -release = '0.8.3.1' +release = __version__ # The language for content autogenerated by Sphinx. language = 'en' @@ -140,3 +155,10 @@ # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False + +# -- Extensions: spelling ------------------------------------------------- + +extensions = ['sphinxcontrib.spelling'] +spelling_show_suggestions = False +spelling_ignore_pypi_package_names = False +spelling_word_list_filename = 'spelling_wordlist.txt' diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..6d74a3e --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,5 @@ +Sphinx +sphinx-rtd-theme +# extension for spelling check +sphinxcontrib-spelling +pyenchant diff --git a/docs/spelling_wordlist.txt b/docs/spelling_wordlist.txt new file mode 100644 index 0000000..cb140ac --- /dev/null +++ b/docs/spelling_wordlist.txt @@ -0,0 +1,16 @@ +owserver +indices +ethernet +filesystem +perl +php +tcp +udp +multithreaded +ORed +lookups +proxied +pathnames +hardcoded +designator +builtin diff --git a/tox.ini b/tox.ini index b01dae1..43cad3b 100644 --- a/tox.ini +++ b/tox.ini @@ -29,8 +29,11 @@ jobs = auto deps = sphinx docutils + sphinxcontrib-spelling + pyenchant commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs docs/_build/html + sphinx-build -W -b spelling -d {envtmpdir}/doctrees docs docs/_build/spelling rst2html.py README.rst README.html rst2html.py CHANGELOG.rst CHANGELOG.html rst2html.py TODO.rst TODO.html