Skip to content

Commit

Permalink
docs: Use intersphinx_registry to keep intersphinx url up to date.
Browse files Browse the repository at this point in the history
I think one of the difference is it will point toward uproot stable
instead of latest (which is the dev version).
  • Loading branch information
Carreau committed Nov 18, 2024
1 parent 1f1adc7 commit 2b77cb0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
21 changes: 12 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()))

Expand Down Expand Up @@ -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'
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"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
Expand Down

0 comments on commit 2b77cb0

Please sign in to comment.