Add missing closing ticks for inline examples and some cleanup (#3573)

# Objective

- clean up documentation and inline examples

## Solution

- add missing closing "```"
- remove stray "```"
- remove whitespace in inline examples
- unify inline examples (remove some `rust` labels)
This commit is contained in:
Niklas Eicker 2022-01-07 09:25:12 +00:00
parent 015da72250
commit fbab01a40d
9 changed files with 17 additions and 15 deletions

View File

@ -36,7 +36,7 @@
//! Manually enabling dynamic linking is achieved by adding `bevy_dylib` as a dependency and //! Manually enabling dynamic linking is achieved by adding `bevy_dylib` as a dependency and
//! adding the following code to the `main.rs` file: //! adding the following code to the `main.rs` file:
//! //!
//! ```rust //! ```
//! #[allow(unused_imports)] //! #[allow(unused_imports)]
//! use bevy_dylib; //! use bevy_dylib;
//! ``` //! ```
@ -44,7 +44,7 @@
//! It is recommended to disable the `bevy_dylib` dependency in release mode by adding the //! It is recommended to disable the `bevy_dylib` dependency in release mode by adding the
//! following code to the `use` statement to avoid having to ship additional files with your game: //! following code to the `use` statement to avoid having to ship additional files with your game:
//! //!
//! ```rust //! ```
//! #[allow(unused_imports)] //! #[allow(unused_imports)]
//! #[cfg(debug_assertions)] // new //! #[cfg(debug_assertions)] // new
//! use bevy_dylib; //! use bevy_dylib;

View File

@ -161,6 +161,7 @@ impl Schedule {
/// # schedule.add_stage("target_stage", SystemStage::parallel()); /// # schedule.add_stage("target_stage", SystemStage::parallel());
/// # /// #
/// schedule.add_stage_before("target_stage", "my_stage", SystemStage::parallel()); /// schedule.add_stage_before("target_stage", "my_stage", SystemStage::parallel());
/// ```
pub fn add_stage_before<S: Stage>( pub fn add_stage_before<S: Stage>(
&mut self, &mut self,
target: impl StageLabel, target: impl StageLabel,
@ -197,6 +198,7 @@ impl Schedule {
/// # schedule.add_stage("my_stage", SystemStage::parallel()); /// # schedule.add_stage("my_stage", SystemStage::parallel());
/// # /// #
/// schedule.add_system_to_stage("my_stage", my_system); /// schedule.add_system_to_stage("my_stage", my_system);
/// ```
pub fn add_system_to_stage<Params>( pub fn add_system_to_stage<Params>(
&mut self, &mut self,
stage_label: impl StageLabel, stage_label: impl StageLabel,
@ -324,6 +326,7 @@ impl Schedule {
/// # schedule.add_stage("my_stage", SystemStage::parallel()); /// # schedule.add_stage("my_stage", SystemStage::parallel());
/// # /// #
/// let stage = schedule.get_stage_mut::<SystemStage>(&"my_stage").unwrap(); /// let stage = schedule.get_stage_mut::<SystemStage>(&"my_stage").unwrap();
/// ```
pub fn get_stage_mut<T: Stage>(&mut self, label: &dyn StageLabel) -> Option<&mut T> { pub fn get_stage_mut<T: Stage>(&mut self, label: &dyn StageLabel) -> Option<&mut T> {
self.stages self.stages
.get_mut(label) .get_mut(label)

View File

@ -3,7 +3,7 @@
//! //!
//! # Examples //! # Examples
//! //!
//! ```rust //! ```
//! use bevy_render::mesh::VertexAttributeValues; //! use bevy_render::mesh::VertexAttributeValues;
//! //!
//! // creating std::vec::Vec //! // creating std::vec::Vec

View File

@ -46,7 +46,6 @@ pub enum PhysicsSystem {
/// ordering can then change between invocations. /// ordering can then change between invocations.
/// ///
/// Lastly a system with run criterion _done_ is used to exit the app. /// Lastly a system with run criterion _done_ is used to exit the app.
/// ```
fn main() { fn main() {
App::new() App::new()
.add_plugins(DefaultPlugins) .add_plugins(DefaultPlugins)

View File

@ -24,7 +24,7 @@
//! println!("hello world"); //! println!("hello world");
//! } //! }
//! ``` //! ```
//!
//! Don't let the simplicity of the example above fool you. Bevy is a [fully featured game engine](https://bevyengine.org) //! Don't let the simplicity of the example above fool you. Bevy is a [fully featured game engine](https://bevyengine.org)
//! and it gets more powerful every day! //! and it gets more powerful every day!
//! //!