Adding diagrams to my static site generator with D2 0 ▲ Giles' blog 1 hour ago · Tech · hide · 0 comments A lot of the time when I've been writing posts for this blog, I've felt that a diagram would really help. But they're a pain to produce well, and I think I underuse them as a result. I wanted to fix that, and wound up adding D2 support to my static site generator. I think it works pretty well! In the past, I've tried drawing my own diagrams in LibreOffice and exporting as SVG, but my complete lack of artistic skill doesn't help: Asking an AI to do it for me helped in simple cases: ...but with something less standard (there must be a million neural network diagrams in their training sets) it can be really fiddly to get something right. I did some investigations into the various diagram-generating tools out there, and decided to give D2 a go. It has a simple language for specifying what your diagram should show, and the output is pretty nice: Here's the source for that diagram: style.fill: transparent tokens: Tokens tokens -> llm.token-embeddings llm: "" { token-embeddings: Token… No comments yet. Log in to reply on the Fediverse. Comments will appear here.