cargo icon indicating copy to clipboard operation
cargo copied to clipboard

Documentation for `documentation` field is misleading

Open RalfJung opened this issue 2 years ago • 2 comments

The docs for the documentation field say

If no URL is specified in the manifest file, crates.io will automatically link your crate to the corresponding docs.rs page.

This sounds as if setting no URL is equivalent to setting the docs.rs URL. That is however not the case: in the crates.io search result list, the "Documentation" link will only show up if documentation is explicitly set in the toml file.

I am not sure if this is a bug in the cargo docs or the crates.io frontend, but it is certainly surprising.

RalfJung avatar Feb 27 '23 14:02 RalfJung

Seeing as the individual crate pages will list documentation, I would personally chalk this up as a crates.io bug.

From #11685, my suspicion is that this is either an optimization or an oversight. Apparently, adding the docs.rs link to the crate's page is done via Javascript and I imagine doing that for every crate on a search page might be a bit much.

epage avatar Feb 27 '23 15:02 epage

@rustbot label A-documenting-cargo-itself

heisen-li avatar Apr 09 '24 11:04 heisen-li

This should be reopened since https://github.com/rust-lang/cargo/pull/14562 got reverted.

RalfJung avatar Sep 19 '24 06:09 RalfJung