1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
From: Carsten Schoenert <c.schoenert@t-online.de>
Date: Fri, 10 Sep 2021 17:15:38 +0200
Subject: Use local inventory for intersphinx
The upstream way is to fetch the interspinx inventary by https from
docs.djangoproject.com.
Using instead the packages stuff from python3-django-doc.
This patch is basicaly completely taken from python-testfixtures and was
written by Michael Fladischer <FladischerMichael@fladi.at>.
Forwarded: not-needed
---
docs/conf.py | 27 +++++++++++++++++++++------
1 file changed, 21 insertions(+), 6 deletions(-)
diff --git a/docs/conf.py b/docs/conf.py
index 7dac581..088faad 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,3 +1,4 @@
+import django
import os
import sys
@@ -25,13 +26,27 @@ latex_documents = [
),
]
-intersphinx_mapping = {
- "django": (
- "https://docs.djangoproject.com/en/stable/",
- "https://docs.djangoproject.com/en/stable/_objects/",
+def check_object_path(key, url, path):
+ if os.path.isfile(path):
+ return {key: (url, path)}
+ return {}
+
+intersphinx_mapping = {}
+intersphinx_mapping.update(check_object_path(
+ 'python',
+ 'https://docs.python.org/{v}/'.format(
+ v='.'.join(map(str, sys.version_info[0:2]))
),
- "python": ("https://docs.python.org/3", None),
-}
+ '/usr/share/doc/python{v}/html/objects.inv'.format(
+ v='.'.join(map(str, sys.version_info[0:2]))
+ )
+))
+
+intersphinx_mapping.update(check_object_path(
+ 'django',
+ 'https://django.readthedocs.org/en/latest/',
+ '/usr/share/doc/python-django-doc/html/objects.inv'
+))
if not on_rtd:
import sphinx_rtd_theme
|