-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameArea: Intra-doc links, the ability to link to items in docs by nameC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
It's very common for me to refer to a particular method, function, struct, etc without wanting to mention the full path. Right now the easiest way to do this is as following:
/// See also [`my_long_function_name`](some::path::to::my_long_function_name).
This is really common in my experience (most often with Self
as the path), and has three main problems:
- It's annoying to repeat yourself.
- It's error prone to repeat yourself, you could make a typo/refactor in one or the other causing them to go out of sync.
- It's annoying to repeat yourself.
In this issue I would like to propose a simple shorthand for the above:
/// See also [some::path::to::`my_long_function_name`].
In essence, I propose that as a preprocessing step we transform Markdown links of the form
[ <PRIVATE_PATH> :: ` <PUBLIC_PATH> ` ]
into
[ ` <PUBLIC_PATH> ` ] ( <PRIVATE_PATH> :: <PUBLIC_PATH> )
This makes writing links a lot more convenient in general, and less error prone. Two more examples, also highlighting the possibility to partially ignore a path:
[foo::`bar`] -> [`bar`](foo::bar)
[foo::`bar::baz`] -> [`bar::baz`](foo::bar::baz)
ibraheemdev
Metadata
Metadata
Assignees
Labels
A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameArea: Intra-doc links, the ability to link to items in docs by nameC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.