rust-lang / rust-lang/rfcs

Feature request: `#[doc(canonical)]`

Open
#3,011 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

T-rustdoc
Dominant language
Markdown
Stars
6.6k
Forks
1.7k
Avg merge
16h 14m
Merged PRs (30d)
1

Description

I don't have time for a full write-up of this right now, so I'm just opening an issue so I have somewhere to point people when they open rustdoc issues.

Motivation:

doc(canonical) could tell rustdoc the 'one true path' the item should appear at.

Possible difficulties:

  • doc(canonical) is necessarily unique across all crates. rustdoc should give an error if it's duplicated.
  • rustdoc currently stores search-index.json per-crate. This will need a redesign if rustdoc only know to hide the item after the documentation has been generated and it goes onto the next crate

Unresolved questions:

  • Does inlining still make sense with doc(canonical)? Should all other usages just link to the canonical crate? How does this work if the canonical usage is in a reverse-dependency?

cc @camelid

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked rustdoc issues on duplicated search items, original-definition links, and re-export links. Then review the proposed doc(canonical) behavior, including duplicate detection and the per-crate search-index.json design. Done requires resolving the listed inlining and reverse-dependency questions and producing a complete design.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.