intersphinx works through an index file (usually "objects.inv") which seems to have a relatively simple structure.
I figure it could be useful for rustdoc to produce such an index (alongside any index it already does provide) for:
- interop with sphinx itself (so it's possible to flexibly link from sphinx documentations to rustdoc objects)
- because some folks have built tooling which leverages that e.g. doc2dash which apparently uses the index / inventory file to generate docsets (there may be other)
Eventually it might also be nice for rustdoc to ingest such indexes in order to more easily cross-link to external documentations (whether for rust or not), this could allow rustdoc to support not just intra-doc links but inter-doc links (though the doc-level UX would have to be specified).
Is it possible to generate that format using the existing json output? I would prefer that to maintaining another format for rustdoc.
It probably can be generated from the (still-unstable) JSON output, but
Extending intra-doc links to support consuming Sphinx indexes would need a rustdoc extension. If someone wants to make an RFC for this, both features should be proposed at once (they can still be stabilized at different times).
Consuming the sphinx format makes sense to me, because it can't be replicated outside rustdoc. I don't see why emitting the format has to be in rustdoc itself, though.
Where should that go, a PR on GitHub - rust-lang/rfcs: RFCs for changes to Rust?
Yes, there. Probably draft it first, and post it here, then when it seems mostly-good, post it to the rust-lang/rfcs repo.
I would also try to solicit feedback from (other?) sphinx subject-matter experts, like someone who's written a widely-used plugin or who's done this type of integration with other doc generators before.