Skip to content

The official D2 plugin for Obsidian. D2 is a modern diagram scripting language thats turns text to diagrams.

License

Notifications You must be signed in to change notification settings

stevevandermerwe/d2-obsidian

 
 

Repository files navigation

D2

D2 Obsidian Plugin

D2 is a modern diagram scripting language thats turns text to diagrams. The source code for D2, as well as install instructions and all other information, can be found at https://github.com/terrastruct/d2.

ci ci license discord

d2_obsidian_example.mp4

Installation

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.

Configurations

  • 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.
  • 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.

Usage

Create a fenced codeblock with d2 as the language tag:

Hello -> World

How to run this plugin locally

  • Clone this repo.
  • Run yarn to install dependencies.
  • Run yarn run dev to start compilation in watch mode.
  • Copy over main.js, styles.css, manifest.json to your vault [VaultFolder]/.obsidian/plugins/d2/.

FAQ

  • I have a question or need help.
    • The best way to get help is to ask on D2 Discord.
  • I'd like to contribute.
    • We welcome contributions! Please pick one from an existing Issue, or open one if none exists.
  • I have a feature request, proposal, or bug report.
    • Please open up a Github Issue. If it's D2-specific, please open it in the D2 repository. If it's specific to this plugin, please open it here.
  • I have a private inquiry.

About

The official D2 plugin for Obsidian. D2 is a modern diagram scripting language thats turns text to diagrams.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 82.2%
  • JavaScript 10.0%
  • CSS 4.7%
  • Makefile 1.6%
  • Shell 1.5%