-
Notifications
You must be signed in to change notification settings - Fork 352
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
tracking issue: examples #299
Comments
I love these ideas. Is there a good way to specify custom per-example metadata in Cargo.toml? I think id prefer that if its possible. If not, a single centralized file for this config has my preference. I dont want to throw a bunch of metadata in custom per file header format, or have a bunch of per-example config files. That could be weird/confusing for users. |
It's possible to add any field we want in the [[example]]
name = "3d_scene"
path = "examples/3d/3d_scene.rs"
display_name = "3D Scene"
description = "Simple 3D scene with basic shapes and lighting" but this issues warnings:
|
I posted https://internals.rust-lang.org/t/cargo-manifest-and-unused-manifest-key-allow-other-tools-to-extend-the-manifest/16333 as that would be the best solution if only there was a way to remove that warning |
Maybe we could use this: https://doc.rust-lang.org/cargo/reference/manifest.html#the-metadata-table? [[example]]
name = "3d_scene"
path = "examples/3d/3d_scene.rs"
[package.metadata.example.3d_scene]
display_name = "3D Scene"
description = "Simple 3D scene with basic shapes and lighting" |
Sadly a bit verbose + redundant ( |
I would love for this to work: [[example]]
name = "3d_scene"
path = "examples/3d/3d_scene.rs"
[example.metadata]
display_name = "3D Scene"
description = "Simple 3D scene with basic shapes and lighting" Array of Tables: Any reference to an array of tables points to the most recently defined table element of the array. This allows you to define sub-tables, and even sub-arrays of tables, inside the most recent table. That means the metadata field would refer to the example defined just above I looked a little into cargo code, it wouldn't be hard to add, I'll check if they would accept a PR for that |
# Objective - Have information about examples only in one place that can be used for the repo and for the website (and remove the need to keep a list of example to build for wasm in the website https://github.com/bevyengine/bevy-website/blob/75acb730406ef9c5928d37daf8bb32e4dbeb8b13/generate-wasm-examples/generate_wasm_examples.sh#L92-L99) ## Solution - Add metadata about examples in `Cargo.toml` - Build the `examples/README.md` from a template using those metadata. I used tera as the template engine to use the same tech as the website. - Make CI fail if an example is missing metadata, or if the readme file needs to be updated (the command to update it is displayed in the failed step in CI) ## Remaining To Do - After the next release with this merged in, the website will be able to be updated to use those metadata too - I would like to build the examples in wasm and make them available at http://dev-docs.bevyengine.org/ but that will require more design - bevyengine/bevy-website#299 for other ToDos Co-authored-by: Readme <github-actions@github.com>
# Objective - Have information about examples only in one place that can be used for the repo and for the website (and remove the need to keep a list of example to build for wasm in the website https://github.com/bevyengine/bevy-website/blob/75acb730406ef9c5928d37daf8bb32e4dbeb8b13/generate-wasm-examples/generate_wasm_examples.sh#L92-L99) ## Solution - Add metadata about examples in `Cargo.toml` - Build the `examples/README.md` from a template using those metadata. I used tera as the template engine to use the same tech as the website. - Make CI fail if an example is missing metadata, or if the readme file needs to be updated (the command to update it is displayed in the failed step in CI) ## Remaining To Do - After the next release with this merged in, the website will be able to be updated to use those metadata too - I would like to build the examples in wasm and make them available at http://dev-docs.bevyengine.org/ but that will require more design - bevyengine/bevy-website#299 for other ToDos Co-authored-by: Readme <github-actions@github.com>
# Objective - Have information about examples only in one place that can be used for the repo and for the website (and remove the need to keep a list of example to build for wasm in the website https://github.com/bevyengine/bevy-website/blob/75acb730406ef9c5928d37daf8bb32e4dbeb8b13/generate-wasm-examples/generate_wasm_examples.sh#L92-L99) ## Solution - Add metadata about examples in `Cargo.toml` - Build the `examples/README.md` from a template using those metadata. I used tera as the template engine to use the same tech as the website. - Make CI fail if an example is missing metadata, or if the readme file needs to be updated (the command to update it is displayed in the failed step in CI) ## Remaining To Do - After the next release with this merged in, the website will be able to be updated to use those metadata too - I would like to build the examples in wasm and make them available at http://dev-docs.bevyengine.org/ but that will require more design - bevyengine/bevy-website#299 for other ToDos Co-authored-by: Readme <github-actions@github.com>
# Objective - Have information about examples only in one place that can be used for the repo and for the website (and remove the need to keep a list of example to build for wasm in the website https://github.com/bevyengine/bevy-website/blob/75acb730406ef9c5928d37daf8bb32e4dbeb8b13/generate-wasm-examples/generate_wasm_examples.sh#L92-L99) ## Solution - Add metadata about examples in `Cargo.toml` - Build the `examples/README.md` from a template using those metadata. I used tera as the template engine to use the same tech as the website. - Make CI fail if an example is missing metadata, or if the readme file needs to be updated (the command to update it is displayed in the failed step in CI) ## Remaining To Do - After the next release with this merged in, the website will be able to be updated to use those metadata too - I would like to build the examples in wasm and make them available at http://dev-docs.bevyengine.org/ but that will require more design - bevyengine/bevy-website#299 for other ToDos Co-authored-by: Readme <github-actions@github.com>
Here is an updated checklist:
|
#225 introduced a new page for wasm examples at https://bevyengine.org/examples/
This page is currently lacking in style and not linked from the website. I think it should be the main page for example discovery instead of the git repo:
So... in case it's not clear, I think it would be easier.
What would be needed to get it in top shape:
This should be tied with #159 (bevy assets page) to evolve a consistent style.
The first two points need to be done before a release, the two next with that release
The text was updated successfully, but these errors were encountered: