Skip to content

Commit

Permalink
adding spellchecking extension to sphinx docs
Browse files Browse the repository at this point in the history
  • Loading branch information
miccoli committed Jan 4, 2016
1 parent 8709a83 commit 1a87630
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 3 deletions.
7 changes: 7 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)/*
Expand Down Expand Up @@ -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."
28 changes: 25 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@

import sys
import os
import re

regex = re.compile(
r"__version__ = (?P<quot>['\"])(?P<ver>[\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 ------------------------------------------------

Expand All @@ -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'
Expand Down Expand Up @@ -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'
5 changes: 5 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Sphinx
sphinx-rtd-theme
# extension for spelling check
sphinxcontrib-spelling
pyenchant
16 changes: 16 additions & 0 deletions docs/spelling_wordlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
owserver
indices
ethernet
filesystem
perl
php
tcp
udp
multithreaded
ORed
lookups
proxied
pathnames
hardcoded
designator
builtin
3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1a87630

Please sign in to comment.