| 1 |
From: Michael Fladischer <[email protected]> |
| 2 |
Date: Mon, 6 Jul 2026 18:32:36 +0000 |
| 3 |
Subject: Use local objects.inv in default intersphinx configuration if files |
| 4 |
are present. |
| 5 |
|
| 6 |
--- |
| 7 |
doc/conf.py | 17 +++++++++++++---- |
| 8 |
1 file changed, 13 insertions(+), 4 deletions(-) |
| 9 |
|
| 10 |
diff --git a/doc/conf.py b/doc/conf.py |
| 11 |
index 22b3996..f16179c 100644 |
| 12 |
--- a/doc/conf.py |
| 13 |
+++ b/doc/conf.py |
| 14 |
@@ -29,10 +29,19 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] |
| 15 |
|
| 16 |
# Use Python 3.15 for new features and Python 3.14 as a fallback for APIs that |
| 17 |
# were removed in Python 3.15. |
| 18 |
-intersphinx_mapping = { |
| 19 |
- 'py': ('https://docs.python.org/3.15', None), |
| 20 |
- 'py314': ('https://docs.python.org/3.14', None), |
| 21 |
-} |
| 22 |
+def check_object_path(key, url, path): |
| 23 |
+ if os.path.isfile(path): |
| 24 |
+ return {key: (url, path)} |
| 25 |
+ return {} |
| 26 |
+ |
| 27 |
+intersphinx_mapping = {} |
| 28 |
+intersphinx_mapping.update( |
| 29 |
+ check_object_path( |
| 30 |
+ 'py', |
| 31 |
+ 'https://docs.python.org/' + '.'.join([str(x) for x in sys.version_info[0:2]]) + "/", |
| 32 |
+ '/usr/share/doc/python' + '.'.join([str(x) for x in sys.version_info[0:2]]) + '/html/objects.inv' |
| 33 |
+ ) |
| 34 |
+) |
| 35 |
|
| 36 |
add_module_names = False |
| 37 |
|