Live data from Hacker News

D2 (text to diagram tool) now supports ASCII renders

d2lang.com

31–40 of 74 posts

Re: D2 (text to diagram tool) now supports ASCII renders

#31
post #29
post #21

This is awesome. I hadn't heard of D2, but I love the idea that I can create my charts directly in Neovim in the terminal to get a rough draft, and do a final render with a pretty picture. I will be playing with this shortly.

D2 already supports a live-updating HTTP server serving a live-updating .svg, so if you tile a browser with vim, you can already get live-updates. I discovered D2 about a year ago, and I use it for all of my diagrams now.

Yeah but that doesn't feel nearly as nerdy and cool :)

There's a sort of elegance to ASCII rendering.

Re: D2 (text to diagram tool) now supports ASCII renders

#34

This looks way better than mermaid. Is there support for this in GitHub PR code blocks like mermaid?

No, sadly. That's still the biggest obstacle for a lot of my documentation. I push mermaid perhaps a little farther than it wants to go just so I don't have to spend the time setting up a CI pipe to compile the D2 into a PNG which is embedded in the documentation.

Re: D2 (text to diagram tool) now supports ASCII renders

#35

I always liked D2 more than mermaid, except IMO, this makes grid layouts essentially useless: https://github.com/terrastruct/d2/issues/1164 Having to figure out the exact pixel widths defeats the point of these tools, at least for me.

Thanks! Good to know, we'll slot this for 0.7.2 (next release)

Re: D2 (text to diagram tool) now supports ASCII renders

#36

I always liked D2 more than mermaid, except IMO, this makes grid layouts essentially useless: https://github.com/terrastruct/d2/issues/1164 Having to figure out the exact pixel widths defeats the point of these tools, at least for me.

Thanks! Good to know, we'll slot this for 0.7.2 (next release)

Oh that is awesome! I would really appreciate it!

Could you also get d2 into GitHub and Notion while you have it here :)

Re: D2 (text to diagram tool) now supports ASCII renders

#37

This looks way better than mermaid. Is there support for this in GitHub PR code blocks like mermaid?

Unfortunately not, I've tried reaching out to GH folks but no dice. However it should be noted that d2.js, which enables client-side renders, didn't really become usable until this month and still isn't really officially released (kind of hidden). So, we'll see if the official release (soon™) changes things. If any D2-enjoyers reading this knows anyone on the GH frontend team, plz bend their ear =)

Re: D2 (text to diagram tool) now supports ASCII renders

#39

Earlier quoted context omitted.

Yeah, but weird/unfortunate that it's written in vimscript.

How on earth can it be weird that a vim extension is written in vimscript?!

Vim is basically dead. Most new plugins are written in Lue (for Neovim). I don’t like Lue much but it’s 1000x better than vim script. I occasionally tweak my Neovim plugins but don’t bother with those written in Vimscript.
Post reply on HN