rust-playground icon indicating copy to clipboard operation
rust-playground copied to clipboard

Document the `playground` Cargo metadata

Open dns2utf8 opened this issue 8 years ago • 3 comments

Hey team

I made a test with the shiny new tool: https://play.rust-lang.org/?gist=118112c0ca3014d3683dfd6db7fa99ef&version=stable

Can you enable some the features for the crate?

dns2utf8 avatar Jul 28 '17 19:07 dns2utf8

Can you enable some the features for the crate?

No, we do not wish to have anything to do with how any particular crate is exposed. Instead, you can add the playground feature to the libraries Cargo.toml. Here's how Serde does it.

note that this method no longer works. You want to use https://github.com/integer32llc/rust-playground/issues/192#issuecomment-388589736 instead

shepmaster avatar Jul 29 '17 14:07 shepmaster

I'm going to repurpose this issue for adding documentation about this feature.

shepmaster avatar Jul 29 '17 14:07 shepmaster

From #326

This is based on the custom metadata configurable for docs.rs -- see https://docs.rs/about. Ours looks like:

# Cargo.toml
[package]
name = "test"

[package.metadata.playground]
default-features = true
features = ["std", "extra-traits"]
all-features = false

shepmaster avatar May 12 '18 23:05 shepmaster