Improve documentation generation#554
Merged
Merged
Conversation
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. |
rustdoc_use_unstable to use unstable rustdoc features
Contributor
Author
|
Simplified, PR updated. No new feature is needed anymore. Ready for review. The clippy failure is addressed in #555. |
Thomasdezeeuw
approved these changes
Feb 16, 2025
Thomasdezeeuw
left a comment
Collaborator
There was a problem hiding this comment.
Nice!
One comment, but LGTM otherwise.
| 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", |
Collaborator
There was a problem hiding this comment.
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.
Contributor
Author
|
Thomasdezeeuw
approved these changes
Feb 18, 2025
Collaborator
|
Thanks @proski! |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make
x86_64-unknown-linux-gnuthe 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 docsrsto rustdoc for docs.rs builds, it's already passed bydocs.rs.
Generate documentation about supported platforms automatically from the
cfgattributes.