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

docs - annotate objects who depend on features #553

Merged
merged 2 commits into from
Feb 27, 2024

Conversation

jonaspleyer
Copy link
Contributor

This approach was copied from other crates such as syn https://github.com/dtolnay/syn/ where the doc_cfg flag is enabled by the compiler when generating docs in order to annotate which feature enables which objects or methods.

Try it out

To try out this change a nightly compiler is required (which is used by docs.rs).
However, unrelated to this problem there is a bug in pathfinder which prohibits building with the newest nightly compiler.
A fix is on the way servo/pathfinder#557.
Thus we use a slightly older version

rustup update nightly-2024-02-01
# This command has to be executed in the ./plotters/ subdir
cd ./plotters
cargo +nightly-2024-02-01 rustdoc --all-features -- --cfg doc_cfg

Visit plotters::prelude to see some of these annotations and compare with https://docs.rs/syn/latest/syn/.

@jonaspleyer jonaspleyer changed the title annotate objects wihch depend feature in docs.rs with experimental doc_cfg flag docs - annotate objects by features with doc_cfg Feb 25, 2024
@jonaspleyer jonaspleyer changed the title docs - annotate objects by features with doc_cfg docs - annotate objects who depend on features Feb 25, 2024
Copy link
Member

@AaronErhardt AaronErhardt left a comment

Choose a reason for hiding this comment

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

Looks good, just one thing was looking wrong to me.

plotters/src/lib.rs Show resolved Hide resolved
Copy link
Member

@AaronErhardt AaronErhardt left a comment

Choose a reason for hiding this comment

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

Thanks!

@AaronErhardt AaronErhardt merged commit b42a78e into plotters-rs:master Feb 27, 2024
17 checks passed
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