News for hackers. Stuff that matters.
Re:Render Mermaid diagrams as SVGs or ASCII art by thangalin on Wednesday January 28, 2026 @11:59PM (#46805982)
While Mermaid gets the limelight, Kroki[1] offers: BlockDiag, BPMN, Bytefield, SeqDiag, ActDiag, NwDiag, PacketDiag, RackDiag, C4 with PlantUML, D2, DBML, Ditaa, Erd, Excalidraw, GraphViz, Nomnoml, Pikchr, PlantUML, Structurizr, Svgbob, Symbolator, TikZ, Vega, Vega-Lite, WaveDrom, WireViz, and Mermaid.

My Markdown editor, KeenWrite[2], integrates Kroki as a service. This means whenever a new text-based diagram format is offered by Kroki, it is available to KeenWrite, dynamically. The tutorial[3] shows how it works. (Aside, variables within diagrams are also possible, shown at the end.)

Note that Mermaid diagrams cannot be rendered by most libraries[4] due to its inclusion of <foreignObject>, which is browser-dependent.

[1]: https://kroki.io/

[2]: https://keenwrite.com/

[3]: https://www.youtube.com/watch?v=vIp8spwykZY

[4]: https://github.com/orgs/mermaid-js/discussions/7085

Re:Render Mermaid diagrams as SVGs or ASCII art by afro88 on Thursday January 29, 2026 @04:20AM (#46807690)
Edit: See child comments, I misunderstood. Original post below anyway.

--

To me, the diagrams have an uglier default design. A crazy amount of dropdown shadow (in the examples), stretched fonts (front page example). It doesn't matter how many diagram types you support if the generated diagrams aren't good quality.

Mermaids defaults are good enough. They're not amazing, but I'm also not embarrassed to show them to other engineers, stakeholders etc

Edit: KeenWrite looks excellent btw

Re:Render Mermaid diagrams as SVGs or ASCII art by jbstack on Thursday January 29, 2026 @05:44AM (#46808343)
Maybe I've misunderstood, but isn't the whole point that it outputs to those other formats? So if you like the way Mermaid outputs look, you'd just output to that?
Re:Render Mermaid diagrams as SVGs or ASCII art by afro88 on Thursday January 29, 2026 @06:06AM (#46808535)
Oh, you're right. I misunderstood. I think it was the comparison to mermaid that threw me, and then I checked out the examples
Re:Render Mermaid diagrams as SVGs or ASCII art by ycombiredd on Thursday January 29, 2026 @09:06AM (#46810371)
Tangentially related, I once wanted to render a NetworkX DAG in ASCII, and created phart to do so.

There's an example of a fairly complicated graph of chess grandmaster PGM taken from a matplotlib example from the NetworkX documentation website, among some more trivial output examples in the README at https://github.com/scottvr/phart/blob/main/README.md#example...

(You will need to expand the examples by tapping/clicking on the rightward-facing triangle under "Examples", so that it rotates to downward facing and the hidden content section is displayed)

Re:Render Mermaid diagrams as SVGs or ASCII art by idoubtit on Thursday January 29, 2026 @02:00PM (#46814820)
Comparing MermaidJS with Kroki is a bit like comparing PDF.js to Adobe Acrobat. I don't think either is better than the other, they're just for different use-cases.

With MermaidJS, converting a diagram inside a web page requires adding a handful of lines to a HTML page. The execution is fast and local.

Kroki is a web-service. To use it in a web page means adding a dependency to an external provider (a free service exists, but asks for fundings). An alternative is self-hosting by running a Kroki container.

A few years ago, I added Mermaid diagrams to a project in a few minutes of work. Had we needed a much more complex tool, maybe I would have gone with Kroki, but not by myself; it would have required a change in the deploying process of the project.

Re:Render Mermaid diagrams as SVGs or ASCII art by thangalin on Thursday January 29, 2026 @04:24PM (#46816821)
> An alternative is self-hosting by running a Kroki container.

Exactly, which is why KeenWrite has a "Diagram server" setting:

https://i.ibb.co/LXxm33cb/diagram-server.png

> they're just for different use-cases

Sure. A software system could support one plain text diagram format, or support a multitude without tons more effort, architecturally speaking.

Re:Render Mermaid diagrams as SVGs or ASCII art by tempaccsoz5 on Wednesday January 28, 2026 @10:48PM (#46805600)
The actual Mermaid ASCII renderer is from another project [0]. This project transliterated it to typescript and added their own theming.

[0]: https://github.com/AlexanderGrooff/mermaid-ascii

Re:Render Mermaid diagrams as SVGs or ASCII art by AlexanderGrooff on Thursday January 29, 2026 @01:34AM (#46806574)
Thanks for the credits!
Re:Render Mermaid diagrams as SVGs or ASCII art by adiian on Thursday January 29, 2026 @07:56AM (#46809562)
Re:Render Mermaid diagrams as SVGs or ASCII art by forgotpwd16 on Thursday January 29, 2026 @07:47AM (#46809471)
Meanwhile they could've just bundled mermaid-ascii and run it on wasm. But then again probably took Claude less than an hour to port this to TS. The main algorithms are 1:1 conversion.

https://github.com/AlexanderGrooff/mermaid-ascii/blob/master...

https://github.com/lukilabs/beautiful-mermaid/blob/main/src/...

Re:Render Mermaid diagrams as SVGs or ASCII art by pancsta on Thursday January 29, 2026 @10:32AM (#46811520)
And its in Go, so no package management joke involved. I will integrate it into my debugger, thx for the link!
Re:Render Mermaid diagrams as SVGs or ASCII art by dang on Thursday January 29, 2026 @01:43PM (#46814539)
Yikes, good catch. I've changed the link above to the original project now. (Edit: actually, let's use the project home page and put the Github repo in the toptext.)

(Submitted link was https://github.com/lukilabs/beautiful-mermaid. mellosouls is a good HN contributor so I'm sure this was well-intentioned.)

Re:Render Mermaid diagrams as SVGs or ASCII art by AlexanderGrooff on Thursday January 29, 2026 @02:15PM (#46815060)
I appreciate your comment, but I made mermaid-ascii OSS under MIT license so that everybody can use it in whatever fashion they like, be that in another OSS project or in your company. I’m just happy to contribute back to the ecosystem, and I’m excited seeing my projects being used by others.

Nothing but good vibes to these guys. Let’s all strive to keep making cool things, and leave things a little better than how you found it ;)

Re:Render Mermaid diagrams as SVGs or ASCII art by dang on Thursday January 29, 2026 @05:14PM (#46817518)
I'm going to take that as an implicit (and generous) request to put the submitted URL back at the top, so I've done this, and included the two links to your work in the toptext. Seems like a fair balance. Thank you!
Re:Render Mermaid diagrams as SVGs or ASCII art by falloutx on Thursday January 29, 2026 @02:18PM (#46815111)
Just another AI copies the entire project and you get to put your name on it.
Re:Render Mermaid diagrams as SVGs or ASCII art by Terretta on Wednesday January 28, 2026 @11:16PM (#46805753)
If you like Obsidian.md but can't quite recommend it for less technical folks, these devs' Craft notes spaces are a great alternative:

https://www.craft.do/

While great for individuals, it's particularly strong out-of-the-box for teams, or even teams of teams with two levels of grouping.

They bring the same ... craft (ahem) ... to the whole product as shown in their Craft Agents or this renderer, with a strong foundation originally started in the Markdown philosophy. Check out the founder's story on their About page for a refreshingly LLM-free backgrounder.

Re:Render Mermaid diagrams as SVGs or ASCII art by jonfw on Wednesday January 28, 2026 @09:44PM (#46805085)
I love ASCII diagrams! The fact that I can write a diagram that looks equally wonderful in my terminal via cat as it does rendered on my website is incredible.

A good monospaced font and they can look really sharp!

I will definitely give this tool a shot.

I will also shout out monodraw as a really nice little application for building generic ASCII diagrams- https://monodraw.helftone.com/

Re:Render Mermaid diagrams as SVGs or ASCII art by hahahahhaah on Wednesday January 28, 2026 @11:31PM (#46805835)
Importantly they also render in your source code. I love a good diagram at the top of a file.
Re:Render Mermaid diagrams as SVGs or ASCII art by mixmastamyk on Wednesday January 28, 2026 @10:36PM (#46805493)
^Unicode.
Re:Render Mermaid diagrams as SVGs or ASCII art by rahimnathwani on Wednesday January 28, 2026 @10:43PM (#46805551)
Wow! It has this:

  Subgraph Direction Override: Using direction LR inside a subgraph while the outer graph flows TD.
With this, you should be able to approximate swim lane diagrams, which is something Mermaid lacks.

The last time I checked, Mermaid couldn't render subgraphs in a different direction than the overall graph.

Re:Render Mermaid diagrams as SVGs or ASCII art by smusamashah on Wednesday January 28, 2026 @11:56PM (#46805960)
Also see https://arthursonzogni.com/Diagon for text to ascii.

I have a list of text to diagram tools here https://xosh.org/text-to-diagram/ but not many are text to ascii. There are a few text to ascii sequence diagram tools.

Re:Render Mermaid diagrams as SVGs or ASCII art by brumar on Thursday January 29, 2026 @02:57AM (#46807110)
Great list, thank you!
Re:Render Mermaid diagrams as SVGs or ASCII art by nulone on Wednesday January 28, 2026 @11:42PM (#46805885)
The ASCII output is the missing piece for AI-assisted coding workflows. LLMs can spit out Mermaid, but you can't see the diagram inline in a terminal/code-review context. This fixes that.
Re:Render Mermaid diagrams as SVGs or ASCII art by dizhn on Thursday January 29, 2026 @03:04AM (#46807161)
When I needed to see mermaid diagrams rendered the other day I realized my existing Forgejo instance already supported it so that's what I've been doing. Push to repo and check it out there. Not inline but not a bad place for code reviews. (I am sure all the other forges also support it)
Re:Render Mermaid diagrams as SVGs or ASCII art by a_t48 on Wednesday January 28, 2026 @10:09PM (#46805282)
The live demo requires some download of an AI agent platform? I'd really like to try this but not if that's what's required.
Re:Render Mermaid diagrams as SVGs or ASCII art by csmantle on Wednesday January 28, 2026 @10:26PM (#46805417)
The devs should really setup a client-only GitHub Pages for an accessible demo. Judging from skimming the project itself, it's definitely doable without locking into their platform.
Re:Render Mermaid diagrams as SVGs or ASCII art by peanutz454 on Wednesday January 28, 2026 @11:14PM (#46805745)
I get a sense of deja vu. There was another such project posted within the last 3 months, and another within last 6 months. I should have bookmarked them, because at least one of them was an open library (I think).
Re:Render Mermaid diagrams as SVGs or ASCII art by doanbactam on Wednesday January 28, 2026 @10:56PM (#46805652)
I've had issues with other CLI wrappers there. ASCII output is a nice touch for including diagrams directly in code comments without breaking formatting. Does it handle large graphs well, or does the text wrap get messy? We tried using `graph-easy` for this before but the syntax was annoying. 6.
Re:Render Mermaid diagrams as SVGs or ASCII art by dleeftink on Wednesday January 28, 2026 @10:11PM (#46805302)
Pair this with Unicode plots[0] and you're set!

[0]: https://github.com/JuliaPlots/UnicodePlots.jl

Re:Render Mermaid diagrams as SVGs or ASCII art by apwheele on Thursday January 29, 2026 @12:06AM (#46806030)
In the live demo, I am confused about some of the ascii renderings. (Unless I am missing something, they appear incorrect/inconsistent with the SVG.), https://agents.craft.do/mermaid

So for the "All Edge styles"

    graph TD
      A[Source] -->|solid| B[Target 1]
      A -.->|dotted| C[Target 2]
      A ==>|thick| D[Target 3]
Results in the ascii

    ┌──────────┐                                     
    │          │                                     
    │  Source  ├─thickted─────┐                      
    │          │        │     │                      
    └─────┬────┘        └─────┼────────────────┐     
          │                   │                │     
          │                   │                │     
        solid                 │                │     
          │                   │                │     
          ▼                   ▼                ▼     
    ┌──────────┐        ┌──────────┐     ┌──────────┐
    │          │        │          │     │          │
    │ Target 1 │        │ Target 2 │     │ Target 3 │
    │          │        │          │     │          │
    └──────────┘        └──────────┘     └──────────┘
(The svg for this example is maybe misleading, as it looks like un upside down T) But the ascii here has the overlapping words, and you cannot tell the difference in any of the lines.

The Parallel links, example mermaid

    graph TD
      A[Input] & B[Config] --> C[Processor]
      C --> D[Output] & E[Log]
results in ascii

    ┌───────────┐     ┌────────┐
    │           │     │        │
    │   Input   │     │ Config │
    │           │     │        │
    └─────┬─────┘     └────┬───┘
          │                │    
          │                │    
          │                │    
          │                │    
          ▼                │    
    ┌───────────┐          │    
    │           │          │    
    │ Processor ├◄─────────┤    
    │           │          │    
    └─────┬─────┘          │    
          │                │    
          │                │    
          │                │    
          │                │    
          ▼                ▼    
    ┌───────────┐     ┌────────┐
    │           │     │        │
    │   Output  │     │  Log   │
    │           │     │        │
    └───────────┘     └────────┘
This is just wrong isn't it? Why is there an arrow from config to log?
Re:Render Mermaid diagrams as SVGs or ASCII art by wrboyce on Thursday January 29, 2026 @04:24AM (#46807725)
The latter one is a rendering issue I think, the right hand side of Processor is being used as an input from Config and an output to Log but the arrows overlap and become ambiguous.
Re:Render Mermaid diagrams as SVGs or ASCII art by lubujackson on Wednesday January 28, 2026 @11:14PM (#46805742)
This is great, I will definitely make use of this!
Re:Render Mermaid diagrams as SVGs or ASCII art by wyes on Wednesday January 28, 2026 @10:31PM (#46805455)
How is the LaTeX compatibility? Base mermaid's LaTeX compatibility is quite sparse.
Re:Render Mermaid diagrams as SVGs or ASCII art by jackconsidine on Wednesday January 28, 2026 @10:04PM (#46805242)
> Aesthetics — Might be personal preference, but wished they looked more professional

Im sold. Love mermaid but totally agree.

Re:Render Mermaid diagrams as SVGs or ASCII art by cjlm on Wednesday January 28, 2026 @10:39PM (#46805518)
See also graph-easy.online (https://github.com/cjlm/graph-easy-online)
Re:Render Mermaid diagrams as SVGs or ASCII art by LeonidBugaev on Thursday January 29, 2026 @12:25AM (#46806144)
Nice one! I had my own spin on this issue as well, but from the other angle https://github.com/probelabs/maid

Getting AI to generate valid mermaid diagrams on scale extremely hard. With maid i'm hitting 100% accuracy.

Maid is basically built from scratch mermaid parser, without any dependnecies, which knows how to auto-fix common AI slop diagramming issues.

Re:Render Mermaid diagrams as SVGs or ASCII art by ijustlurk on Thursday January 29, 2026 @05:11PM (#46817477)
Nice one. Mermaid validation is a huge issue given how mermaid.js is architected.

I built a mermaid generation harness last year and even the best model at it (Claude Sonnet 3.7 at the time; 4o was okay, Gemini struggled) only produced valid mermaid ~95% of the time. That failure rate adds up quickly. Had to detect errors client-side and trigger retries to keep server load reasonable.

Having a lightweight parser with auto-fix like this back then would have simplified the flow quite a bit.

Re:Render Mermaid diagrams as SVGs or ASCII art by reboot7417 on Thursday January 29, 2026 @02:05AM (#46806762)
Looks awesome, perfect for a feature request for CC [0] I opened a while back.

[0]: https://github.com/anthropics/claude-code/issues/14375

Re:Render Mermaid diagrams as SVGs or ASCII art by smilingleo on Thursday January 29, 2026 @02:37AM (#46806990)
I’m not entirely sure why there’s a push toward ASCII diagrams (perhaps influenced by AI usage). Mermaid and PlantUML are already text-based representations, and what most users actually want is a rendered diagram in a standard, widely recognized notation—primarily for humans, not machines.

ASCII diagrams are inherently constrained by printable characters, which makes them hard to standardize and limits their expressiveness compared to proper diagram renderers.

Re:Render Mermaid diagrams as SVGs or ASCII art by benrutter on Thursday January 29, 2026 @03:52AM (#46807496)
I think context matters, often I might be writing docs in a text format that doesn't support mermaid (some readmes for instance, or a print put in a CLI tool) and want diagrams.

In those contexts, rendered mermaid as html isn't an option, so this really does seem like one of the best calls for human readability.

Re:Render Mermaid diagrams as SVGs or ASCII art by tuetuopay on Thursday January 29, 2026 @03:24AM (#46807280)
They don't need a renderer, so they can be embedded in source code comments, or in markdown document without requiring e.g. Gitlab to properly render the document. And even then, they're still "rendered" when editing said markdown document.
Re:Render Mermaid diagrams as SVGs or ASCII art by gregoriol on Thursday January 29, 2026 @03:23AM (#46807272)
You can put ASCII diagrams in code comments.

Also Claude code in the terminal can show them.

Re:Render Mermaid diagrams as SVGs or ASCII art by dmos62 on Thursday January 29, 2026 @04:57AM (#46807967)
A lot of people primarily use markdown and command-line, and, importantly, so do many coding agents (which seems to be the authors' primary use case).
Re:Render Mermaid diagrams as SVGs or ASCII art by esafak on Thursday January 29, 2026 @09:14AM (#46810471)
GFM supports Mermaid.
Re:Render Mermaid diagrams as SVGs or ASCII art by jbstack on Thursday January 29, 2026 @05:37AM (#46808263)
What you mean is that you don't find ASCII diagrams useful. Other people do (see other comments). I find them useful for Org Mode where I prefer to work with just text instead of having to keep separate image files together with my .org files. They're also easier to work with if you need to check them into a Git repo and you don't want to be bothered with something like Git LFS or git-annex. The fact that there are people who want them is enough to explain "why there's a push toward" them (assuming there is actually such a push).
Re:Render Mermaid diagrams as SVGs or ASCII art by peter_retief on Thursday January 29, 2026 @03:03AM (#46807145)
Looks really useful to document complex applications, I will give it a try.
Re:Render Mermaid diagrams as SVGs or ASCII art by rcarmo on Thursday January 29, 2026 @03:09AM (#46807190)
Am I reading this right and it doesn’t need any DOM or browser engine at all? That would indeed be awesome.
Re:Render Mermaid diagrams as SVGs or ASCII art by altano on Thursday January 29, 2026 @03:43AM (#46807432)
Who’s going to make the rehype plugin?
Re:Render Mermaid diagrams as SVGs or ASCII art by dochtman on Thursday January 29, 2026 @04:27AM (#46807756)
Re:Render Mermaid diagrams as SVGs or ASCII art by robin_reala on Thursday January 29, 2026 @04:44AM (#46807881)
Note that by doing ASCII you’re sacrificing possible accessibility; WCAG 1.0 specifically called ASCII images out as a problem in 1999.

(Mermaid isn’t accessible by default either, but there’s current work in that direction: https://github.com/mermaid-js/mermaid/pull/7349)

Re:Render Mermaid diagrams as SVGs or ASCII art by ozim on Thursday January 29, 2026 @05:23AM (#46808165)
Just imagined what a garbage would screen reader spit out.
Re:Render Mermaid diagrams as SVGs or ASCII art by patrick4urcloud on Thursday January 29, 2026 @04:53AM (#46807945)
very good job nice. i will give a try !
Re:Render Mermaid diagrams as SVGs or ASCII art by dmos62 on Thursday January 29, 2026 @04:54AM (#46807949)
Really cool. Alexander Grooff (this is based on his go library [0]) did a great job.

[0]: https://github.com/AlexanderGrooff/mermaid-ascii

I think I ran into a bug, the "start" edge is not rendered. This is from https://agents.craft.do/mermaid:

    stateDiagram-v2
      [*] --> Idle
      Idle --> Active : start
      Active --> Idle : cancel
      Active --> Done : complete
      Done --> [*]

    ┌──────────┐
    │          │
    │          │
    │          │
    └─────┬────┘
          │     
          │     
          │     
          │     
          ▼     
    ┌──────────┐
    │          │
    │   Idle   │
    │          │
    └─────┬────┘
          ▲     
          │     
      cancel   
          │     
          ▼     
    ┌─────┴────┐
    │          │
    │  Active  │
    │          │
    └─────┬────┘
          │     
          │     
      complete  
          │     
          ▼     
    ┌──────────┐
    │          │
    │   Done   │
    │          │
    └─────┬────┘
          │     
          │     
          │     
          │     
          ▼     
    ┌──────────┐
    │          │
    │          │
    │          │
    └──────────┘
Re:Render Mermaid diagrams as SVGs or ASCII art by mjaniczek on Thursday January 29, 2026 @06:49AM (#46808943)
It seems like the ASCII/Unicode mode doesn't work all that well: https://agents.craft.do/mermaid#sample-6
Re:Render Mermaid diagrams as SVGs or ASCII art by Lio on Thursday January 29, 2026 @08:36AM (#46810022)
I love Mermaid and Markdown as a combination for documentation.

I wonder if we can get the ASCII render to run inside Vim/NeoVim?

Re:Render Mermaid diagrams as SVGs or ASCII art by intellectronica on Thursday January 29, 2026 @10:56AM (#46811892)
Re:Render Mermaid diagrams as SVGs or ASCII art by tracker1 on Thursday January 29, 2026 @11:06AM (#46812083)
While a bit nifty to have this available in the TS/JS ecosystem for web usage... I'm not sure it'd be my first thing if I were using such a thing as a CLI.

Adjacent... I am somewhat curious if a well crafted rust library/app might work better via WASM since it's a relatively simple input/output scenario... I've done similar for input sanitization tasks in the past and it worked better than JS/TS.

Re:Render Mermaid diagrams as SVGs or ASCII art by tnkuehne on Thursday January 29, 2026 @11:17AM (#46812260)
Quite nice for cloudflare workers as they don’t have access to DOM
Re:Render Mermaid diagrams as SVGs or ASCII art by btucker on Thursday January 29, 2026 @12:29PM (#46813365)
I've been working on https://github.com/btucker/selkie which is a complete implementation of the Mermaid parser & renderer in rust as an experiment in what's possible with Claude Code. It's still rough around the edges, but I've been blown away by what's been possible. (I'm now using it as a test repo for https://github.com/btucker/midtown)

Playground here: https://btucker.github.io/selkie/

One of the cool features is it can use kitty to output diagrams direct to the terminal (if kitty is supported like in ghostty).

I'm planning to blog about the whole process soon.

Re:Render Mermaid diagrams as SVGs or ASCII art by joopie on Thursday January 29, 2026 @12:54PM (#46813724)
This is a really cool project, and incredible traction - great job! I can see how this would work well with Claude Code to quickly explain what's going on.

I've worked on a similar project, but instead of going the ASCII route, we decided to lean into interactivity for code exploration. The angle is more around empowering human understanding, instead of agent understanding. We also chose D2 (and are looking to support Mermaid soon too).

Would love to hear others' thoughts on whether interactivity for humans is more valuable vs context for agents.

https://github.com/unslop-xyz/noodles

Re:Render Mermaid diagrams as SVGs or ASCII art by hbcondo714 on Thursday January 29, 2026 @01:00PM (#46813841)
Nice! Mermaid diagrams show up as their source code in Github Pages so perhaps this can be resolved now

https://github.com/orgs/community/discussions/65040

Re:Render Mermaid diagrams as SVGs or ASCII art by lasgawe on Thursday January 29, 2026 @01:11PM (#46814029)
nice project. previously, I used other tools to draw diagrams manually when I needed to add them to source code comments. You solved a big problem. I really appreciate it.
Re:Render Mermaid diagrams as SVGs or ASCII art by noisy_boy on Thursday January 29, 2026 @01:15PM (#46814075)
I really tried to like Mermaid but the difficulty in styling gets tiring after a while. Went back to trusty .puml for sequence diagrams - much more expressive when it comes to styling.
Re:Render Mermaid diagrams as SVGs or ASCII art by dang on Thursday January 29, 2026 @01:48PM (#46814609)
Related:

Show HN: Mermaid ASCII Diagrams - https://news.ycombinator.com/item?id=41847407 - Oct 2024 (50 comments)

Re:Render Mermaid diagrams as SVGs or ASCII art by javier_e06 on Thursday January 29, 2026 @02:31PM (#46815324)
I love this project! I am minimalist web-gui averse being embedded dev and all my documentation is plain ascii. This tool will prove useful for posterity. Thanks!