Skip to content

Commit

Permalink
Centralize docs (#39)
Browse files Browse the repository at this point in the history
* Centralize docs

* Disable doc tests
  • Loading branch information
mdeloof authored Jan 8, 2025
1 parent c86f77d commit 8f5b0c7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 709 deletions.
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ║
╚═════════════════════╝ ╚═════════════════════╝
```

Expand Down Expand Up @@ -391,7 +391,7 @@ The association between states and their actions is expressed in a similar fashi

```rust
impl statig::State<Blinky> for State {

...

fn call_entry_action(&mut self, blinky: &mut Blinky) {
Expand Down
Loading

0 comments on commit 8f5b0c7

Please sign in to comment.