An open API service indexing awesome lists of open source software.

https://github.com/hyp3r00t/d2lab


https://github.com/hyp3r00t/d2lab

architecture d2lang devcontainer diagram

Last synced: 4 months ago
JSON representation

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