Skip to content

Commit

Permalink
Ignore non-doctest code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
benfrankel committed Aug 17, 2024
1 parent 5fe39f4 commit 10dd799
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 27 deletions.
8 changes: 4 additions & 4 deletions src/access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl<S: State> CurrentMut<'_, S> {
///
/// # Example
///
/// ```rust
/// ```ignore
/// fn spawn_new_menu(menu: NextStateRef<Menu>) {
/// match menu.unwrap() {
/// Menu::Main => spawn_main_menu(),
Expand Down Expand Up @@ -157,7 +157,7 @@ impl<S: State> NextRef<'_, '_, S> {
///
/// # Example
///
/// ```rust
/// ```ignore
/// fn toggle_blue(mut color: NextMut<ColorState>) {
/// let mut color = color.unwrap_mut();
/// color.blue = !color.blue;
Expand Down Expand Up @@ -288,7 +288,7 @@ impl<S: StateMut> NextMut<'_, '_, S> {
///
/// # Example
///
/// ```rust
/// ```ignore
/// fn same_red(color: FlushRef<ColorState>) -> bool {
/// color.will_trans(&ColorState::when(|x, y| x.red == y.red))
/// }
Expand Down Expand Up @@ -362,7 +362,7 @@ impl<S: State> FlushRef<'_, '_, S> {
///
/// # Example
///
/// ```rust
/// ```ignore
/// fn copy_red_to_green(mut color: FlushMut<ColorState>) {
/// let (current, next) = color.unwrap_mut();
/// next.green = current.red;
Expand Down
8 changes: 4 additions & 4 deletions src/extra/bevy_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//!
//! Opt in to [`BevyStatePlugin<S>`] for `GameState`:
//!
//! ```rust
//! ```ignore
//! #[derive(State, Clone, PartialEq, Eq, Hash, Debug, Default)]
//! #[state(bevy_state)]
//! enum GameState {
Expand All @@ -19,13 +19,13 @@
//!
//! Add `GameState` along with its [`BevyState`] wrapper:
//!
//! ```rust
//! ```ignore
//! app.init_state::<GameState>();
//! ```
//!
//! Change `GameState` to drive `BevyState`:
//!
//! ```rust
//! ```ignore
//! app.add_systems(Update, GameState::Title.on_update(
//! GameState::Loading.enter().run_if(input_just_pressed(KeyCode::Enter)),
//! ));
Expand All @@ -34,7 +34,7 @@
//! Change `BevyState` to drive `GameState` (e.g. using
//! [iyes_progress](https://github.com/IyesGames/iyes_progress)):
//!
//! ```rust
//! ```ignore
//! app.add_plugins(
//! ProgressPlugin::new(GameState::Loading.bevy())
//! .continue_to(GameState::Playing.bevy()),
Expand Down
4 changes: 2 additions & 2 deletions src/extra/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
///
/// Define your own split state type as a newtype:
///
/// ```rust
/// ```ignore
/// #[derive(State, Clone, PartialEq, Eq)]
/// pub struct MyState(pub SplitState);
/// ```
Expand All @@ -25,7 +25,7 @@ pub type SplitState = &'static str;
///
/// # Example
///
/// ```rust
/// ```ignore
/// add_to_split_state!(MyState, Foo, Bar);
/// add_to_split_state!(MyState, Quux);
/// ```
Expand Down
18 changes: 9 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,27 @@
//!
//! Import the [prelude] to bring traits and common types into scope:
//!
//! ```rust
//! ```
//! use pyri_state::prelude::*;
//! ```
//!
//! Define your own [`State`](state::State) type using the
//! [derive macro](pyri_state_derive::State):
//!
//! ```rust
//! ```ignore
//! #[derive(State, Clone, PartialEq, Eq, Default)]
//! struct Level(pub usize);
//! ```
//!
//! Add [`StatePlugin`](setup::StatePlugin) and initialize your state type:
//!
//! ```rust
//! ```ignore
//! app.add_plugins(StatePlugin).init_state::<Level>();
//! ```
//!
//! Add update systems with [`StatePattern::on_update`](pattern::StatePattern::on_update):
//!
//! ```rust
//! ```ignore
//! app.add_systems(Update, (
//! Level::ANY.on_update(update_level_timer),
//! Level(10).on_update(update_boss_health_bar),
Expand All @@ -50,7 +50,7 @@
//!
//! Add flush hooks with other [`StatePattern`](pattern::StatePattern) methods:
//!
//! ```rust
//! ```ignore
//! app.add_systems(StateFlush, (
//! // Short-hand for `on_exit` followed by `on_enter`.
//! Level::ANY.on_edge(despawn_old_level, spawn_new_level),
Expand All @@ -77,7 +77,7 @@ pub mod state;
///
/// Import the prelude to get started:
///
/// ```rust
/// ```
/// use pyri_state::prelude::*;
/// ```
pub mod prelude {
Expand Down Expand Up @@ -131,22 +131,22 @@ pub mod prelude {
///
/// The derive macro requires `Clone`, `PartialEq`, and `Eq`:
///
/// ```rust
/// ```ignore
/// #[derive(State, Clone, PartialEq, Eq)]
/// enum GameState { ... }
/// ```
///
/// They can be omitted if you disable the default options:
///
/// ```rust
/// ```ignore
/// #[derive(State)]
/// #[state(no_defaults)]
/// struct RawState;
/// ```
///
/// The following options are provided:
///
/// ```rust
/// ```ignore
/// #[derive(State, Clone, PartialEq, Eq, Hash, Debug)]
/// #[state(
/// // Disable default plugins: detect_change, flush_event, apply_flush.
Expand Down
2 changes: 1 addition & 1 deletion src/next_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl<S: State> Default for TriggerStateFlush<S> {
/// The default `NextState` type is [`NextStateBuffer`](buffer::NextStateBuffer).
/// You can set a different `NextState` type in the [derive macro](pyri_state_derive::State):
///
/// ```rust
/// ```ignore
/// #[derive(State, Clone, PartialEq, Eq)]
/// #[state(next(NextStateStack<Self>))]
/// enum MenuState { ... }
Expand Down
12 changes: 6 additions & 6 deletions src/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl<S: State + Eq> StatePattern<S> for S {
///
/// The usual way to use `AnyStatePattern` is through the associated constant [`State::ANY`]:
///
/// ```rust
/// ```ignore
/// Level::ANY.on_enter(reset_timer)
/// ```
pub struct AnyStatePattern<S: State>(pub(crate) PhantomData<S>);
Expand All @@ -159,7 +159,7 @@ impl<S: State> StatePattern<S> for AnyStatePattern<S> {
/// The usual way to construct this type is with the [`state!`](crate::state!) macro or
/// [`State::with`]:
///
/// ```rust
/// ```ignore
/// state!(Level(4 | 7 | 10)).on_enter(save_checkpoint)
/// Level::with(|x| x.0 < 4).on_refresh(my_systems)
/// ```
Expand Down Expand Up @@ -257,7 +257,7 @@ impl<S: State, P1: StatePattern<S>, P2: StatePattern<S>> StateTransPattern<S> fo
///
/// The usual way to use this type is through the associated constant [`State::ANY_TO_ANY`]:
///
/// ```rust
/// ```ignore
/// Level::ANY_TO_ANY.on_trans(reset_timer)
///
/// // Equivalent to:
Expand All @@ -279,7 +279,7 @@ impl<S: State> StateTransPattern<S> for AnyStateTransPattern<S> {
/// The usual way to construct this type is with the [`state!`](crate::state!) macro or
/// [`State::when`]:
///
/// ```rust
/// ```ignore
/// state!(Level(2..=5 | 7) => Level(8 | 10)).on_enter(spawn_something_cool)
/// Level::when(|x, y| y.0 > x.0).on_enter(play_next_level_sfx)
/// ```
Expand Down Expand Up @@ -313,13 +313,13 @@ where
///
/// State pattern-matching:
///
/// ```rust
/// ```ignore
/// state!(Level(4 | 7 | 10)).on_enter(save_checkpoint)
/// ```
///
/// State transition pattern-matching:
///
/// ```rust
/// ```ignore
/// state!(Level(x @ 1..=3) => y if y.0 == 10 - x).on_trans(do_something_cool)
/// ```
#[macro_export]
Expand Down
2 changes: 1 addition & 1 deletion src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::{
///
/// This trait can be [derived](pyri_state_derive::State) or implemented manually:
///
/// ```rust
/// ```ignore
/// #[derive(State, Clone, PartialEq, Eq)]
/// enum GameState { ... }
///
Expand Down

0 comments on commit 10dd799

Please sign in to comment.