Skip to content
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

[Merged by Bors] - Examples metadata in Cargo.toml #4741

Closed
wants to merge 57 commits into from

Conversation

mockersf
Copy link
Member

@mockersf mockersf commented May 14, 2022

Objective

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

@mockersf mockersf added A-Build-System Related to build systems or continuous integration C-Examples An addition or correction to our examples labels May 14, 2022
@IceSentry
Copy link
Contributor

IceSentry commented May 14, 2022

I like the idea.

Assuming it gets merged, would it be possible to use the comments added in #4438 for the description?

This way there would be no duplication at all.

@mockersf
Copy link
Member Author

mockersf commented May 14, 2022

Looking at a few of the doc added in #4438, some would be too long, some contains intra doc links that would just fail without rust-analyser or rustdoc. I don't think the description here and the doc there have the same goal, so probably not

Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we can, I'd really like to be able to auto-generate the table of contents and store it on a useful site. I'm sick of updating the README file and it gets really unwieldy to navigate.

Tags and search would both be incredible.

@alice-i-cecile
Copy link
Member

@mockersf can you mark this as draft until it's ready so the "stuff to review" search filters work correctly?

@mockersf mockersf marked this pull request as draft May 14, 2022 01:12
@mockersf
Copy link
Member Author

If we can, I'd really like to be able to auto-generate the table of contents and store it on a useful site. I'm sick of updating the README file and it gets really unwieldy to navigate.

I may do that sooner than I expected as I can't find a way to cleanly push a commit to a PR without a token...

I think I'll create a full crate for examples, each example a module, and build its doc with the dev doc website...

@cart
Copy link
Member

cart commented Jun 22, 2022

I'm fully on board for consolidating example metadata into Cargo.toml, but I'm not a fan of adding more "auto-generated" commits. They introduce noise into our commit history, decouple "commit" from "pr" (which for a long time have been synonymous), and just generally leave me feeling a bit uncomfortable.

Instead, I think we should generate an "examples" page on the bevy website using Cargo.toml metadata, remove the current examples readme, and replace all links to the examples readme with links to the new generated bevyengine.org page.

@mockersf
Copy link
Member Author

mockersf commented Jun 24, 2022

I'm fully on board for consolidating example metadata into Cargo.toml, but I'm not a fan of adding more "auto-generated" commits. They introduce noise into our commit history, decouple "commit" from "pr" (which for a long time have been synonymous), and just generally leave me feeling a bit uncomfortable.

👍 I'll remove that part to just leave a job checking if the page need to be regenerated, and logging what to do

Instead, I think we should generate an "examples" page on the bevy website using Cargo.toml metadata, remove the current examples readme, and replace all links to the examples readme with links to the new generated bevyengine.org page.

I agree, but I think this is quite a lot more work. The examples page is the second step in bevyengine/bevy-website#299, this PR would be just the first step. Just replacing the manually updated readme by a file updated by a tera template is a start in the right direction that isn't a lot of work when we'll remove it for a better website.

@mockersf mockersf marked this pull request as ready for review June 25, 2022 11:10
Copy link
Member

@cart cart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the current state of things!

  • Ensures the new metadata system is adopted
  • Removes the need to redundantly define information (thanks to the update command)
  • Works within the confines of the current README system while we wait for a bevy-website solution

@cart
Copy link
Member

cart commented Jun 25, 2022

bors r+

bors bot pushed a commit that referenced this pull request Jun 25, 2022
# 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 <[email protected]>
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Jun 25, 2022
@bors bors bot changed the title Examples metadata in Cargo.toml [Merged by Bors] - Examples metadata in Cargo.toml Jun 25, 2022
@bors bors bot closed this Jun 25, 2022
inodentry pushed a commit to IyesGames/bevy that referenced this pull request Aug 8, 2022
# 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 <[email protected]>
james7132 pushed a commit to james7132/bevy that referenced this pull request Oct 28, 2022
# 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 <[email protected]>
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# 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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Build-System Related to build systems or continuous integration C-Examples An addition or correction to our examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants