-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Tracking Issue for doc_label_trait #156865
Copy link
Copy link
Open
Labels
A-rustdoc-uiArea: Rustdoc UI (generated HTML)Area: Rustdoc UI (generated HTML)C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.T-rustdoc-frontendRelevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Metadata
Metadata
Assignees
Labels
A-rustdoc-uiArea: Rustdoc UI (generated HTML)Area: Rustdoc UI (generated HTML)C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.T-rustdoc-frontendRelevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Feature gate:
#![feature(doc_label_trait)]This is a tracking issue for allowing users to mark arbitrary traits to be displayed more prominently in rustdoc.
Prototype: https://docs.rs/bevy_docs_extension_demo.
Public API
Steps / History
(Remember to update the
S-tracking-*label when checking boxes.)More context
From https://thierryberger.com/blog/rustdoc-notable-trait/.
offline copy in case above link goes dead.
Trait-heavy framework APIs (Bevy, but also Diesel, axum, embedded HALs) have poor discoverability in default rustdoc. From a type page it is hard to answer: is this a
Component? aResource?Trait impls are listed flatly, far from the type's header, and conceptual grouping of items by trait role does not exist.
Bevy has been experimenting with augmenting rustdoc output to surface these concepts. Let's see what you think!
Our approach today
Component,Resource,Asset...).Controversial
Resourceis also aComponent, but a user isn't usually interested in knowing that it's aComponent)How it's implemented
The current implementation is JavaScript shipped from the crate that mutates rustdoc's generated DOM at load time. It works, but:
Additional context
Maintenance of the JS approach
Abandoned ideas
Require<C>marker trait: abusing trait markers to "tag" components, too noisy.Unresolved Questions
doc(label_trait_color = "#ff0000")is enough to infer its existence.doc(label_trait(color="#ff0000"))]notable_trait?Rustdoc keeps a list of a few traits that are believed to be "fundamental" to types that implement them.Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩