Commit fa6b97f
committed
feat: add statemachine-diagram Sphinx directive for inline diagram rendering
Add a Sphinx extension that renders state machine diagrams inline in docs
from an importable class path, eliminating manual DotGraphMachine/write_png
boilerplate. Supports standard image/figure options (width, height, scale,
align, target, class, name) and state-machine-specific options (events,
caption, figclass).
Key features:
- Inline SVG rendering (no intermediate files)
- :events: option to instantiate and advance the machine before rendering
- :target: (empty) auto-generates a standalone SVG for full-size zoom
- Responsive sizing: intrinsic width becomes max-width, scales down on
narrow viewports
- Compatible with any Sphinx theme (uses native align-center/left/right
classes)
Refactor diagram.md to use the directive for the visual showcase, replacing
doctest+write_png workflow. Extract showcase machines to tests/machines/
and use literalinclude with :pyobject: to display source code. Reorganize
the page narrative: _graph() as primary entry point, DotGraphMachine for
advanced customization.1 parent e16b2f0 commit fa6b97f
43 files changed
Lines changed: 780 additions & 252 deletions
File tree
- docs
- images
- statemachine/contrib/diagram
- tests
- machines
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
0 commit comments