Rust: Broken links in `String` documentation from `Deref` impl

Created on 8 Mar 2016  路  15Comments  路  Source: rust-lang/rust

There are a bunch of links in the String documentation page which are broken. The reason for this is that most links are drawn from the documentation of the str type at /std/primitive.str.html but the String page is located at /std/string/struct.String.html. This mismatch in depth of paths causes a number of broken links, for example on the String::split method.

Not sure of the best way to fix this, but needs a tracking issue.

C-bug T-dev-tools T-rustdoc

Most helpful comment

This needs to be reopened. There are still broken links (e.g. #55666) and this issue can't be closed until the whitelist in linkchecker is removed: https://github.com/rust-lang/rust/blob/8315b11b6352cbd91ee096571c31ae7d3ac9613d/src/tools/linkchecker/main.rs#L134-L148

All 15 comments

It would be most awesome if there were some way to link to an item in Rustdoc, not just putting in a link URL, but that's perhaps out of scope for now. Maybe just some basic variable substitution, so you could write [foo]($htmlroot/bar/baz/foo.html)?

Yeah I suspect some basic substitution could work especially because we control the markdown rendering. I'd be a little wary to add API surface area to rustdoc, but it seems minorly well motivated?

It seems pretty much required to put in some facility for linking without relative URLs, because Deref copies and pastes things around.

It would be nice if we could follow the work CommonMark is doing here, so we're not totally just inventing a new thing.

http://talk.commonmark.org/t/generic-directives-plugins-syntax/444 seems to be at least one relevant discussion.

That seems like a nice long-term solution, that'd have to be implemented in hoedown however.

There is an _old_ issue regarding this on their repo: https://github.com/hoedown/hoedown/issues/99

yes, I would like to move from hoedown to pulldown-cmark, personally.

Opened an issue for moving to pulldown-cmark: https://github.com/rust-lang/rust/issues/38400

This issue seems to block the testing of compiler docs: ref #46278

This needs to be reopened. There are still broken links (e.g. #55666) and this issue can't be closed until the whitelist in linkchecker is removed: https://github.com/rust-lang/rust/blob/8315b11b6352cbd91ee096571c31ae7d3ac9613d/src/tools/linkchecker/main.rs#L134-L148

This is fixed, closing it. Thanks :)

@Dylan-DPC I don't think it was (unless the nightly docs haven't been updated with the fix yet). In the String::split section, if you click on DoubleEndedIterator you end up in a 404.

It might be useful to have a tracking issue for all of the causes of broken links (maybe reuse this one?), because there are dozens of broken links, and I think some are for different reasons. It'd be nice to have a goal to remove the linkchecker whitelist. I'd guess most of them are waiting for intra-rustdoc-links to handle all the appropriate scenarios? It's not really clear what needs to be done.

Reopening until the exclusions in the link checker can be removed.

I think this was fixed in https://github.com/rust-lang/rust/pull/74485? Should this be closed?

Considering that all the String links seem to be fixed, I think it is good to close. It looks like there are plenty of other tracking issues for the last remaining broken links (like #63351 and #74481), so I think those are adequately tracked. Thanks everyone for putting all the work into intra-doc-links!

Was this page helpful?
0 / 5 - 0 ratings