Docs-as-code teams already keep prose in version control. The missing piece is usually the diagrams — still exported as PNGs from a design tool and perpetually out of date. Markdy closes that gap: drop ananimated architecture diagram straight into your Astro or MDXcontent as text, and it renders in the browser, versioned alongside the page.

Astro: one island component

Install @markdy/astro and pass your scene as a code prop. The island hydrates only when it scrolls into view, so it never blocks your critical render path:

---
import { Markdy } from "@markdy/astro";

const code = `
  scene theme=paper width=800 height=400
  browser Web
  service API
  beat main:
    show $nodes
    Web -> API "GET /users"
`;
---

<Markdy code={code} width={800} height={400} bg="#07111f" autoplay />

MDX: fenced code blocks

With @markdy/mdx you write a markdy fenced block right in Markdown — no per-file component imports:

```markdy
scene theme=paper
browser Web
service API
beat main:
  show $nodes
  Web -> API "GET /users"
```

The remark plugin turns that block into a lazy-loaded diagram component. Your authors keep writing Markdown; the diagrams come along for free.

Why this beats a screenshot

A tidy docs workflow

  1. Draft the scene in the playground until it looks right.
  2. Commit the .markdy source (or inline it) next to the doc.
  3. Lint diagrams in CI with markdy lint so a broken diagram fails the build.
  4. Let an AI agent keep them updated as the system changes.

Read the documentation for the full component API, then ship docs where the diagrams move with your system instead of drifting away from it.