Skip to content

Improve documentation generation#554

Merged
Thomasdezeeuw merged 1 commit into
rust-lang:masterfrom
proski:doc-fixes
Feb 18, 2025
Merged

Improve documentation generation#554
Thomasdezeeuw merged 1 commit into
rust-lang:masterfrom
proski:doc-fixes

Conversation

@proski

@proski proski commented Feb 15, 2025

Copy link
Copy Markdown
Contributor

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

proski commented Feb 15, 2025

Copy link
Copy Markdown
Contributor Author

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

proski commented Feb 16, 2025

Copy link
Copy Markdown
Contributor Author

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

@Thomasdezeeuw Thomasdezeeuw left a comment

Copy link
Copy Markdown
Collaborator

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.

Comment thread 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
Copy Markdown
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

proski commented Feb 17, 2025

Copy link
Copy Markdown
Contributor Author
  • Added default-target
  • Sorted the targets alphabetically
  • Rebased

@Thomasdezeeuw Thomasdezeeuw merged commit 62479f7 into rust-lang:master Feb 18, 2025
@Thomasdezeeuw

Copy link
Copy Markdown
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