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.
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
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:
We need to flatten it out, like this: