Rehype plugin to generate d2 diagrams in place of code fences. This:
```d2
x -> y: hello world
```
will be converted to
<figure class="beoe d2">
<svg>...</svg>
</figure>
which can look like this:
import rehypeD2 from "@beoe/rehype-d2";
const html = await unified()
.use(remarkParse)
.use(remarkRehype)
.use(rehypeD2)
.use(rehypeStringify)
.process(`markdown`);
Online documentation provides more details.