A modern diagram scripting language that turns text to diagrams.
[Docs](https://d2lang.com) | [Cheat sheet](./docs/assets/cheat_sheet.pdf) | [Comparisons](https://text-to-diagram.com) | [Playground](https://play.d2lang.com)
[](https://github.com/terrastruct/d2/actions/workflows/ci.yml)
[](https://github.com/terrastruct/d2/actions/workflows/daily.yml)
[](https://github.com/terrastruct/d2/releases)
[](https://discord.gg/NF6X8K4eDq)
[](https://twitter.com/terrastruct)
[](./LICENSE.txt)
https://user-images.githubusercontent.com/3120367/206125010-bd1fea8e-248a-43e7-8f85-0bbfca0c6e2a.mp4
# Table of Contents
- [What does D2 look like?](#what-does-d2-look-like)
- [Quickstart](#quickstart)
- [Install](#install)
- [D2 as a library](#d2-as-a-library)
- [Themes](#themes)
- [Fonts](#fonts)
- [Export file types](#export-file-types)
- [Language tooling](#language-tooling)
- [Plugins](#plugins)
- [Comparison](#comparison)
- [Contributing](#contributing)
- [License](#license)
- [Related](#related)
- [Official plugins](#official-plugins)
- [Community plugins](#community-plugins)
- [Misc](#misc)
- [FAQ](#faq)
- [Notable open-source projects documenting with D2](#notable-open-source-projects-documenting-with-d2)
## What does D2 look like?
```d2
# Actors
hans: Hans Niemann
defendants: {
mc: Magnus Carlsen
playmagnus: Play Magnus Group
chesscom: Chess.com
naka: Hikaru Nakamura
mc -> playmagnus: Owns majority
playmagnus <-> chesscom: Merger talks
chesscom -> naka: Sponsoring
}
# Accusations
hans -> defendants: 'sueing for $100M'
# Claim
defendants.naka -> hans: Accused of cheating on his stream
defendants.mc -> hans: Lost then withdrew with accusations
defendants.chesscom -> hans: 72 page report of cheating
```
> There is syntax highlighting with the editor plugins linked below.