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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
|
From: Andrey Rakhmatullin <wrar@debian.org>
Date: Sat, 20 Apr 2024 23:02:04 +0500
Subject: Use local intersphinx files.
---
docs/conf.py | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 98 insertions(+), 16 deletions(-)
diff --git a/docs/conf.py b/docs/conf.py
index 1167ce0..3d4d5e8 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -141,22 +141,104 @@ coverage_ignore_pyobjects = [
# -- Options for the InterSphinx extension -----------------------------------
# https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#configuration
-intersphinx_mapping = {
- "attrs": ("https://www.attrs.org/en/stable/", None),
- "coverage": ("https://coverage.readthedocs.io/en/latest", None),
- "cryptography": ("https://cryptography.io/en/latest/", None),
- "cssselect": ("https://cssselect.readthedocs.io/en/latest", None),
- "itemloaders": ("https://itemloaders.readthedocs.io/en/latest/", None),
- "parsel": ("https://parsel.readthedocs.io/en/latest/", None),
- "pytest": ("https://docs.pytest.org/en/latest", None),
- "python": ("https://docs.python.org/3", None),
- "sphinx": ("https://www.sphinx-doc.org/en/master", None),
- "tox": ("https://tox.wiki/en/latest/", None),
- "twisted": ("https://docs.twisted.org/en/stable/", None),
- "twistedapi": ("https://docs.twisted.org/en/stable/api/", None),
- "w3lib": ("https://w3lib.readthedocs.io/en/latest", None),
-}
-intersphinx_disabled_reftypes: Sequence[str] = []
+
+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(
+ "attrs",
+ "https://www.attrs.org/en/stable/",
+ "/usr/share/doc/python-attr-doc/html/objects.inv",
+ )
+)
+intersphinx_mapping.update(
+ check_object_path(
+ "coverage",
+ "https://coverage.readthedocs.org/en/latest/",
+ "/usr/share/doc/python-coverage-doc/html/objects.inv",
+ )
+)
+intersphinx_mapping.update(
+ check_object_path(
+ "cryptography",
+ "https://cryptography.io/en/latest/",
+ "/usr/share/doc/python-cryptography-doc/html/objects.inv",
+ )
+)
+intersphinx_mapping.update(
+ check_object_path(
+ "cssselect",
+ "https://cssselect.readthedocs.org/en/latest/",
+ "/usr/share/doc/python-cssselect-doc/html/objects.inv",
+ )
+)
+intersphinx_mapping.update(
+ check_object_path(
+ "itemloaders",
+ "https://itemloaders.readthedocs.org/en/latest/",
+ "/usr/share/doc/python-itemloaders-doc/html/objects.inv",
+ )
+)
+intersphinx_mapping.update(
+ check_object_path(
+ "parsel",
+ "https://parsel.readthedocs.org/en/latest/",
+ "/usr/share/doc/python-parsel-doc/html/objects.inv",
+ )
+)
+intersphinx_mapping.update(
+ check_object_path(
+ "pytest",
+ "https://docs.pytest.org/en/latest",
+ "/usr/share/doc/python-pytest-doc/html/objects.inv",
+ )
+)
+intersphinx_mapping.update(
+ check_object_path(
+ "python",
+ "https://docs.python.org/3",
+ "/usr/share/doc/python%d.%d/html/objects.inv" % sys.version_info[:2],
+ )
+)
+intersphinx_mapping.update(
+ check_object_path(
+ "sphinx",
+ "https://www.sphinx-doc.org/en/master",
+ "/usr/share/doc/sphinx-doc/html/objects.inv",
+ )
+)
+intersphinx_mapping.update(
+ check_object_path(
+ "tox", "https://tox.wiki/en/latest/", "/usr/share/doc/tox/html/objects.inv"
+ )
+)
+intersphinx_mapping.update(
+ check_object_path(
+ "twisted",
+ "https://docs.twisted.org/en/stable/",
+ "/usr/share/doc/twisted-doc/html/objects.inv",
+ )
+)
+intersphinx_mapping.update(
+ check_object_path(
+ "twistedapi",
+ "https://docs.twisted.org/en/stable/api",
+ "/usr/share/doc/twisted-doc/html/api/objects.inv",
+ )
+)
+intersphinx_mapping.update(
+ check_object_path(
+ "w3lib",
+ "https://w3lib.readthedocs.org/en/latest/",
+ "/usr/share/doc/python-w3lib-doc/html/objects.inv",
+ )
+)
+intersphinx_disabled_reftypes = []
# -- Options for sphinx-hoverxref extension ----------------------------------
|