plotters icon indicating copy to clipboard operation
plotters copied to clipboard

docs - annotate objects who depend on features

Open jonaspleyer opened this issue 1 year ago • 0 comments

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 https://github.com/servo/pathfinder/pull/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 avatar Feb 25 '24 16:02 jonaspleyer