diff --git a/docs/Makefile b/docs/Makefile --- a/docs/Makefile +++ b/docs/Makefile @@ -1,4 +1,4 @@ -SPHINXOPTS = +SPHINXOPTS ?= SPHINXBUILD = python3 -c 'import sphinx, sys; sys.exit(sphinx.main(sys.argv))' SOURCEDIR = . BUILDDIR = _build diff --git a/docs/index.rst b/docs/index.rst --- a/docs/index.rst +++ b/docs/index.rst @@ -134,4 +134,5 @@ architecture getting-started + apidoc/modules swh-*/index diff --git a/swh/docs/sphinx/conf.py b/swh/docs/sphinx/conf.py --- a/swh/docs/sphinx/conf.py +++ b/swh/docs/sphinx/conf.py @@ -131,9 +131,25 @@ extlinks = {} +# XXX Kill this ASA this PR is accepted and released +# https://github.com/sphinx-contrib/httpdomain/pull/19 +def register_routingtable_as_label(app, document): + from sphinx.locale import _ # noqa + labels = app.env.domaindata['std']['labels'] + labels['routingtable'] = 'http-routingtable', '', _('HTTP Routing Table') + anonlabels = app.env.domaindata['std']['anonlabels'] + anonlabels['routingtable'] = 'http-routingtable', '' + + # hack to set the adequate django settings when building global swh doc # to avoid autodoc build errors def setup(app): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'swh.docs.django_settings') django.setup() + import pkg_resources # noqa + from distutils.version import StrictVersion # noqa + + httpdomain = pkg_resources.get_distribution('sphinxcontrib-httpdomain') + if StrictVersion(httpdomain.version) <= StrictVersion('1.7.0'): + app.connect('doctree-read', register_routingtable_as_label) diff --git a/tox.ini b/tox.ini --- a/tox.ini +++ b/tox.ini @@ -3,6 +3,7 @@ [testenv] basepython = python3 +passenv = SPHINXOPTS [testenv:sphinx] deps =