Skip to content

Improve documentation generation #554

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

Merged
merged 1 commit into from
Feb 18, 2025
Merged

Conversation

proski
Copy link
Contributor

@proski proski commented Feb 15, 2025

Make x86_64-unknown-linux-gnu the default target, as it's more feature rich.
Users may not realize that they can select their platform on docs.rs, so it's
better to show them more extensive documentation.

Don't pass --cfg docsrs to rustdoc for docs.rs builds, it's already passed by
docs.rs.

Generate documentation about supported platforms automatically from the cfg
attributes.

@proski proski marked this pull request as draft February 15, 2025 23:07
@proski
Copy link
Contributor Author

proski commented Feb 15, 2025

Making it draft for now. There is good stuff in this PR, but it might need to be split. Besides, it looks like there are pre-existing clippy issues.

@proski proski changed the title New feature rustdoc_use_unstable to use unstable rustdoc features Improve documentation generation Feb 16, 2025
@proski
Copy link
Contributor Author

proski commented Feb 16, 2025

Simplified, PR updated. No new feature is needed anymore. Ready for review. The clippy failure is addressed in #555.

@proski proski marked this pull request as ready for review February 16, 2025 00:10
Copy link
Collaborator

@Thomasdezeeuw Thomasdezeeuw left a comment

Choose a reason for hiding this comment

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

Nice!

One comment, but LGTM otherwise.

Cargo.toml Outdated
rustdoc-args = ["--cfg", "docsrs"]
targets = ["aarch64-apple-ios", "aarch64-linux-android", "x86_64-apple-darwin", "x86_64-unknown-fuchsia", "x86_64-pc-windows-msvc", "x86_64-pc-solaris", "x86_64-unknown-freebsd", "x86_64-unknown-illumos", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-unknown-netbsd", "x86_64-unknown-redox", "armv7-linux-androideabi", "i686-linux-android"]
targets = [
"x86_64-unknown-linux-gnu",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's keep this list sorted and set default-target instead, see https://docs.rs/about/metadata.

Make `x86_64-unknown-linux-gnu` the default target, as it's more feature rich.
Users may not realize that they can select their platform on docs.rs, so it's
better to show them more extensive documentation.

Don't pass `--cfg docsrs` to rustdoc for docs.rs builds, it's already passed by
docs.rs.

Generate documentation about supported platforms automatically from the `cfg`
attributes.
@proski
Copy link
Contributor Author

proski commented Feb 17, 2025

  • Added default-target
  • Sorted the targets alphabetically
  • Rebased

@Thomasdezeeuw Thomasdezeeuw merged commit 62479f7 into rust-lang:master Feb 18, 2025
42 of 43 checks passed
@Thomasdezeeuw
Copy link
Collaborator

Thanks @proski!

@proski proski deleted the doc-fixes branch February 19, 2025 22:15
Hasan6979 pushed a commit to NordSecurity/socket2 that referenced this pull request May 15, 2025
Make `x86_64-unknown-linux-gnu` the default target, as it's more feature rich.
Users may not realize that they can select their platform on docs.rs, so it's
better to show them more extensive documentation.

Don't pass `--cfg docsrs` to rustdoc for docs.rs builds, it's already passed by
docs.rs.

Generate documentation about supported platforms automatically from the `cfg`
attributes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants