bevy-website icon indicating copy to clipboard operation
bevy-website copied to clipboard

Add banner to warn user of required feature flags for examples

Open Sigma-dev opened this issue 1 month ago • 1 comments

As a user, it kinda sucks copying a website example only to see it not working and with unhelpful rust errors.

Some examples do mention it in their description, but it's not universal and can be forgotten. It's also easy to miss.

My solution is to add a warning banner that lists out the optional feature flags that are required for the example to work (no banner if no required features).

The information is collected from the required_features specified in the root Cargo.toml of the bevy engine. This data is not yet available to the website so I made another PR in bevy to make it available: https://github.com/bevyengine/bevy/pull/21975.

EDIT: The required change has now been merged, this is ready to go

Feel free to give feedback on the wording or anything else.

This is how it would look: image

Sigma-dev avatar Nov 29 '25 21:11 Sigma-dev

blocked until the 0.18 is released

mockersf avatar Dec 04 '25 20:12 mockersf

I wanted to get an example of multiple feature flags being enabled before approving, just to double check the behavior. I ended up spoofing the behavior, but it works as advertised. Looks good!

image

Rodhlann avatar Dec 07 '25 08:12 Rodhlann