You know how people have little “eternal quests” like searching for the perfect wallet, or the perfect t-shirt, or whatever? One of mine is the perfect app for making diagrams in Emacs and Org-mode. My go to solution is Graphviz, which I always seem to end up using. It’s powerful and not too hard to use but I don’t use it enough to internalize its syntax. So I’m always on the lookout for a better way. I’ve tried a bunch of them but I always go back to Graphviz.
I just saw this video by Skybert Hacks (Torstein Krause Johansen) about using D2 for this very problem. Its syntax seems reminiscent of Graphviz but a little simpler and easier to remember. It integrates beautifully with Org-mode so it’s just perfect for writing reports, papers, notes, or blog posts.
D2 produces nice diagrams—see the Skybert Hacks’ video for some examples—and is worth trying out. I’m going to do just that the next time I need to embed some videos in one of my documents. I just saw the video so I’m not familiar with the ins and outs of the app yet but it seems worth a little effort to learn. Once I try it out, I’ll report back and let you know how it worked out.