D2 diagrams

Last modified: 11 November 2024

Writerside supports adding diagrams using D2, a declarative language for diagramming.

To add a D2 diagram, use a code block with the language set to d2:

<code-block lang="d2">
    direction: right
    question: Do you write docs?
    yes: Use Writerside
    no: You should
    question -> yes: Yes
    question -> no: No
</code-block>

The result will look as follows:

Do you write docs?Use WritersideYou should YesNo