How alexandergrooff/mermaid-ascii works
Mermaid ASCII accepts diagrams through a CLI or web form, detects the diagram type, parses it, and returns a text rendering. The main supported domains are flowcharts, sequence diagrams, and entity-relationship diagrams; graph rendering also supports width-aware compact retries. The graph distinguishes the documented entry points and domain stages. Internal layout details and some web-template interactions are not fully evidenced by the supplied excerpts, so they are not expanded into speculative connections.
Main entry points: diagram.go Diagram dispatch · render.go Render pipeline · root.go CLI command · web.go Web handler
Components 14
Entry points
- CLI command
cmd/root.go - Web handler
cmd/web.go - Web interface
templates/index.tmpl
Render orchestration
- Render config
pkg/diagram/config.go - Render pipeline
pkg/render/render.go - Diagram dispatch
pkg/render/diagram.go
Flowcharts
- Flowchart parser
pkg/graph/parse.go - Flowchart drawing
pkg/graph/draw.go
Sequence diagrams
- Sequence parser
pkg/sequence/parser.go - Sequence renderer
pkg/sequence/renderer.go
ER diagrams
- ER parser
pkg/er/parser.go - ER renderer
pkg/er/renderer.go
Other components
- CLI user
- Web user
Connections 15
- CLI user → CLI command: provides input
README.md - CLI command → Render config: creates config
cmd/root.go - CLI command → Render pipeline: renders diagram
cmd/root.go - Render pipeline → Diagram dispatch: detects and dispatches
pkg/render/render.go - Diagram dispatch → Flowchart parser: parses flowchart
pkg/render/diagram.go - Diagram dispatch → Flowchart drawing: draws flowchart
pkg/render/diagram.go - Diagram dispatch → Sequence parser: parses sequence
pkg/render/diagram.go - Diagram dispatch → Sequence renderer: renders sequence
pkg/render/diagram.go - Diagram dispatch → ER parser: parses ER
pkg/render/diagram.go - Diagram dispatch → ER renderer: renders ER
pkg/render/diagram.go - Render pipeline → Render config: strips frontmatter
pkg/render/render.go - Web user → Web interface: submits diagram
README.md - Web interface → Web handler: posts diagram
cmd/web.go - Web handler → Render config: creates config
cmd/web.go - Web handler → Render pipeline: renders diagram
cmd/web.go