New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Cargo feature descriptions #3485
base: master
Are you sure you want to change the base?
Conversation
@rustbot label +t-cargo |
I directly applied my more minor feedback that did not change the characteristic of the RFC.
@tgross35 thanks for the access. Definitely makes it handy for the more trivial feedback. |
- Rather than being consistent with `rustdoc` and accepting markdown, should the | ||
`doc` key be consistent with `package.description` and only support plain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wanted to highlight this for discussion. My main interest is in being able to show summaries in cargo add
. Might be good to reach out to @kornelski for what they have seen of how features are documented through the ecosystem as that might help show potential requirements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Package descriptions tend to use markdown `code`
and *emphasis*. Rust devs really like using `
everywhere. Even rustc uses `
in terminal error messages.
Markdown's goal is to look fine even when displayed as plain text.
You could define it as the first line being for CLI help, and the rest for docs. Analogous to how rustdoc handles doc comments.
|
||
This RFC describes a new key to under `features` in `Cargo.toml` for | ||
documentation. This will allow Cargo to display this information to the user and | ||
provide a way for `rustdoc` to eventually render this data (how this is rendered |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the issues is how rustdoc consumes the data. rust doc generally knows nothing about Cargo.toml
. I would suggest taking #3123 as a reference to start a discussion on cargo-rustdoc integration of this. It doesn't need to be perfect but at least two teams should have some consensus.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did bring it up when I initially proposed this feature, https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Descriptions.20for.20feature.20flags and then opened a draft RFC suggesting that rustdoc
accept JSON configuration, which Cargo could pass it #3421. That didn't get too much traction, though. I will start that discussion back up
This is allowed in [`rust-lang/rust`](https://github.com/rust-lang/rust/blob/62d9034a0d571b78e518727d6cb4b090569e5238/triagebot.toml#L12). Others have also expected it to work here: - rust-lang#3490 (comment) - rust-lang#3485 (comment) @rustbot label not-rfc
Rendered
RFC for
feature-documentation
RFC goals: add a way to write feature descriptions in Cargo.toml
This was split from #3416
This would resolve rust-lang/cargo#4956