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
|
From: Michael Fladischer <fladi@debian.org>
Date: Thu, 8 Oct 2015 08:49:21 -0700
Subject: use local objects.inv where possible
Upstream uses intersphinx mappings that fetch the objects.inv for python
and webassets by HTTP from a remote host. Using the local objects.inv from
python and webassets enables the package to build without network connection.
Forwarded: not-needed
Last-Update: 2015-06-24
Patch-Name: 02-intersphinx.patch
---
docs/conf.py | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/docs/conf.py b/docs/conf.py
index d0bf13d..ab26a53 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -251,10 +251,21 @@ texinfo_documents = [
WEBASSETS_DOC_URL = 'http://elsdoerfer.name/docs/webassets/'
-intersphinx_mapping = {
- 'python': ('http://docs.python.org/', None),
- 'webassets': (WEBASSETS_DOC_URL, None),
-}
+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',
+ 'http://docs.python.org/',
+ '/usr/share/doc/python'
+ + '.'.join([str(x) for x in sys.version_info[0:2]])
+ + '/html/objects.inv'))
+intersphinx_mapping.update(check_object_path('webassets',
+ WEBASSETS_DOC_URL,
+ '/usr/share/doc/python-webassets-doc/html/objects.inv'))
+
extlinks = {'webassets': (WEBASSETS_DOC_URL+'%s.html', None)}
|