Skip to content

Add support for fragment specifiers in intra-doc-links #51284

Closed
@Manishearth

Description

@Manishearth

It should be possible to link to things like https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#indexing via [Vec#indexing].

This is pretty straightforward to implement. We already track fragment specifiers for things like methods and enum variants, which we extract here. What we can do additionally is when parsing if we come across #foo, strip it out, continue resolution, and if the resolved thing doesn't already have a fragment, use this instead.

I volunteer @sunjay to work on this, because he's the one who wanted this feature 😉

cc @QuietMisdreavus

Unsure if this needs an RFC.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions