Commit 01890493 authored by André Anjos's avatar André Anjos 💬

[doc] Update sphinx configuration to remove hardcoded urls

parent 127b27d6
Pipeline #27332 failed with stages
in 33 minutes and 50 seconds
#!/usr/bin/env python #!/usr/bin/env python
# vim: set fileencoding=utf-8 : # -*- coding: utf-8 -*-
import os import os
import sys
import glob
import pkg_resources import pkg_resources
# -- General configuration ----------------------------------------------------- # -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here. # If your documentation needs a minimal Sphinx version, state it here.
...@@ -58,7 +55,7 @@ autosummary_generate = True ...@@ -58,7 +55,7 @@ autosummary_generate = True
numfig = True numfig = True
# If we are on OSX, the 'dvipng' path maybe different # If we are on OSX, the 'dvipng' path maybe different
dvipng_osx = '/opt/local/libexec/texlive/binaries/dvipng' dvipng_osx = '/Library/TeX/texbin/dvipng'
if os.path.exists(dvipng_osx): pngmath_dvipng = dvipng_osx if os.path.exists(dvipng_osx): pngmath_dvipng = dvipng_osx
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
...@@ -229,20 +226,25 @@ autodoc_default_flags = [ ...@@ -229,20 +226,25 @@ autodoc_default_flags = [
'show-inheritance', 'show-inheritance',
] ]
if not 'BOB_DOCUMENTATION_SERVER' in os.environ:
# notice we need to overwrite this for BEAT projects - defaults from Bob are
# not OK
os.environ['BOB_DOCUMENTATION_SERVER'] = "https://www.idiap.ch/software/beat/docs/beat/%(name)s/%(version)s/|https://www.idiap.ch/software/beat/docs/beat/%(name)s/master/"
# For inter-documentation mapping: # For inter-documentation mapping:
from bob.extension.utils import link_documentation, load_requirements from bob.extension.utils import link_documentation, load_requirements
sphinx_requirements = "extra-intersphinx.txt" sphinx_requirements = "extra-intersphinx.txt"
if os.path.exists(sphinx_requirements): if os.path.exists(sphinx_requirements):
intersphinx_mapping = link_documentation( intersphinx_mapping = link_documentation(
additional_packages=['python','numpy'] + \ additional_packages=['python','numpy'] + \
load_requirements(sphinx_requirements) load_requirements(sphinx_requirements))
)
else: else:
intersphinx_mapping = link_documentation() intersphinx_mapping = link_documentation()
# Adds simplejson, pyzmq links # Adds simplejson, flask links
intersphinx_mapping['http://simplejson.readthedocs.io/en/stable/'] = None intersphinx_mapping['http://simplejson.readthedocs.io/en/stable/'] = None
intersphinx_mapping['http://pyzmq.readthedocs.io/en/stable/'] = None intersphinx_mapping['http://flask.pocoo.org/docs/'] = None
intersphinx_mapping['http://jinja.pocoo.org/docs/'] = None
# We want to remove all private (i.e. _. or __.__) members # We want to remove all private (i.e. _. or __.__) members
# that are not in the list of accepted functions # that are not in the list of accepted functions
...@@ -253,7 +255,8 @@ def member_function_test(app, what, name, obj, skip, options): ...@@ -253,7 +255,8 @@ def member_function_test(app, what, name, obj, skip, options):
if len(name) > 1 and name[0] == '_': if len(name) > 1 and name[0] == '_':
# test if this private function should be allowed # test if this private function should be allowed
if name not in accepted_private_functions: if name not in accepted_private_functions:
# omit privat functions that are not in the list of accepted private functions # omit private functions that are not in the list of accepted private
# functions
return skip return skip
else: else:
# test if the method is documented # test if the method is documented
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment