Skip to content

add "refdoc" attribute to most pending_xrefs#14288

Open
minijackson wants to merge 1 commit intosphinx-doc:masterfrom
minijackson:add-refdocs
Open

add "refdoc" attribute to most pending_xrefs#14288
minijackson wants to merge 1 commit intosphinx-doc:masterfrom
minijackson:add-refdocs

Conversation

@minijackson
Copy link

Purpose

Hello, and thanks for this great project!

I'm currently writing a single-file builder for Typst, and I stumbled upon a problem:

In some cases, when a an object was defined in a file and referenced from another, the reference node would have a refid attribute, but no refuri, so my builder couldn't figure out the correct reference.

I found out that it was because the pending_xref didn't have a refdoc attribute indicating the document where the reference was written, and the _resolve_pending_xref function assumes that this must be the current document, which isn't correct if we inline all toctrees.

This PR adds provenance information (refdoc) to pending_xrefs.

References

None?

This adds provenance information to pending_xrefs,
which was previously wrongly assumed to be the current file when
resolving them.

In a case where we inline all toctrees,
for example for single file builders,
this would always resolve to be the root document
instead of the source document.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant