diff --git a/README.md b/README.md index 44dd603..da9d6b7 100644 --- a/README.md +++ b/README.md @@ -41,16 +41,16 @@ Hierarchical state machines for designing event-driven systems. A simple blinky state machine: -``` -┌─────────────────────────┐ -│ Blinking │◀─────────┐ -│ ┌───────────────┐ │ │ +```text +┌─────────────────────────┐ +│ Blinking │◀─────────┐ +│ ┌───────────────┐ │ │ │ ┌─▶│ LedOn │──┐ │ ┌───────────────┐ │ │ └───────────────┘ │ │ │ NotBlinking │ │ │ ┌───────────────┐ │ │ └───────────────┘ -│ └──│ LedOff │◀─┘ │ ▲ -│ └───────────────┘ │──────────┘ -└─────────────────────────┘ +│ └──│ LedOff │◀─┘ │ ▲ +│ └───────────────┘ │──────────┘ +└─────────────────────────┘ ``` ```rust @@ -325,25 +325,25 @@ A lot of the implementation details are dealt with by the `#[state_machine]` mac The goal of `statig` is to represent a hierarchical state machine. Conceptually a hierarchical state machine can be thought of as a tree. -``` - ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐ - Top - └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘ - │ - ┌────────────┴────────────┐ - │ │ +```text + ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐ + Top + └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘ + │ + ┌────────────┴────────────┐ + │ │ ┌─────────────────────┐ ╔═════════════════════╗ │ Blinking │ ║ NotBlinking ║ │─────────────────────│ ╚═════════════════════╝ - │ counter: &'a usize │ - └─────────────────────┘ - │ - ┌────────────┴────────────┐ - │ │ -╔═════════════════════╗ ╔═════════════════════╗ -║ LedOn ║ ║ LedOff ║ -║─────────────────────║ ║─────────────────────║ -║ counter: usize ║ ║ counter: usize ║ + │ counter: &'a usize │ + └─────────────────────┘ + │ + ┌────────────┴────────────┐ + │ │ +╔═════════════════════╗ ╔═════════════════════╗ +║ LedOn ║ ║ LedOff ║ +║─────────────────────║ ║─────────────────────║ +║ counter: usize ║ ║ counter: usize ║ ╚═════════════════════╝ ╚═════════════════════╝ ``` @@ -391,7 +391,7 @@ The association between states and their actions is expressed in a similar fashi ```rust impl statig::State for State { - + ... fn call_entry_action(&mut self, blinky: &mut Blinky) { diff --git a/statig/src/lib.rs b/statig/src/lib.rs index 7311222..0f9d20a 100644 --- a/statig/src/lib.rs +++ b/statig/src/lib.rs @@ -1,4 +1,4 @@ -#![doc = include_str!("../../README.md")] +#![cfg_attr(not(doctest), doc = include_str!("../../README.md"))] #![cfg_attr(not(feature = "std"), no_std)] #![allow(incomplete_features)]