diff --git a/docs/conf.py b/docs/conf.py index af472e3781..65494b99a0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -54,7 +54,26 @@ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. -#language = None +# We define our own to improve search results slightly. +from sphinx.search.en import SearchEnglish +from sphinx.search import languages as sphinx_languages + +class FlockerLanguage(SearchEnglish): + """ + Workaround for https://bitbucket.org/birkenfeld/sphinx/issue/1529/ + """ + lang = 'flocker' + + def word_filter(self, word): + """ + Only omit stop words; default also omits words shorter than 3 + characters which breaks search for "ZFS" since stemming turns that into + "zf". + """ + return word not in self.stopwords + +sphinx_languages['flocker'] = FlockerLanguage +language = 'flocker' # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: diff --git a/setup.py b/setup.py index 6f86e56189..b89b68b088 100644 --- a/setup.py +++ b/setup.py @@ -106,7 +106,7 @@ def run(self): extras_require={ # This extra allows you to build the documentation for Flocker. - "doc": ["Sphinx==1.2", "sphinx-rtd-theme==0.1.6"], + "doc": ["Sphinx==1.2.2", "sphinx-rtd-theme==0.1.6"], # This extra is for developers who need to work on Flocker itself. "dev": [ # flake8 is pretty critical to have around to help point out diff --git a/tox.ini b/tox.ini index 0a4b85fa90..653bd53a5f 100644 --- a/tox.ini +++ b/tox.ini @@ -30,4 +30,5 @@ basepython = python2.7 changedir = {toxinidir} commands = pip install Flocker[doc] + rm -rf docs/_build/html sphinx-build -a -b html docs/ docs/_build/html