Add the `intersphinx_resolve_self` option (#13291)

Co-authored-by: Jakob Lykke Andersen <Jakob@caput.dk>
This commit is contained in:
Adam TurnerandJakob Lykke Andersen authored and GitHub committed 2025-02-03 17:50:46 +00:00
1 parent 766900e416
commit 758dc81303
4 files changed
+49 -9

No files matched your search

+27
View File
@@ -133,6 +133,33 @@ linking:
('../../otherbook/build/html/objects.inv', None)),
}
.. confval:: intersphinx_resolve_self
:type: :code-py:`str`
:default: :code-py:`''`
If provided, :confval:`!intersphinx_resolve_self` overrides intersphinx's
resolution mechanism to resolve all references to the current project,
rather than an external reference.
This is useful when documentation is shared between projects,
with the 'upstream' or 'parent' project using intersphinx-style references
in its documentation.
For example, a project such as *Astropy* might set:
.. code-block:: python
intersphinx_resolve_self = 'astropy'
Projects re-using *Astropy*'s documentation or inheriting their docstrings
would then configure their :confval:`!intersphinx_mapping` with
an :code-py:`'astropy'` key, pointing to *astropy*'s :file:`objects.inv`.
For example:
.. code-block:: python
intersphinx_mapping = {
'astropy': ('https://docs.astropy.org/en/stable/', None),
}
.. confval:: intersphinx_cache_limit
:type: :code-py:`int`
:default: :code-py:`5` (five days)