Reorganize existing examples into "api"/"usage"/"games" #19279
+1,562
−1,219
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR reorganizes Bevy's examples for easier navigation and maintenance. It follows the new "API/Usage" categorization as described here.
Scope
The scope of this PR is:
README.md
file accordingly.TODO
examples/usage/
and categorize them in a way that makes sense. These are new categories, different from the ones for API examples.examples/stress_tests/
to top-levelstress-tests/
.examples/testbed/*
totests/
.examples/tools/
as is.examples/wasm/
andexamples/mobile/
as is.examples/api/
.Cargo.toml
accordingly.kind
field to[package.metadata.example.*]
sections.README.md
files for each example kind with their own tables of contents and example listings.examples/README.md
with brief descriptions of our example kinds and links to their READMEs.examples/mobile/README.md
andexamples/wasm/README.md
files and move the platform-specific info fromexamples/README.md
there.kind
andcategory
.@alice-i-cecile and I made many of these decisions together at the RustWeek Bevy Unconf and I have now done the relevant work.
That said, until this PR is merged, all of this is still open to community feedback. As this is a "bikesheddy" question, please try to provide substantial arguments if you suggest changes.
Remaining Questions
examples/testbed/
andtests/
currently and I don't know if it can simply be moved there or if anything needs to be changed.[[bin]]
targets or separate workspace packages, instead of[[example]]
inCargo.toml
for stress tests? For the tools examples? For testbeds?cargo run --bin
orcargo run -p
.Future Work
(out of scope for this PR)
examples/games/
) into multiple files to teach best practices and project structure.