While reading documentation, especially when discovering the API of a new crate, I got the impression that human readers could get an easier understanding of the referenced items if they were appropriately highlighted.
Currently, all links to other documented items within a ///
or //!
block are rendered as yellow, the default link color var(--link-color
)`.
In structured overviews, on the other hand, links to each item type get a specific CSS class like mod
, fn
, macro
, type
, primitive
etc. assigned - causing these items to be colored distinctly according to their item type.
Applying the same highlighting in ///
and //!
blocks would help human readers in disambiguating fn
s from mod
s from macro
s and so on, without requiring all fn
s to be suffixed by ()
and all macro
s to be suffixed by !
(which is neither enforced, nor even recommended as best practice). Suffixes are furthermore not available for disambiguation between modules and primitives.
Since rustdoc already gathers all information about the linked item (determining the target URL), implementation should be rather trivial.
If the feature is receiving interest, then I would try an implementation myself.