chickensoft-games / LogicBlocks

Human-friendly, hierarchical state machines for games and apps in C#.
https://www.nuget.org/packages/Chickensoft.LogicBlocks
MIT License
152 stars 6 forks source link

feat: support Mermaid diagrams by default #35

Open definitelyokay opened 3 months ago

definitelyokay commented 3 months ago

It was brought to my attention recently that GitHub can render Mermaid diagrams inside markdown beautifully.

Mermaid's state diagrams are almost identical to the ones used by PlantUML, except it doesn't support nested state descriptions, which is what the logic blocks generator is currently making.

So instead of this:

state "State1" as state_one {
    state_one : text
}

We need to flatten it out, like this:

state "State1" as state_one

state_one : text
definitelyokay commented 1 month ago

I did modify the generator to produce flatter state descriptions. Unfortunately, this is still blocked by the lack of support for composite states with descriptions: mermaid-js/mermaid/issues/1493