Skip to content

Commit

Permalink
fail when an example doesn't set doc-scrape-examples (bevyengine#12964)
Browse files Browse the repository at this point in the history
# Objective

- Ensure that all examples are scrapped for doc

## Solution

- Panic in the example tool when an example doesn't specify
`doc-scrape-examples`
- If an example must not be scrapped, it can set the value to false
  • Loading branch information
mockersf authored Apr 14, 2024
1 parent 0256dac commit 62f2a73
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/build-templated-pages/src/examples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ fn parse_examples(panic_on_missing: bool) -> Vec<Example> {
if panic_on_missing && metadatas.get(&technical_name).is_none() {
panic!("Missing metadata for example {technical_name}");
}
if panic_on_missing && val.get("doc-scrape-examples").is_none() {
panic!("Example {technical_name} is missing doc-scrape-examples");
}

if metadatas
.get(&technical_name)
Expand Down

0 comments on commit 62f2a73

Please sign in to comment.