Settings > Community plugins > Browse > Search for "D2"
important: D2 must be installed for this plugin to work currently. We will later on introduce a remote API as an option, but currently this plugin calls your local installation of D2.
Layout engine
: D2 supports multiple layout engines, which can significantly affect the look of your diagram.Theme ID
: For a list of available themes, visit the D2 repository.Pad
: Number of pixels padded around the rendered diagram.Sketch mode
: Render the diagram to look like it was sketched by hand.Container height
: Diagram max render height in pixels (Requires d2 v0.2.2 and up).Debounce
: Number of milliseconds to wait after a change has made to refresh the diagram (min 100).Path
: Customize the path to d2
(optional). We check common places D2 might be installed, along with your system path. However, your OS or setup may require you to input your path to d2
manually. To do so, type where d2
into your terminal, and copy everything in the path up until /d2
and paste it into this configuration.Create a fenced codeblock with d2
as the language tag:
Hello -> World
yarn
to install dependencies.yarn run dev
to start compilation in watch mode.main.js
, styles.css
, manifest.json
to your vault [VaultFolder]/.obsidian/plugins/d2/
.D2 Compilation Error: d2: command not found
where d2
in the command line, then copy that path minus the executable itself into the Path
plugin setting (so if the path is /usr/local/bin/d2
, then you want to copy /usr/local/bin
).