Skip to content

Commit e6bce74

Browse files
committed
Fix doc_markdown lints in examples (bevyengine#3486)
bevyengine#3457 adds the `doc_markdown` clippy lint, which checks doc comments to make sure code identifiers are escaped with backticks. This causes a lot of lint errors, so this is one of a number of PR's that will fix those lint errors one crate at a time. This PR fixes lints in the `examples` folder.
1 parent 601cc0c commit e6bce74

File tree

10 files changed

+22
-22
lines changed

10 files changed

+22
-22
lines changed

examples/2d/many_sprites.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rand::Rng;
1010
const CAMERA_SPEED: f32 = 1000.0;
1111

1212
/// This example is for performance testing purposes.
13-
/// See https://github.com/bevyengine/bevy/pull/1492
13+
/// See <https://github.com/bevyengine/bevy/pull/1492>
1414
fn main() {
1515
App::new()
1616
.add_plugin(LogDiagnosticsPlugin::default())

examples/3d/msaa.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use bevy::prelude::*;
66
/// expensive).
77
/// Note that WGPU currently only supports 1 or 4 samples.
88
/// Ultimately we plan on supporting whatever is natively supported on a given device.
9-
/// Check out this issue for more info: https://github.com/gfx-rs/wgpu/issues/1832
9+
/// Check out [this issue](https://github.com/gfx-rs/wgpu/issues/1832) for more info.
1010
fn main() {
1111
App::new()
1212
.insert_resource(Msaa { samples: 4 })

examples/app/plugin_group.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use bevy::{app::PluginGroupBuilder, prelude::*};
22

3-
/// PluginGroups are a way to group sets of plugins that should be registered together.
3+
/// [`PluginGroups`] are a way to group sets of plugins that should be registered together.
44
fn main() {
55
App::new()
66
// Two PluginGroups that are included with bevy are DefaultPlugins and MinimalPlugins

examples/async_tasks/async_compute.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use futures_lite::future;
66
use rand::Rng;
77
use std::time::{Duration, Instant};
88

9-
/// This example shows how to use the ECS and the AsyncComputeTaskPool
9+
/// This example shows how to use the ECS and the [`AsyncComputeTaskPool`]
1010
/// to spawn, poll, and complete tasks across systems and system ticks.
1111
fn main() {
1212
App::new()
@@ -43,7 +43,7 @@ fn add_assets(
4343

4444
/// This system generates tasks simulating computationally intensive
4545
/// work that potentially spans multiple frames/ticks. A separate
46-
/// system, handle_tasks, will poll the spawned tasks on subsequent
46+
/// system, `handle_tasks`, will poll the spawned tasks on subsequent
4747
/// frames/ticks, and use the results to spawn cubes
4848
fn spawn_tasks(mut commands: Commands, thread_pool: Res<AsyncComputeTaskPool>) {
4949
for x in 0..NUM_CUBES {
@@ -72,7 +72,7 @@ fn spawn_tasks(mut commands: Commands, thread_pool: Res<AsyncComputeTaskPool>) {
7272

7373
/// This system queries for entities that have our Task<Transform> component. It polls the
7474
/// tasks to see if they're complete. If the task is complete it takes the result, adds a
75-
/// new PbrBundle of components to the entity using the result from the task's work, and
75+
/// new [`PbrBundle`] of components to the entity using the result from the task's work, and
7676
/// removes the task component from the entity.
7777
fn handle_tasks(
7878
mut commands: Commands,

examples/ecs/ecs_guide.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ use rand::random;
2525
/// }
2626
2727
/// Resource: a shared global piece of data
28-
/// Examples: asset_storage, events, system state
28+
/// Examples: asset storage, events, system state
2929
///
3030
/// System: runs logic on entities, components, and resources
31-
/// Examples: move_system, damage_system
31+
/// Examples: move system, damage system
3232
///
3333
/// Now that you know a little bit about ECS, lets look at some Bevy code!
3434
/// We will now make a simple "game" to illustrate what Bevy's ECS looks like in practice.

examples/ecs/state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use bevy::prelude::*;
22

3-
/// This example illustrates how to use States to control transitioning from a Menu state to an
4-
/// InGame state.
3+
/// This example illustrates how to use [`States`] to control transitioning from a `Menu` state to
4+
/// an `InGame` state.
55
fn main() {
66
App::new()
77
.add_plugins(DefaultPlugins)

examples/ecs/system_param.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use bevy::{ecs::system::SystemParam, prelude::*};
22

3-
/// This example creates a SystemParam struct that counts the number of players
3+
/// This example creates a [`SystemParam`] struct that counts the number of players
44
fn main() {
55
App::new()
66
.insert_resource(PlayerCount(0))
@@ -14,7 +14,7 @@ pub struct Player;
1414
#[derive(Component)]
1515
pub struct PlayerCount(usize);
1616

17-
/// The SystemParam struct can contain any types that can also be included in a
17+
/// The [`SystemParam`] struct can contain any types that can also be included in a
1818
/// system function signature.
1919
///
2020
/// In this example, it includes a query and a mutable resource.
@@ -37,7 +37,7 @@ fn spawn(mut commands: Commands) {
3737
commands.spawn().insert(Player);
3838
}
3939

40-
/// The SystemParam can be used directly in a system argument.
40+
/// The [`SystemParam`] can be used directly in a system argument.
4141
fn count_players(mut counter: PlayerCounter) {
4242
counter.count();
4343

examples/ecs/system_sets.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use bevy::{app::AppExit, ecs::schedule::ShouldRun, prelude::*};
22

3-
/// A [SystemLabel] can be applied as a label to systems and system sets,
3+
/// A [`SystemLabel`] can be applied as a label to systems and system sets,
44
/// which can then be referred to from other systems.
55
/// This is useful in case a user wants to e.g. run _before_ or _after_
66
/// some label.
77
/// `Clone`, `Hash`, `Debug`, `PartialEq`, `Eq`, are all required to derive
8-
/// [SystemLabel].
8+
/// [`SystemLabel`].
99
#[derive(Clone, Hash, Debug, PartialEq, Eq, SystemLabel)]
1010
struct Physics;
1111

@@ -16,7 +16,7 @@ struct PostPhysics;
1616
#[derive(Default)]
1717
struct Done(bool);
1818

19-
/// This is used to show that within a [SystemSet], individual systems can also
19+
/// This is used to show that within a [`SystemSet`], individual systems can also
2020
/// be labelled, allowing further fine tuning of run ordering.
2121
#[derive(Clone, Hash, Debug, PartialEq, Eq, SystemLabel)]
2222
pub enum PhysicsSystem {
@@ -36,9 +36,9 @@ pub enum PhysicsSystem {
3636
/// \--> exit
3737
/// ```
3838
///
39-
/// The `Physics` label represents a [SystemSet] containing two systems.
39+
/// The `Physics` label represents a [`SystemSet`] containing two systems.
4040
/// This set's criteria is to stop after a second has elapsed.
41-
/// The two systems (update_velocity, movement) runs in a specified order.
41+
/// The two systems (`update_velocity`, `movement`) run in a specified order.
4242
///
4343
/// Another label `PostPhysics` uses run criteria to only run after `Physics` has finished.
4444
/// This set's criteria is to run only when _not done_, as specified via a resource.
@@ -128,7 +128,7 @@ fn is_done(done: Res<Done>) -> ShouldRun {
128128
}
129129
}
130130

131-
/// Used with [RunCritera::pipe], inverts the result of the
131+
/// Used with [`RunCritera::pipe`], inverts the result of the
132132
/// passed system.
133133
fn inverse(input: In<ShouldRun>) -> ShouldRun {
134134
match input.0 {

examples/reflection/reflection_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub struct D {
4141

4242
/// By default, deriving with Reflect assumes the type is a "struct". You can tell reflect to treat
4343
/// your type as a "value type" by using the `reflect_value` attribute instead of `reflect`. It is
44-
/// generally a good idea to implement (and reflect) the PartialEq, Serialize, and Deserialize
44+
/// generally a good idea to implement (and reflect) the `PartialEq`, `Serialize`, and `Deserialize`
4545
/// traits on `reflect_value` types to ensure that these values behave as expected when nested
4646
/// underneath Reflect-ed structs.
4747
#[derive(Reflect, Copy, Clone, PartialEq, Serialize, Deserialize)]

examples/ui/font_atlas_debug.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use bevy::{prelude::*, text::FontAtlasSet};
22

33
// TODO: This is now broken. See #1243
4-
/// This example illustrates how FontAtlases are populated. Bevy uses FontAtlases under the hood to
5-
/// optimize text rendering.
4+
/// This example illustrates how `FontAtlas`'s are populated. Bevy uses `FontAtlas`'s under the hood
5+
/// to optimize text rendering.
66
fn main() {
77
App::new()
88
.init_resource::<State>()

0 commit comments

Comments
 (0)