D2
D2 snippets can be converted into images automatically for any snippets tagged with the d2
language and using a +render
attribute:
```d2 +render
my_table: {
shape: sql_table
id: int {constraint: primary_key}
last_updated: timestamp with time zone
}
```
This requires having d2 installed.
Similar to mermaid diagrams support, d2 diagrams:
- Will take some time because of how slow the d2 tool is.
- Can be scaled by using a
+width:<number>%
attribute in the snippet or by setting thed2.scale
property in the config file, which is passed along to the--scale
parameter to the d2 CLI.
Theme
The theme of the rendered d2 diagrams can be changed through the d2.theme
theme
parameter. See the available themes in the d2 docs.