docs/src/features/code/d2.md
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:
+width:<number>% attribute in the snippet or by setting the d2.scale property in the
config file, which is passed along to the --scale parameter to the d2 CLI.The theme of the rendered d2 diagrams can be changed through the d2.theme theme
parameter. See the available themes in the d2 docs.