Writerside supports adding diagrams using D2, a declarative language for diagramming.
note
Make sure that you have D2 installed as described in the documentation.
To add a D2 diagram, use a code block with the language set to d2:
Semantic markup
Markdown
<code-blocklang="d2">
direction: right
question: Do you write docs?
yes: Use Writerside
no: You should
question -> yes: Yes
question -> no: No
</code-block>
```d2
direction: right
question: Do you write docs?
yes: Use Writerside
no: You should
question -> yes: Yes
question -> no: No
```
The result will look as follows:
Reference D2 diagram from file
If you have a file with D2 code, you can reference it instead of copying the D2 code into the code block. For more information, see Reference code from file.