From 5aae977e5fb22d0460bfa39333939ce69e988d87 Mon Sep 17 00:00:00 2001
From: Yannick DAYER <yannick.dayer@idiap.ch>
Date: Wed, 9 Nov 2022 15:18:44 +0100
Subject: [PATCH] [doc] Switch to auto-intersphinx

---
 doc/catalog.json | 26 ++++++++++++++++++++++++++
 doc/conf.py      | 14 +++++++-------
 pyproject.toml   |  3 ++-
 3 files changed, 35 insertions(+), 8 deletions(-)
 create mode 100644 doc/catalog.json

diff --git a/doc/catalog.json b/doc/catalog.json
new file mode 100644
index 0000000..98f30b8
--- /dev/null
+++ b/doc/catalog.json
@@ -0,0 +1,26 @@
+{
+    "numpy": {
+        "version": {
+            "latest": "https://numpy.org/doc/stable/"
+        },
+        "sources": {
+            "readthedocs": "numpy"
+        }
+    },
+    "matplotlib": {
+        "version": {
+            "latest": "https://matplotlib.org/stable/"
+        },
+        "sources": {
+            "readthedocs": "matplotlib"
+        }
+    },
+    "PIL": {
+        "version": {
+            "latest": "https://pillow.readthedocs.io/en/latest/"
+        },
+        "sources": {
+            "readthedocs": "pillow"
+        }
+    }
+}
diff --git a/doc/conf.py b/doc/conf.py
index 4f68f92..7472718 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -106,10 +106,10 @@ autodoc_default_options = {
     "show-inheritance": True,
 }
 
-intersphinx_mapping = {
-    "python": ("https://docs.python.org/3", None),
-    "scipy": ("https://docs.scipy.org/doc/scipy/", None),
-    "numpy": ("https://numpy.org/doc/stable/", None),
-    "matplotlib": ("https://matplotlib.org/stable/", None),
-    "PIL": ("https://pillow.readthedocs.io/en/latest/", None),
-}
+auto_intersphinx_packages = [
+    ("python", "3"),
+    "numpy",
+    "matplotlib",
+    "PIL",
+]
+auto_intersphinx_catalog = "catalog.json"
diff --git a/pyproject.toml b/pyproject.toml
index a4edf54..750b0e1 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -30,7 +30,7 @@ dependencies = [
 ]
 
 [project.urls]
-documentation = "https://www.idiap.ch/software/bob/docs/bob/bob.io.base/master/"
+documentation = "https://www.idiap.ch/software/bob/docs/bob/bob.io.base/master/sphinx"
 homepage = "https://pypi.org/project/bob.io.base"
 repository = "https://gitlab.idiap.ch/bob/bob.io.base"
 changelog = "https://gitlab.idiap.ch/bob/bob.io.base/-/releases"
@@ -40,6 +40,7 @@ qa = ["pre-commit"]
 doc = [
     "sphinx",
     "sphinx_rtd_theme",
+    "auto-intersphinx",
     ]
 test = [
     "pytest",
-- 
GitLab