-
Notifications
You must be signed in to change notification settings - Fork 409
Add banner to warn user of required feature flags for examples #2313
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
base: main
Are you sure you want to change the base?
Add banner to warn user of required feature flags for examples #2313
Conversation
# Objective This PR is a sister PR necessary for the website to have `required_features` data. You will find more information on the motivations there: bevyengine/bevy-website#2313 ## Solution - Add the required_features data to the examples docs export ## Testing I tested both together and it worked fine
templates/layouts/example.html
Outdated
| </aside> | ||
| {% if page.extra.required_features %} | ||
| <aside class="callout callout--warning"> | ||
| <h3 class="warning">Optional feature flag</h3> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having this header text as "Optional feature flag" is confusing. If I am understanding this issue correctly the feature flag is not optional for this example, which is described with added clarity below.
Maybe "Feature flag required for example" or "Feature flag details" provide more clarity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, I think "Feature flag required" is a better name, I will make the change
|
blocked until the 0.18 is released |

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.tomlof the bevy engine.This data is not yet available to the website so I made another PR in bevy to make it available: bevyengine/bevy#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:
