Add Sphinx domains for intersphinx consumers - #2183
Add Sphinx domains for intersphinx consumers#2183JeanChristopheMorinPerso wants to merge 2 commits into
Conversation
Signed-off-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com> Amp-Thread-ID: https://ampcode.com/threads/T-019fdefd-f7a9-75c8-8d27-ddb0ca62d6fe Co-authored-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2183 +/- ##
==========================================
- Coverage 61.29% 61.25% -0.04%
==========================================
Files 164 165 +1
Lines 20568 20581 +13
Branches 3575 3575
==========================================
Hits 12607 12607
- Misses 7089 7102 +13
Partials 872 872 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds a lightweight, installable Sphinx extension (rez.utils.docs) that registers Rez’s custom Sphinx domains so external documentation projects can resolve references to Rez’s non-standard domains via intersphinx.
Changes:
- Added
rez.utils.docsSphinx extension that registers therexandpkgdefdomains (PythonDomain-derived). - Updated Rez’s internal docs extension (
docs/rez_sphinxext.py) to reuse the new domain definitions. - Added a new user guide describing how to configure intersphinx and author external references, and linked it into the guides index.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/rez/utils/docs.py | New public Sphinx extension module that defines and registers lightweight rex/pkgdef domains for intersphinx consumers. |
| docs/source/guides/linking_to_rez_documentation.rst | New guide explaining how to configure intersphinx + the Rez extension and how to write external references. |
| docs/source/guides/index.rst | Adds the new “linking_to_rez_documentation” guide to the guides toctree. |
| docs/rez_sphinxext.py | Refactors Rez’s docs-only extension to subclass/reuse the new domain definitions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| from sphinx.domains.python import PythonDomain | ||
|
|
… extension metadata Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
I introduced two new Sphinx domains in 3.4.0 without realizing that it's impossible to reference non-standard domains in other sphinx projects.
This PR creates a new Sphinx extension that our users can use to more easily reference our new domains using intersphinx.
Amp-Thread-ID: https://ampcode.com/threads/T-019fdefd-f7a9-75c8-8d27-ddb0ca62d6fe