Skip to content

Commit 04bf5ec

Browse files
committed
docs: reorganize toctree sections and remove listeners from concepts
Restructure the docs sidebar into clearer sections: - Core Concepts: concepts, states, transitions, events, actions, guards - Runtime: statechart, processing_model, error_handling, async, listeners - Configuration: behaviour, validations - Advanced: invoke, models, integrations, weighted_transitions - Reference: api, diagram, examples, contributing, authors Remove the Listeners subsection from concepts.md since it now lives under Runtime, and add a brief note pointing to its dedicated page.
1 parent 2975fea commit 04bf5ec

2 files changed

Lines changed: 14 additions & 21 deletions

File tree

docs/concepts.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ Even in this minimal example, the core concepts appear:
3737
| {ref}`Condition <conditions>` | A guard that allows/blocks a transition | `cond`, `unless`, `validators` parameters |
3838
| {ref}`Listener <listeners>` | An external observer of the lifecycle | `listeners = [...]` class attribute |
3939

40+
Each concept below introduces the idea briefly; follow the "See also" links
41+
for the full reference. Listeners are covered in {ref}`their own page <listeners>`.
4042

4143
(concepts-statechart)=
4244

@@ -148,19 +150,3 @@ different guard — the first one that passes wins.
148150
See [](guards.md) for the full reference: `cond`, `unless`, `validators`,
149151
boolean expressions, and checking enabled events.
150152
```
151-
152-
153-
(concepts-listeners)=
154-
155-
## Listeners
156-
157-
A {ref}`listener <listeners>` is an external object that observes a state
158-
machine's lifecycle without modifying its class. Listeners receive the same
159-
callbacks as the state machine itself — `on_enter_state()`,
160-
`after_transition()`, and so on — enabling cross-cutting concerns like
161-
logging, persistence, or telemetry to be attached and removed independently.
162-
163-
```{seealso}
164-
See [](listeners.md) for the full reference: defining listeners, class-level
165-
declarations, runtime attachment, the `setup()` protocol, and inheritance.
166-
```

docs/index.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,32 @@ tutorial
1818
:hidden:
1919
2020
concepts
21-
statechart
2221
states
2322
transitions
2423
events
2524
actions
2625
guards
27-
listeners
2826
```
2927

3028
```{toctree}
31-
:caption: Engine
29+
:caption: Runtime
3230
:maxdepth: 2
3331
:hidden:
3432
33+
statechart
3534
processing_model
3635
error_handling
3736
async
38-
validations
37+
listeners
38+
```
39+
40+
```{toctree}
41+
:caption: Configuration
42+
:maxdepth: 2
43+
:hidden:
44+
3945
behaviour
46+
validations
4047
```
4148

4249
```{toctree}
@@ -47,7 +54,6 @@ behaviour
4754
invoke
4855
models
4956
integrations
50-
diagram
5157
weighted_transitions
5258
```
5359

@@ -57,6 +63,7 @@ weighted_transitions
5763
:hidden:
5864
5965
api
66+
diagram
6067
auto_examples/index
6168
contributing
6269
authors

0 commit comments

Comments
 (0)