Skip to content

Commit e5fbaba

Browse files
Changed no_mod = true to default: use show_mod instead
1 parent 7723a81 commit e5fbaba

File tree

12 files changed

+60
-58
lines changed

12 files changed

+60
-58
lines changed

content/learn/book/contributing/docs/_index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@ A local server should start and you should be able to access a local version of
3232

3333
We made an extension to the markdown syntax that makes linking to Rust API docs nicer. It also gives the links special formatting. Here are some examples:
3434

35-
* Full Type Path: {{rust_type(type="struct" crate="std", mod="collections", name="HashMap")}}
35+
* Full Type Path: {{rust_type(type="struct" crate="std", mod="collections", name="HashMap", show_mod=true)}}
3636

3737
```{{curly_open()}}{rust_type(type="struct" crate="std" mod="collections" name="HashMap")}{{curly_close()}}```
38-
* Short Type: {{rust_type(type="struct", crate="std" mod="collections", name="HashMap", no_mod=true)}}
38+
* Short Type: {{rust_type(type="struct", crate="std" mod="collections", name="HashMap")}}
3939
40-
```{{curly_open()}}{rust_type(type="struct" crate="std" mod="collections" name="HashMap" no_mod=true)}{{curly_close()}}```
41-
* Plural Type: {{rust_type(type="struct" crate="std" mod="collections" name="HashMap" no_mod=true plural=true)}}
40+
```{{curly_open()}}{rust_type(type="struct" crate="std" mod="collections" name="HashMap")}{{curly_close()}}```
41+
* Plural Type: {{rust_type(type="struct" crate="std" mod="collections" name="HashMap" plural=true)}}
4242
43-
```{{curly_open()}}{rust_type(type="struct" crate="std" mod="collections" name="HashMap" no_mod=true, plural=true)}{{curly_close()}}```
44-
* Function: {{rust_type(type="struct" crate="std" mod="collections" name="HashMap" no_mod=true method="insert")}}
43+
```{{curly_open()}}{rust_type(type="struct" crate="std" mod="collections" name="HashMap", plural=true)}{{curly_close()}}```
44+
* Function: {{rust_type(type="struct" crate="std" mod="collections" name="HashMap" method="insert")}}
4545
46-
```{{curly_open()}}{rust_type(type="struct" crate="std" mod="collections" name="HashMap" no_mod=true method="insert")}{{curly_close()}}```
46+
```{{curly_open()}}{rust_type(type="struct" crate="std" mod="collections" name="HashMap" method="insert")}{{curly_close()}}```
4747
* Module: {{rust_mod(crate="std" mod="collections")}}
4848
4949
```{{curly_open()}}{rust_mod(crate="std" mod="collections")}{{curly_close()}}```

content/learn/book/getting-started/apps/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ template = "book-section.html"
66
page_template = "book-section.html"
77
+++
88

9-
Bevy programs are referred to as {{rust_type(type="struct", crate="bevy_app", name="App", no_mod=true, plural=true)}}. The simplest Bevy app looks like this:
9+
Bevy programs are referred to as {{rust_type(type="struct", crate="bevy_app", name="App", plural=true)}}. The simplest Bevy app looks like this:
1010

1111
```rs
1212
use bevy::prelude::*;

content/learn/book/getting-started/ecs/_index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ fn main() {
5454
}
5555
```
5656

57-
Note the `hello_world.system()` function call. This is a "trait extension method" that converts the `hello_world` function into the {{rust_type(type="trait" crate="bevy_ecs" mod="system" no_mod=true name="System")}} type.
57+
Note the `hello_world.system()` function call. This is a "trait extension method" that converts the `hello_world` function into the {{rust_type(type="trait" crate="bevy_ecs" mod="system" name="System")}} type.
5858

59-
The {{rust_type(type="struct" crate="bevy_app", name="AppBuilder" method="add_system" no_struct=true)}} function adds the system to your App's {{rust_type(type="struct", crate="bevy_ecs", mod="schedule" no_mod=true name="Schedule")}}, but we'll cover that more later.
59+
The {{rust_type(type="struct" crate="bevy_app", name="AppBuilder" method="add_system" no_struct=true)}} function adds the system to your App's {{rust_type(type="struct", crate="bevy_ecs", mod="schedule" name="Schedule")}}, but we'll cover that more later.
6060

6161
Now run your App again using `cargo run`. You should see `hello world!` printed once in your terminal.
6262

@@ -76,7 +76,7 @@ But what if we want our people to have a name? In a more traditional design, we
7676
struct Name(String);
7777
```
7878

79-
We can then add `People` to our {{rust_type(type="struct" crate="bevy_ecs" mod="world" no_mod=true name="World")}} using a "startup system". Startup systems are just like normal systems, but they run exactly once, before all other systems, right when our app starts. Let's use {{rust_type(type="struct" crate="bevy_ecs" mod="system" no_mod=true name="Commands")}} to spawn some entities into our {{rust_type(type="struct" crate="bevy_ecs" mod="world" no_mod=true name="World")}}:
79+
We can then add `People` to our {{rust_type(type="struct" crate="bevy_ecs" mod="world" name="World")}} using a "startup system". Startup systems are just like normal systems, but they run exactly once, before all other systems, right when our app starts. Let's use {{rust_type(type="struct" crate="bevy_ecs" mod="system" name="Commands")}} to spawn some entities into our {{rust_type(type="struct" crate="bevy_ecs" mod="world" name="World")}}:
8080

8181
```rs
8282
fn add_people(mut commands: Commands) {
@@ -97,7 +97,7 @@ fn main() {
9797
}
9898
```
9999

100-
We could run this App now and the `add_people` system would run first, followed by `hello_world`. But our new people don't have anything to do yet! Let's make a system that properly greets the new citizens of our {{rust_type(type="struct" crate="bevy_ecs" mod="world" no_mod=true name="World")}}:
100+
We could run this App now and the `add_people` system would run first, followed by `hello_world`. But our new people don't have anything to do yet! Let's make a system that properly greets the new citizens of our {{rust_type(type="struct" crate="bevy_ecs" mod="world" name="World")}}:
101101

102102
```rs
103103
fn greet_people(query: Query<&Name, With<Person>>) {

content/learn/book/getting-started/plugins/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ You are free to use whatever approach suits you!
5050

5151
## Creating your first plugin
5252

53-
For better organization, let's move all of our "hello" logic to a plugin. To create a plugin we just need to implement the {{rust_type(type="trait" name="Plugin" crate="bevy_app" no_mod=true)}} interface. Add the following code to your `main.rs` file:
53+
For better organization, let's move all of our "hello" logic to a plugin. To create a plugin we just need to implement the {{rust_type(type="trait" name="Plugin" crate="bevy_app")}} interface. Add the following code to your `main.rs` file:
5454

5555
```rs
5656
pub struct HelloPlugin;

content/learn/book/introduction/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ template = "book-section.html"
66
page_template = "book-section.html"
77
+++
88

9+
{{rust_type(type="enum" crate="std" mod="rest" name="Option")}}
10+
911
If you came here because you wanted to learn how to make 2D / 3D games, visualizations, user interfaces, or other graphical applications with Bevy ... you came to the right place! If not, stick around anyway. I promise it will be fun.
1012

1113
<h2>

content/learn/book/migration-guides/0.4-0.5/_index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ fn foo(mut commands: Commands) {
2424

2525
Systems using the old `commands: &mut Commands` syntax in 0.5 will fail to compile when calling `foo.system()`.
2626

27-
This change was made because {{rust_type(type="struct" crate="bevy_ecs" mod="system" version="0.5.0" name="Commands" no_mod=true)}}
28-
now holds an internal {{rust_type(type="struct" crate="bevy_ecs" mod="world" version="0.5.0" name="World" no_mod=true)}}
27+
This change was made because {{rust_type(type="struct" crate="bevy_ecs" mod="system" version="0.5.0" name="Commands")}}
28+
now holds an internal {{rust_type(type="struct" crate="bevy_ecs" mod="world" version="0.5.0" name="World")}}
2929
reference to enable safe entity allocations.
3030

31-
Note: The internal {{rust_type(type="struct" crate="bevy_ecs" mod="world" version="0.5.0" name="World" no_mod=true)}} reference requires two lifetime parameters to pass Commands into a non-system function: `commands: &'a mut Commands<'b>`
31+
Note: The internal {{rust_type(type="struct" crate="bevy_ecs" mod="world" version="0.5.0" name="World")}} reference requires two lifetime parameters to pass Commands into a non-system function: `commands: &'a mut Commands<'b>`
3232

3333
### Commands API
3434

35-
The {{rust_type(type="struct" crate="bevy_ecs" version="0.5.0" mod="system" name="Commands" no_mod=true)}} API has been completely reworked for consistency with the {{rust_type(type="struct" crate="bevy_ecs" mod="world" version="0.5.0" name="World" no_mod=true)}} API.
35+
The {{rust_type(type="struct" crate="bevy_ecs" version="0.5.0" mod="system" name="Commands")}} API has been completely reworked for consistency with the {{rust_type(type="struct" crate="bevy_ecs" mod="world" version="0.5.0" name="World")}} API.
3636

3737
```rust
3838
// 0.4
@@ -97,7 +97,7 @@ if timer.tick(time.delta()).finished() { /* do stuff */ }
9797
timer.elapsed() // returns a `Duration`
9898
```
9999

100-
Most of the methods of {{rust_type(type="struct" crate="bevy_core" version="0.5.0" name="Timer" no_mod=true)}}
100+
Most of the methods of {{rust_type(type="struct" crate="bevy_core" version="0.5.0" name="Timer")}}
101101
now use `Duration` instead of `f32`.
102102

103103
This change allows timers to have consistent, high precision. For convenience, there is also an

content/news/2020-08-10-introducing-bevy/index.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ That being said, Bevy is still in the very early stages. I consider it to be in
5252

5353
Hopefully at this point you are either (1) jazzed about Bevy or (2) not reading anymore. If you want to dive in right now, [The Bevy Book](https://bevyengine.org/learn/book/introduction/) is the best place to get started. You can also keep reading to find out what the current state of Bevy is and where we'd like to take it.
5454

55-
**Quick note to the reader**: in this article you will find text formatted like this: {{rust_type(type="struct" crate="bevy_render" version="0.1.0" mod="texture" name="Texture" no_mod=true)}}
55+
**Quick note to the reader**: in this article you will find text formatted like this: {{rust_type(type="struct" crate="bevy_render" version="0.1.0" mod="texture" name="Texture")}}
5656

5757
This formatting indicates that the text is a Rust type that links to API documentation. I encourage you to click on anything that seems interesting to you!
5858

@@ -79,7 +79,7 @@ fn main() {
7979
}
8080
```
8181

82-
{{rust_type(type="trait", crate="bevy" version="0.1.0" name="AddDefaultPlugins" method="add_default_plugins" no_mod=true no_struct=true)}} adds all of the features you probably expect from a game engine: a 2D / 3D renderer, asset loading, a UI system, windows, input, etc
82+
{{rust_type(type="trait", crate="bevy" version="0.1.0" name="AddDefaultPlugins" method="add_default_plugins" no_struct=true)}} adds all of the features you probably expect from a game engine: a 2D / 3D renderer, asset loading, a UI system, windows, input, etc
8383

8484
You can also register the default {{rust_type(type="trait" name="Plugin" crate="bevy_app" version="0.1.0" plural=true)}} manually like this:
8585

@@ -96,7 +96,7 @@ fn main() {
9696
}
9797
```
9898

99-
And of course you can also create your own plugins. In fact, all engine and game logic is built using plugins. Hopefully now you understand what we mean by modular: you are free to add/remove plugins based on your project's unique needs. However I expect that most people will stick to {{rust_type(type="trait" crate="bevy" version="0.1.0" name="AddDefaultPlugins" method="add_default_plugins" no_mod=true no_struct=true)}} for simplicity, at least initially.
99+
And of course you can also create your own plugins. In fact, all engine and game logic is built using plugins. Hopefully now you understand what we mean by modular: you are free to add/remove plugins based on your project's unique needs. However I expect that most people will stick to {{rust_type(type="trait" crate="bevy" version="0.1.0" name="AddDefaultPlugins" method="add_default_plugins" no_struct=true)}} for simplicity, at least initially.
100100

101101
## Bevy ECS
102102

@@ -367,15 +367,15 @@ We are still in the experimental stages and I expect some things to change, but
367367

368368
### Building Blocks
369369

370-
In Bevy, a UI element is just an ECS Entity with a {{rust_type(type="struct" name="Node" crate="bevy_ui" version="0.1.0")}} component. Nodes are rectangles with a width and height, and are positioned using the same {{rust_type(type="struct" name="Transform" crate="bevy_transform" version="0.1.0" mod="components" no_mod=true)}} component used elsewhere in Bevy. The {{rust_type(type="struct" name="Style" crate="bevy_ui" version="0.1.0" no_mod=true)}} component is used to determine how the Node is rendered, sized, and positioned.
370+
In Bevy, a UI element is just an ECS Entity with a {{rust_type(type="struct" name="Node" crate="bevy_ui" version="0.1.0")}} component. Nodes are rectangles with a width and height, and are positioned using the same {{rust_type(type="struct" name="Transform" crate="bevy_transform" version="0.1.0" mod="components")}} component used elsewhere in Bevy. The {{rust_type(type="struct" name="Style" crate="bevy_ui" version="0.1.0")}} component is used to determine how the Node is rendered, sized, and positioned.
371371

372372
The easiest way to add a new node (with all of the required components) is like this:
373373

374374
```rs
375375
commands.spawn(NodeComponents::default())
376376
```
377377

378-
{{rust_type(type="struct" name="NodeComponents" crate="bevy_ui" version="0.1.0" mod="entity" no_mod=true)}} is a "component bundle", which Bevy uses to make spawning entities of various "types" easier.
378+
{{rust_type(type="struct" name="NodeComponents" crate="bevy_ui" version="0.1.0" mod="entity")}} is a "component bundle", which Bevy uses to make spawning entities of various "types" easier.
379379

380380
### Layout
381381

@@ -561,7 +561,7 @@ fn system(_button: &Button, interaction: Mutated<Interaction>) {
561561

562562
### [Sprites](https://github.com/bevyengine/bevy/blob/1d68094f59b01e14f44ed7db8907dbd011b59973/examples/2d/sprite.rs)
563563

564-
You can use any {{rust_type(type="struct" name="Texture" crate="bevy_render" version="0.1.0" mod="texture" no_mod=true)}} asset as a sprite directly:
564+
You can use any {{rust_type(type="struct" name="Texture" crate="bevy_render" version="0.1.0" mod="texture")}} asset as a sprite directly:
565565

566566
![sprite](sprite.png)
567567

@@ -702,7 +702,7 @@ The numbers assigned to the `entity` fields are entity's id, which are completel
702702

703703
### Loading and Instancing
704704

705-
Scenes can be added to a `World` using the {{rust_type(type="struct" name="SceneSpawner" crate="bevy_scene" version="0.1.0" no_mod=true)}} resource. Spawning can be done with either {{rust_type(type="struct" name="SceneSpawner" method="load" crate="bevy_scene" version="0.1.0" no_mod=true)}} or {{rust_type(type="struct" name="SceneSpawner" method="instance" crate="bevy_scene" version="0.1.0" no_mod=true)}}. "Loading" a Scene preserves the entity IDs in it. This is useful for something like a save file where you want entity ids to be constant and changes to be applied on top of entities already in the world. "Instancing" adds entities to the `World` with brand-new IDs, which allows multiple "instances" of a scene to exist in the same World.
705+
Scenes can be added to a `World` using the {{rust_type(type="struct" name="SceneSpawner" crate="bevy_scene" version="0.1.0")}} resource. Spawning can be done with either {{rust_type(type="struct" name="SceneSpawner" method="load" crate="bevy_scene" version="0.1.0")}} or {{rust_type(type="struct" name="SceneSpawner" method="instance" crate="bevy_scene" version="0.1.0")}}. "Loading" a Scene preserves the entity IDs in it. This is useful for something like a save file where you want entity ids to be constant and changes to be applied on top of entities already in the world. "Instancing" adds entities to the `World` with brand-new IDs, which allows multiple "instances" of a scene to exist in the same World.
706706

707707
```rs
708708
fn load_scene_system(asset_server: Res<AssetServer>, mut scene_spawner: ResMut<SceneSpawner>) {
@@ -855,7 +855,7 @@ fn system(mut state: Local<State>, texture_events: Res<Events<AssetEvent>>) {
855855

856856
#### Asset Server
857857

858-
The ```Assets<T>``` collection doesn't know anything about filesystems or multi-threading. This is the responsibility of the {{rust_type(type="struct" crate="bevy_asset" version="0.1.0" name="AssetServer" no_mod=true)}} resource:
858+
The ```Assets<T>``` collection doesn't know anything about filesystems or multi-threading. This is the responsibility of the {{rust_type(type="struct" crate="bevy_asset" version="0.1.0" name="AssetServer")}} resource:
859859

860860
```rs
861861
fn system(mut commands: Commands, asset_server: Res<AssetServer>, mut textures: ResMut<Assets<Texture>>) {
@@ -895,7 +895,7 @@ This will load new versions of assets whenever their files have changed.
895895

896896
#### Adding New Asset Types
897897

898-
To add a new asset type, implement the {{rust_type(type="trait" crate="bevy_asset" version="0.1.0" name="AssetLoader" no_mod=true)}} trait. This tells Bevy what file formats to look for and how to translate the file bytes into the given asset type.
898+
To add a new asset type, implement the {{rust_type(type="trait" crate="bevy_asset" version="0.1.0" name="AssetLoader")}} trait. This tells Bevy what file formats to look for and how to translate the file bytes into the given asset type.
899899

900900
Once you have implemented `AssetLoader<MyAsset>` for `MyAssetLoader` you can register your new loader like this:
901901
```rs
@@ -924,13 +924,13 @@ We plan on extending the audio system with more control and features in the futu
924924

925925
## Render Graph
926926

927-
All render logic is built on top of Bevy's {{rust_type(type="struct" crate="bevy_render" version="0.1.0" mod="render_graph" name="RenderGraph" no_mod=true)}}. The Render Graph is a way to encode atomic units of render logic. For example, you might create graph nodes for a 2D pass, UI pass, cameras, texture copies, swap chains, etc. Connecting a node to another node indicates that there is a dependency of some kind between them. By encoding render logic this way, the Bevy renderer is able to analyze dependencies and render the graph in parallel. It also has the benefit of encouraging developers to write modular render logic.
927+
All render logic is built on top of Bevy's {{rust_type(type="struct" crate="bevy_render" version="0.1.0" mod="render_graph" name="RenderGraph")}}. The Render Graph is a way to encode atomic units of render logic. For example, you might create graph nodes for a 2D pass, UI pass, cameras, texture copies, swap chains, etc. Connecting a node to another node indicates that there is a dependency of some kind between them. By encoding render logic this way, the Bevy renderer is able to analyze dependencies and render the graph in parallel. It also has the benefit of encouraging developers to write modular render logic.
928928

929929
Bevy includes a number of nodes by default: `CameraNode`, `PassNode`, `RenderResourcesNode`, `SharedBuffersNode`, `TextureCopyNode`, `WindowSwapChainNode`, and `WindowTextureNode`. It also provides subgraphs for 2d rendering, 3d rendering, and UI rendering. But you are welcome to create your own nodes, your own graphs, or extend the included graphs!
930930

931931
### [Data Driven Shaders](https://github.com/bevyengine/bevy/blob/1d68094f59b01e14f44ed7db8907dbd011b59973/examples/shader/shader_custom_material.rs)
932932

933-
Components and Assets can derive the {{rust_type(type="trait" crate="bevy_render" version="0.1.0" mod="renderer" name="RenderResources" no_mod=true)}} trait, which enables them to be directly copied to GPU resources and used as shader uniforms.
933+
Components and Assets can derive the {{rust_type(type="trait" crate="bevy_render" version="0.1.0" mod="renderer" name="RenderResources")}} trait, which enables them to be directly copied to GPU resources and used as shader uniforms.
934934

935935
Binding uniforms to a custom shader is literally as simple as deriving `RenderResources` on your component or asset:
936936

0 commit comments

Comments
 (0)