TLX.Emitter.Mermaid (TLX v0.5.2)

Copy Markdown

Emits a Mermaid stateDiagram-v2 from a compiled TLX.Spec module.

Renders natively in GitHub markdown, hexdocs, GitLab, Obsidian, and any tool that supports Mermaid code blocks.

Usage

TLX.Emitter.Mermaid.emit(MySpec)
TLX.Emitter.Mermaid.emit(MySpec, state_var: :status)

Wrap the output in a fenced code block for markdown rendering:

```mermaid
stateDiagram-v2
    [*] --> red
    red --> green: to_green
```

Summary

Functions

Generate a Mermaid stateDiagram-v2 string from a compiled spec module.

Functions

emit(module, opts \\ [])

Generate a Mermaid stateDiagram-v2 string from a compiled spec module.

Options:

  • :state_var — name of the state variable (auto-detected if omitted)