https://github.com/hyp3r00t/d2lab
https://github.com/hyp3r00t/d2lab
architecture d2lang devcontainer diagram
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hyp3r00t/d2lab
- Owner: HYP3R00T
- Created: 2025-08-20T15:06:19.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-11-11T19:15:11.000Z (7 months ago)
- Last Synced: 2026-02-14T04:27:45.236Z (4 months ago)
- Topics: architecture, d2lang, devcontainer, diagram
- Language: D2
- Homepage:
- Size: 695 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# d2lab
Small, focused repo for authoring D2 diagrams. Sources live in `diagram/` and exports (PNG/SVG) are written to `output/` via a small script and a `mise` watch task.
## Icon Set
- [Kubernetes Icons](https://github.com/kubernetes/community/tree/master/icons)
- [AWS Icons](https://aws-icons.com/)
- [Azure Icons](https://az-icons.com/)
- [GCP Icons](https://gcpicons.com/)
- [IBM Icons](https://github.com/IBM-Cloud/architecture-icons)
- [Dashboard Icons (dashboardicons)](https://dashboardicons.com/)
- [Dashboard Icons (selfh.st)](https://selfh.st/icons/)
- [Software Architecture Diagram Icons](https://icons.terrastruct.com/)
## Quick start (Dev Container)
Prereqs: Docker + VS Code.
1) Open this repo in VS Code and run: "Dev Containers: Reopen in Container".
2) The container will run `scripts/setup.sh` to install D2, Playwright (for PNG export), `watchexec`, etc.
3) Start watching a diagram and auto-regenerate on save:
```bash
mise run watch ./path/to/diagram
```
Exports land in `./output/diagram.png` and `./output/diagram.svg`.
## Local setup (without Dev Container)
- Install mise: https://mise.jdx.dev
- Trust and install tools for this repo:
```bash
mise trust
mise install
```
- Install D2 CLI if not present: https://d2lang.com/tour/install
- Install Playwright Chromium (required for PNG export):
```bash
npm -g install playwright
npx playwright install --with-deps chromium
```
Now you can use the same watch task:
```bash
mise run watch ./path/to/diagram
```
## One-off render (no watch)
Use the helper script directly:
```bash
./scripts/d2_to_output.zsh ./diagram/homelab.d2
```
This writes `./output/homelab.png` and `./output/homelab.svg`.
## Sponsor
If this project helps you, consider supporting it:
- GitHub Sponsors: https://github.com/sponsors/HYP3R00T