Mermaid to ASCII Art Tool Gets WebAssembly Port for Comparison
Developer Simon Willison recently created a tool that converts Mermaid diagrams into ASCII art. He based his initial version on Rust code from Grok Build. After building that tool, he learned about an older and more comprehensive Go library called AlexanderGrooff/mermaid-ascii that performs a similar function.
Willison then used Claude Fable 5 to compile the Go library to WebAssembly. This allowed him to run both tools in the browser and compare their outputs directly.
Color Support and Features
The Go-based version includes support for colors in the ASCII output. A sample diagram shows a left-to-right flowchart with four connected boxes: "Build" displayed in green text, "Test" in green, "Deploy" in yellow, and "Rollback" in red. Each box is linked by arrows.
The tool provides a control panel with several options. An unchecked checkbox labeled "ASCII only" lets users toggle between colored and plain ASCII output. Three padding controls are available: "Padding X: 5", "Padding Y: 5", and "Box padding: 1". Users can also click buttons to "Copy as text" or "Copy link to this diagram".
The rendered diagram appears on a black background at the bottom of the interface.
Stay updated
Get the day's AI and automation news in your inbox. No spam, unsubscribe anytime.
Background on the Libraries
The Go library by AlexanderGrooff implements a similar pattern to the Rust code from Grok Build but offers more features. Willison's decision to compile it to WebAssembly demonstrates how developers can bring server-side libraries into the browser for client-side use.
Mermaid is a popular diagramming tool that uses text-based syntax to generate flowcharts, sequence diagrams, and other visual representations. Converting Mermaid diagrams to ASCII art allows them to be displayed in environments that do not support graphical rendering, such as terminals or plain text documents.
Availability
The tool is available for anyone to use online. Willison has shared the WebAssembly version so developers can compare the two implementations and choose the one that best fits their needs.
Related on Neura Market
- AI Tools Directory - Explore developer tools and AI-powered utilities
- Automation Marketplace - Find tools for workflow automation and diagram generation
- Developer Tools Platform - Browse libraries, compilers, and code utilities
