-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve any
role search for documents
#12740
Comments
You don't provide an example of how you cross-reference so I get the impression you're making a mistake.
That's not a cross-reference, it's:
an Internal hyperlink target above a section; that's a feature that's worked well for years. You'd reference it with The error message:
Suggests you're giving the document the same name as the internal hyperlink target, so the warning is correct and Sphinx should warn users when there's a name collision. |
My bad, that's right, it's an internal hyperlink target. I agree that
That's right, I agree that the warning is correct. My question is if I do not include the internal hyperlink target,
|
You aren't correctly structuring your documentation, there's no point giving a section and a document the same name. But if you have such a use-case then make sure to choose the appropriate role.
Cross-references don't use file extensions. Items are cross-referenced by name; an I've see dozens (likely hundreds) of users asking for |
Yes, I understand that, the Now that I'm think about this further, I think this is a request to change the Here's a larger example:
I want to be able to use |
You should direct your usage questions to Stack Overflow, see:
To me this seems like a chameleon-question because you haven't sufficiently researched or tested your solution. (I would hammer this thread closed in a heartbeat at Stack Overflow for lacking a minimal reproducible example, you haven't written a single cross-reference in the question so I'm not convinced that you actually tested anything you wrote.)
This thread is a usage question that's trying to disguise itself as a speculative feature-request. |
Is your feature request related to a problem? Please describe.
I have a somewhat large amount of code in an unsupported language documented on a Sphinx project. I have a document per function, and this works quite well for the most part.
Each of those documents are organized by section in a folder. For example, the file
docs/general/FunctionName.rst
starts with:The cross references suffer from a weird issue:
.._FunctionName:
), I get a warning for each file:To avoid the warning and the manual xref, I would need to change all references to:
`/general/FunctionName <FunctionName>`
This is just awful, I don't want to encode the "section" name on the reference, this is only a way to organize the functions.
Describe the solution you'd like
any
should be smarter about resolving document cross references, by looking at all documents with a common suffix.In my case, I know there won't be documents with the same name in different folders.
I think this might be too disruptive, it could be implemented as an option?
Describe alternatives you've considered
Mentioned above.
Is there any way to "link" a bunch of documents to the document root, to avoid the manual xref? Changing all references to
/FunctionName
is a possibility.I opened #12739 to suppress these warnings.
Additional context
The
default_role
is set toany
, and I have:The text was updated successfully, but these errors were encountered: