markdown-d2¶
markdown-d2 turns D2 diagrams into pictures in a site
built with zensical or Python-Markdown. You write a diagram as text in a d2
code block, and the build draws it, once for the light theme and once for the
dark one. Your readers get the picture with the page: they download no extra
software, and they can step through the diagram and open it full screen.
This picture comes from this block:
```d2 title="A web request"
browser -> server: HTTPS
server -> cache: look up
server -> database: query
cache -> database: refresh
```
Because the build draws every diagram, a mistake in one stops the build with a message naming the page, the diagram and the line, so a broken picture never reaches your readers.
Where to go next¶
- To start, draw your first diagram in a small site of your own.
- If you have a site already, the how-to guides show how to
show a diagram one step at a time,
import files and icons,
change how a diagram looks,
fix a broken diagram and
use
markdown-d2withoutzensical. - To look something up, the reference lists the settings, what the figure holds, which D2 features work and the Python API.
- To understand how it works, read about drawing diagrams when the site is built.