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

Clean up the book structure #881

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 16 additions & 20 deletions code-validation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ mod learn {
mod hot_reloading {}
#[doc = include_str!("../../content/learn/book/assets/loading-assets/_index.md")]
mod loading_assets {}
#[doc = include_str!("../../content/learn/book/assets/scenes/_index.md")]
mod scenes {}
#[doc = include_str!("../../content/learn/book/assets/scenes-reflection/_index.md")]
mod scenes_reflection {}
#[doc = include_str!("../../content/learn/book/assets/working-with-handles/_index.md")]
mod working_with_handles {}
}
Expand Down Expand Up @@ -49,28 +49,24 @@ mod learn {
mod ecs {
#[doc = include_str!("../../content/learn/book/ecs/commands/_index.md")]
mod commands {}
#[doc = include_str!("../../content/learn/book/ecs/detecting-changes/_index.md")]
mod detecting_changes {}
#[doc = include_str!("../../content/learn/book/ecs/ecs-magic/_index.md")]
mod ecs_magic {}
#[doc = include_str!("../../content/learn/book/ecs/change-detection/_index.md")]
mod change_detection {}
#[doc = include_str!("../../content/learn/book/ecs/entities-components/_index.md")]
mod entities_components {}
#[doc = include_str!("../../content/learn/book/ecs/exclusive-world-access/_index.md")]
mod exclusive_world_access {}
#[doc = include_str!("../../content/learn/book/ecs/queries/_index.md")]
mod queries {}
#[doc = include_str!("../../content/learn/book/ecs/systems-queries/_index.md")]
mod systems_queries {}
#[doc = include_str!("../../content/learn/book/ecs/resources/_index.md")]
mod resources {}
#[doc = include_str!("../../content/learn/book/ecs/systems/_index.md")]
mod systems {}
}

#[doc = include_str!("../../content/learn/book/game-logic/_index.md")]
mod game_logic {
#[doc = include_str!("../../content/learn/book/game-logic/async-tasks/_index.md")]
mod async_tasks {}
#[doc = include_str!("../../content/learn/book/game-logic/custom-execution/_index.md")]
mod custom_execution {}
#[doc = include_str!("../../content/learn/book/game-logic/custom-runners-headless-operations/_index.md")]
mod custom_runners_headless_operation {}
#[doc = include_str!("../../content/learn/book/game-logic/events/_index.md")]
mod events {}
#[doc = include_str!("../../content/learn/book/game-logic/run-criteria/_index.md")]
Expand All @@ -79,8 +75,8 @@ mod learn {
mod states {}
#[doc = include_str!("../../content/learn/book/game-logic/system-ordering/_index.md")]
mod system_ordering {}
#[doc = include_str!("../../content/learn/book/game-logic/time/_index.md")]
mod time {}
#[doc = include_str!("../../content/learn/book/game-logic/time-timers/_index.md")]
mod time_timers {}
}

#[doc = include_str!("../../content/learn/book/graphics/_index.md")]
Expand Down Expand Up @@ -110,16 +106,16 @@ mod learn {
}
#[doc = include_str!("../../content/learn/book/graphics/transforms/_index.md")]
mod transforms {}
#[doc = include_str!("../../content/learn/book/graphics/windowing/_index.md")]
mod windowing {}
#[doc = include_str!("../../content/learn/book/graphics/windows/_index.md")]
mod windows {}
}

#[doc = include_str!("../../content/learn/book/input/_index.md")]
mod input {
#[doc = include_str!("../../content/learn/book/input/gamepad/_index.md")]
mod gamepad {}
#[doc = include_str!("../../content/learn/book/input/input-basics/_index.md")]
mod input_basics {}
#[doc = include_str!("../../content/learn/book/input/basics/_index.md")]
mod basics {}
#[doc = include_str!("../../content/learn/book/input/keyboard/_index.md")]
mod keyboard {}
#[doc = include_str!("../../content/learn/book/input/mouse/_index.md")]
Expand Down Expand Up @@ -155,8 +151,8 @@ mod learn {

#[doc = include_str!("../../content/learn/book/ui/_index.md")]
mod ui {
#[doc = include_str!("../../content/learn/book/ui/ui-basics/_index.md")]
mod ui_basics {}
#[doc = include_str!("../../content/learn/book/ui/basics/_index.md")]
mod basics {}
}

#[doc = include_str!("../../content/learn/book/welcome/_index.md")]
Expand Down
6 changes: 6 additions & 0 deletions content/learn/advanced-examples/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
+++
title = "Advanced Examples"
template = "docs-section.html"
[extra]
public_draft = 877
+++
5 changes: 5 additions & 0 deletions content/learn/advanced-examples/sudoku/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
+++
title = "Sudoku"
weight = 2
template = "docs-section.html"
+++
5 changes: 5 additions & 0 deletions content/learn/advanced-examples/text-adventure/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
+++
title = "Text Adventure"
weight = 1
template = "docs-section.html"
+++
2 changes: 1 addition & 1 deletion content/learn/book/assets/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = "Assets"
weight = 5
weight = 6
sort_by = "weight"
template = "docs-section.html"
page_template = "docs-section.html"
Expand Down
2 changes: 1 addition & 1 deletion content/learn/book/assets/custom-assets/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title = "Custom assets"
title = "Custom Assets"
weight = 3
sort_by = "weight"
template = "docs-section.html"
Expand Down
2 changes: 1 addition & 1 deletion content/learn/book/assets/hot-reloading/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title = "Hot reloading"
title = "Hot Reloading"
weight = 4
sort_by = "weight"
template = "docs-section.html"
Expand Down
2 changes: 1 addition & 1 deletion content/learn/book/assets/loading-assets/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title = "Loading assets"
title = "Loading Assets"
weight = 1
sort_by = "weight"
template = "docs-section.html"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title = "Scenes and reflection"
title = "Scenes and Reflection"
weight = 5
sort_by = "weight"
template = "docs-section.html"
Expand Down
2 changes: 1 addition & 1 deletion content/learn/book/assets/working-with-handles/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title = "Working with handles"
title = "Working With Handles"
weight = 2
sort_by = "weight"
template = "docs-section.html"
Expand Down
2 changes: 1 addition & 1 deletion content/learn/book/audio/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = "Audio"
weight = 7
weight = 8
sort_by = "weight"
template = "docs-section.html"
page_template = "docs-section.html"
Expand Down
4 changes: 2 additions & 2 deletions content/learn/book/development-practices/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = "Development practices"
weight = 9
title = "Development Practices"
weight = 10
sort_by = "weight"
template = "docs-section.html"
page_template = "docs-section.html"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title = "Boilerplate reduction"
title = "Boilerplate Reduction"
weight = 5
sort_by = "weight"
template = "docs-section.html"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title = "Error handling"
title = "Error Handling"
weight = 4
sort_by = "weight"
template = "docs-section.html"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title = "Fast compiles"
title = "Fast Compiles"
weight = 2
sort_by = "weight"
template = "docs-section.html"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title = "Organizing your code"
title = "Organizing Your Code"
weight = 1
sort_by = "weight"
template = "docs-section.html"
Expand Down
2 changes: 1 addition & 1 deletion content/learn/book/ecs/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title = "Entities, components and systems"
title = "Entities, Components and Systems"
weight = 2
sort_by = "weight"
template = "docs-section.html"
Expand Down
5 changes: 5 additions & 0 deletions content/learn/book/ecs/change-detection/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
+++
title = "Reliable Change Detection"
weight = 6
template = "docs-section.html"
+++
4 changes: 2 additions & 2 deletions content/learn/book/ecs/commands/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = "Commands queue up work"
weight = 5
title = "Manipulating Entities With Commands"
weight = 4
template = "docs-section.html"
page_template = "docs-section.html"
insert_anchor_links = "right"
Expand Down
7 changes: 0 additions & 7 deletions content/learn/book/ecs/detecting-changes/_index.md

This file was deleted.

7 changes: 0 additions & 7 deletions content/learn/book/ecs/ecs-magic/_index.md

This file was deleted.

16 changes: 8 additions & 8 deletions content/learn/book/ecs/entities-components/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title = "Entities have components"
title = "Entities Have Components"
weight = 1
template = "docs-section.html"
page_template = "docs-section.html"
Expand All @@ -17,7 +17,7 @@ If you're an experienced programmer, you can reason about the [`World`] as somet
[`HashMap`]: https://doc.rust-lang.org/std/collections/struct.HashMap.html
[`World`]: https://docs.rs/bevy/latest/bevy/ecs/world/struct.World.html

## Spawning and despawning entities
## Spawning and Despawning Entities

Before you can do much of anything in Bevy, you'll need to **spawn** your first entity, adding it to the app's [`World`].
Once entities exist, they can likewise be despawned, deleting all of the data stored in their components and removing it from the world.
Expand All @@ -42,14 +42,14 @@ fn spawning_system(mut commands: Commands){

[`Commands`]: https://docs.rs/bevy/latest/bevy/ecs/system/struct.Commands.html

## Working with components
## Working With Components

Spawning an entity doesn't add any behavior or create a "physical object" in our game like it might in other engines.
Instead, all it does is provide us an [`Entity`] identifer for a collection of component data.

In order to make this useful, we need to be able to add, remove and modify component data for each entity.

### Defining components
### Defining Components

To define a component type, we simply implement the [`Component`] [trait](https://doc.rust-lang.org/book/ch10-02-traits.html) for a Rust type of our choice.
You will almost always want to use the `#[derive(Component)]` [macro](https://doc.rust-lang.org/reference/attributes/derive.html) to do this for you; which quickly and reliably generates the correct trait implementation.
Expand Down Expand Up @@ -85,7 +85,7 @@ enum Allegiance {

[`Component`]: https://docs.rs/bevy/latest/bevy/ecs/component/trait.Component.html

### Spawning entities with components
### Spawning Entities With Components

Now that we have some components defined, let's try adding them to our entities using [`Commands`].

Expand Down Expand Up @@ -144,7 +144,7 @@ fn spawn_combatants_system(mut commands: Commands) {
}
```

### Adding and removing components
### Adding and Removing Components

Once an entity is spawned, you can use [`Commands`] to add and remove components from them dynamically.

Expand Down Expand Up @@ -268,7 +268,7 @@ fn spawn_combatants_system(mut commands: Commands) {

[`Bundle`]: https://docs.rs/bevy/latest/bevy/ecs/bundle/trait.Bundle.html

### Nested bundles
### Nested Bundles

As your game grows further in complexity, you may find that you want to reuse various bundles across entities that share some but not all behavior.
One of the tools you can use to do so is **nested bundles**; embedding one bundle of components within another.
Expand Down Expand Up @@ -330,7 +330,7 @@ impl Default for CombatantBundle {
}
```

## Component design
## Component Design

Over time, the Bevy community has converged on a few standard pieces of advice for how to structure and define component data:

Expand Down
4 changes: 2 additions & 2 deletions content/learn/book/ecs/exclusive-world-access/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = "Exclusive world access"
weight = 7
title = "Exclusive World Access"
weight = 8
template = "docs-section.html"
page_template = "docs-section.html"
insert_anchor_links = "right"
Expand Down
5 changes: 5 additions & 0 deletions content/learn/book/ecs/filtering-queries/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
+++
title = "Filtering Queries"
weight = 5
template = "docs-section.html"
+++
5 changes: 5 additions & 0 deletions content/learn/book/ecs/generic-systems/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
+++
title = "Generic Systems"
weight = 7
template = "docs-section.html"
+++
2 changes: 1 addition & 1 deletion content/learn/book/ecs/resources/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title = "Resources are global singletons"
title = "Resources Are Global Singletons"
weight = 3
template = "docs-section.html"
page_template = "docs-section.html"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title = "Fetching data with queries"
title = "Systems Access Data Through Queries"
weight = 2
template = "docs-section.html"
page_template = "docs-section.html"
Expand Down
8 changes: 0 additions & 8 deletions content/learn/book/ecs/systems/_index.md

This file was deleted.

4 changes: 2 additions & 2 deletions content/learn/book/game-logic/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = "Game logic"
weight = 3
title = "Game Logic"
weight = 4
sort_by = "weight"
template = "docs-section.html"
page_template = "docs-section.html"
Expand Down
2 changes: 1 addition & 1 deletion content/learn/book/game-logic/async-tasks/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title = "Async tasks"
title = "Async Tasks"
weight = 6
sort_by = "weight"
template = "docs-section.html"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title = "Custom execution"
title = "Custom Runners and Headless Operation"
weight = 7
sort_by = "weight"
template = "docs-section.html"
Expand Down
2 changes: 1 addition & 1 deletion content/learn/book/game-logic/run-criteria/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title = "Run criteria"
title = "Run Criteria and Fixed Timestep"
weight = 5
sort_by = "weight"
template = "docs-section.html"
Expand Down
2 changes: 1 addition & 1 deletion content/learn/book/game-logic/system-ordering/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title = "System ordering"
title = "Stages and System Ordering"
weight = 1
template = "docs-section.html"
page_template = "docs-section.html"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title = "Time and timers"
title = "Time and Timers"
weight = 4
sort_by = "weight"
template = "docs-section.html"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
+++
title = "App, Appbuilder, and World"
weight = 3
template = "docs-section.html"
+++
Loading
Loading