@@ -224,6 +224,15 @@ def linkcode_resolve(domain: str, info: Dict[str, Any]) -> Optional[str]:
224224 return f"{ github_repo } /blob/{ git_ref } /disnake/{ path } "
225225
226226
227+ # Links used for cross-referencing stuff in other documentation
228+ # when this is updated hoverxref_intersphinx also needs to be updated IF THE docs are hosted on readthedocs.
229+ intersphinx_mapping = {
230+ "py" : ("https://docs.python.org/3" , None ),
231+ "aio" : ("https://docs.aiohttp.org/en/stable/" , None ),
232+ "req" : ("https://requests.readthedocs.io/en/latest/" , None ),
233+ }
234+
235+
227236hoverx_default_type = "tooltip"
228237hoverxref_domains = ["py" ]
229238hoverxref_role_types = dict .fromkeys (
@@ -234,19 +243,7 @@ def linkcode_resolve(domain: str, info: Dict[str, Any]) -> Optional[str]:
234243hoverxref_tooltip_lazy = True
235244
236245# these have to match the keys on intersphinx_mapping, and those projects must be hosted on readthedocs.
237- hoverxref_intersphinx = [
238- "py" ,
239- "aio" ,
240- "req" ,
241- ]
242-
243- # Links used for cross-referencing stuff in other documentation
244- # when this is updated hoverxref_intersphinx also needs to be updated IF THE docs are hosted on readthedocs.
245- intersphinx_mapping = {
246- "py" : ("https://docs.python.org/3" , None ),
247- "aio" : ("https://docs.aiohttp.org/en/stable/" , None ),
248- "req" : ("https://requests.readthedocs.io/en/latest/" , None ),
249- }
246+ hoverxref_intersphinx = list (intersphinx_mapping .keys ())
250247
251248
252249# use proxied API endpoint on readthedocs to avoid CORS issues
@@ -290,6 +287,7 @@ def linkcode_resolve(domain: str, info: Dict[str, Any]) -> Optional[str]:
290287 ("disnake.ext.commands" , "ext/commands" ),
291288 ("disnake.ext.tasks" , "ext/tasks" ),
292289 ],
290+ "READTHEDOCS" : _IS_READTHEDOCS ,
293291}
294292
295293resource_links = {
0 commit comments