Skip to content
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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Update text/3485-feature-documentation.md
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
  • Loading branch information
tgross35 and joshtriplett authored Jul 9, 2024
commit 326b4d961bec7e9128a67ea5c5d90ac2ef9f0a49
9 changes: 7 additions & 2 deletions text/3485-feature-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ for keeping feature definitions and documentation together.
[guide-level-explanation]: #guide-level-explanation

A new `doc` key will be allowed within a feature's table. This key provides a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming (not finding the past discussion on it)

  • doc mirrors #[doc(...)]
  • description mirrors package.description
  • documentation mirrors package.documentation (but that is a URL)

We also tend to not use abbreviations as much. For example, for public-private dependencies, we discussed using pub vs public and went with public

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@epage In my opinion, I think this should be doc.

I think we should encourage using this not just for a "description" of a feature but for "documentation" for a feature, and that's supported by the idea of it showing up in rustdoc and allowing markdown.

And I think there's a big difference in length between doc and documentation, compared to the difference between pub and public. (I personally would have gone with pub for that too, based on widespread usage of pub within Rust, but I also think public was less obtrusive because it's fewer characters.)

It's hard enough to get people to write documentation; let's not have any extra friction.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I personally would have gone with pub for that too, based on widespread usage of pub within Rust, but I also think public was less obtrusive because it's fewer characters.)

Personally, I'd prefer we be consistent and not just focusing on character count.

It's hard enough to get people to write documentation; let's not have any extra friction.

We've shot well past that by requiring a "long form" just to write documentation, hurting both discoverability, character count, and ease of not typing some of those characters on international keyboards.

markdown docstring describing the feature. Like with `#[doc(...)]`, the first
line will be treated as a summary.
markdown docstring describing the feature. The first paragraph
will be treated as a summary, and should be suitable to display
standalone without the rest of the description.

Don't include the name of the feature in the summary; tools
will typically already display this documentation alongside
the name of the feature.

```toml
[features]
Expand Down