Declart

by iyulab
5
4
3
2
1
Score: 50/100

Description

Obsidian plugin that renders declart code blocks as SVG diagrams.

Reviews

No reviews yet.

Stats

0
stars
18
downloads
0
forks
3
days
3
days
3
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
7
commits

README file from

Github

Declart for Obsidian

Release CI License: MIT

Prose diagrams in your notes. Write what to show in a declart code block — the plugin draws it.

A note in Obsidian: a declart code block rendered as a four-stage pipeline diagram, with success and warning markers

Declart is a declarative diagram language for written content. A diagram is data — kinds, labels, a little meaning — and the engine decides layout, typography and color. This plugin renders declart code blocks as SVG diagrams in Obsidian, the way Mermaid blocks render. No colors, coordinates or fonts to manage, and the source stays plain text in your vault.

```declart
kind = "flow"
title = "Release Pipeline"

[[items]]
label = "Build"
status = "success"

[[items]]
label = "Test"
status = "warning"

[[items]]
label = "Deploy"
emphasis = "primary"

[[items]]
label = "Monitor"
```

In Live Preview a block shows the diagram by default; use the </> ("Edit this block") button to edit the declaration, and move the cursor out to see the diagram again.

Diagram kinds

Nine kinds, each with semantic views: flow (process, cycle, funnel, swimlane), tier (pyramid, concentric), hierarchy (org chart, fishbone, mind map), timeline, matrix, hub_spoke, venn, comparison and state. See the documentation and spec for each kind's fields, or try declarations in the live playground.

TOML and JSON declarations are both supported. A declaration that fails to parse is shown as an error message inside the block; the rest of the note is unaffected.

Install (manual)

  1. Build the plugin (see below) or take main.js, manifest.json and styles.css from a release.
  2. Copy the three files to <your vault>/.obsidian/plugins/declart/.
  3. In Obsidian, open Settings → Community plugins and enable Declart.

The WebAssembly renderer is inlined into main.js, so no other files are needed.

The plugin is currently marked desktop-only: it does not use desktop-only APIs, but it has not been tested on mobile yet.

Settings

  • Theme — Auto follows Obsidian's light and dark mode (default / dark); or pick a built-in theme. Diagram backgrounds are transparent.
  • Width — canvas width in pixels; leave empty for automatic.

Build

Requires Node.js 22.18 or later.

npm ci
npm run build   # copies the renderer into src/wasm/, then bundles main.js
npm run typecheck
npm test

The renderer is the WebAssembly build published as @iyulab/declart-web (source: declart). It is pinned to an exact version in package.json; copy-wasm.js copies it into src/wasm/ and esbuild.js inlines it into main.js. To take a newer renderer, bump that dependency.

Release assets are built by CI and carry GitHub artifact attestations.

Privacy

The plugin makes no network requests, collects no telemetry, and does not read or write any files outside your vault. Diagrams are rendered locally by a bundled WebAssembly module.

License

MIT. See LICENSE. Third-party components bundled into the renderer (including the embedded Noto Sans font, under the SIL Open Font License 1.1) are listed in THIRD-PARTY-NOTICES.md.