jeongsol44 downloadsEdit D2 source files and automatically render SVG previews in Obsidian.
D2 File Preview lets you edit .d2 files in Obsidian and automatically renders sibling SVG previews.
Rendering runs locally and offline through the bundled D2.js/WebAssembly engine. A separate D2 executable is not required.
Untitled.d2 file, or open an existing .d2 file..svg file with the same base name.If rendering fails, the plugin shows a short notice and writes details to the developer console. The last successfully generated SVG remains unchanged, and rendering is retried after the next source edit.
D2 imports between .d2 files inside the current vault are supported, including relative imports. Imports outside the current vault are not supported.
To let D2 resolve imports itself, the plugin supplies the vault's .d2 files to the bundled renderer for each render. Very large vaults containing many D2 files may therefore take longer to render.
The plugin no longer uses a system D2 executable. The former D2 executable path setting has been removed; any previously saved value is ignored.
The plugin does not include a dedicated D2 editor, render-options UI, manual Render command, ribbon/context-menu actions, or automatic SVG cleanup after D2 rename/delete operations.
MIT. See THIRD_PARTY_NOTICES.md for the bundled D2.js dependency.