diff --git a/docs/conf.py b/docs/conf.py index 801ef81cef..dddeb31188 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,6 +20,7 @@ from pathlib import Path import jupytext +from intersphinx_registry import get_intersphinx_mapping sys.path.insert(0, str(Path('./exts').resolve())) @@ -80,15 +81,17 @@ def setup(app): # external links xref_links = {"arXiv:1007.1727": ("[1007.1727]", "https://arxiv.org/abs/1007.1727")} -intersphinx_mapping = { - 'python': ('https://docs.python.org/3', None), - 'numpy': ('https://numpy.org/doc/stable/', None), - 'scipy': ('https://docs.scipy.org/doc/scipy/', None), - 'matplotlib': ('https://matplotlib.org/stable/', None), - 'iminuit': ('https://iminuit.readthedocs.io/en/stable/', None), - 'uproot': ('https://uproot.readthedocs.io/en/latest/', None), - 'jsonpatch': ('https://python-json-patch.readthedocs.io/en/latest/', None), -} +intersphinx_mapping = get_intersphinx_mapping( + packages={ + 'python', + 'numpy', + 'scipy', + 'matplotlib', + 'iminuit', + 'uproot', + 'jsonpatch', + } +) # GitHub repo issues_github_path = 'scikit-hep/pyhf' diff --git a/docs/contributors.rst b/docs/contributors.rst index 292efde1c7..9554373417 100644 --- a/docs/contributors.rst +++ b/docs/contributors.rst @@ -35,3 +35,4 @@ Contributors include: - Jonas Rembser - Lorenz Gaertner - Melissa Weber Mendonça +- Matthias Bussonnier diff --git a/pyproject.toml b/pyproject.toml index cc39287ab3..c72568b2ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -121,6 +121,7 @@ docs = [ "pydata-sphinx-theme>=0.15.3", "nbsphinx!=0.8.8", # c.f. https://github.com/spatialaudio/nbsphinx/issues/620 "ipywidgets", + "intersphinx_registry>=0.2411.17", "sphinx-issues", "sphinx-copybutton>=0.3.2,!=0.5.1", "jupyterlite-sphinx>=0.13.1", # c.f. https://github.com/scikit-hep/pyhf/pull/2458