Kroki

by Greg Zuro
5
4
3
2
1
Score: 63/100

Description

Category: Data Visualization

The Kroki plugin allows you to render diagrams in Obsidian, using the Kroki server or a custom one. With this plugin, you can easily include various diagram types such as sequence diagrams, flowcharts, and more into your notes. To use it, simply create a fenced code block with the diagram type specified as the language, and add your diagram code inside. The plugin supports multiple diagram types and allows for customization through options.

Reviews

No reviews yet.

Stats

58
stars
11,226
downloads
34
forks
1,797
days
16
days
16
days
15
total PRs
0
open PRs
7
closed PRs
8
merged PRs
15
total issues
3
open issues
12
closed issues
7
commits

Latest Version

17 days ago

Changelog

1.3.1

Scorecard / hygiene polish on top of 1.3.0 — no behaviour changes for end users beyond the settings-tab tweak below.

Plugin

  • The PNG action link is now hidden for diagram types whose Kroki server doesn't generate PNG output (BPMN, Bytefield, D2, DBML, Excalidraw, Nomnoml, Pikchr, Svgbob, Symbolator, WaveDrom). Previously the link was always rendered and 404'd for those types. The Edit link now uses the SVG URL, which works for every type.
  • Settings tab no longer shows a "General" heading at the top (Obsidian's style guide: the first section is unheaded).
  • Switched documentactiveDocument inside the diagram renderer and the settings link helper so things keep working when Obsidian is hosted in a popout window.
  • Internal: settings-textarea handler no longer hands the DOM a Promise<void> where a void callback was expected.

Build & supply chain

  • package-lock.json is committed; CI now uses npm ci.
  • pako pinned to an exact version; the unused builtin-modules dev dependency dropped (esbuild uses node:module's builtinModules).
  • Release workflow attaches a GitHub artifact attestation (actions/attest-build-provenance) to main.js, manifest.json, and styles.css.

Repo

  • New CONTRIBUTING.md covering dev setup, testing in a real vault, and the release flow.

What's Changed

Full Changelog: https://github.com/gregzuro/obsidian-kroki/compare/1.3.0...1.3.1

README file from

Github

Obsidian Kroki

Render Kroki Diagrams in Obsidian.

This plugin uses, by default, the Kroki server for rendering, but specifying an alternate one via this plugin's options is encouraged.

If you can't find an alternate, then you can host your own server as described here.

This plugin is a modified and slightly expanded version of the obsidian-plantuml plugin by Johannes Theiner.

Supported diagram types

Diagram type Code-block language Notes
BlockDiag blockdiag
BPMN bpmn
Bytefield bytefield
SeqDiag seqdiag
ActDiag actdiag
NwDiag nwdiag
PacketDiag packetdiag
RackDiag rackdiag
C4 with PlantUML c4plantuml
Ditaa ditaa
Diagrams.net (draw.io) diagramsnet Disabled by default — needs a self-hosted Kroki with the yuzutech/kroki-diagramsnet companion
Erd erd
Excalidraw excalidraw
GraphViz graphviz
Mermaid mermaid Disabled by default to avoid clashing with Obsidian's built-in Mermaid — enable and rename to e.g. kroki-mermaid
Nomnoml nomnoml
Pikchr pikchr
PlantUML plantuml Disabled by default to avoid clashing with the PlantUML plugin — enable and rename to e.g. kroki-plantuml
Structurizr structurizr
Svgbob svgbob
UMlet umlet
Vega vega
Vega-Lite vegalite
D2 d2
WireViz wireviz
WaveDrom wavedrom
DBML dbml
Symbolator symbolator
TikZ tikz

Anything else Kroki supports server-side should work too — pick an unused diagram-type slot in settings and set its kroki block name to the new type. PRs adding first-class entries for new types are welcome.

Usage

Create a fenced codeblock using one of the diagram types supported by kroki as the language. See the Kroki site for a complete list of supported diagram types. Specify your diagram code inside the codeblock.

On desktop the diagram is rendered as inline SVG, so links inside the diagram (e.g. GraphViz URL= nodes) stay clickable. On mobile, and as a fallback if the SVG can't be fetched, it is rendered as an <img>.

Below each diagram there are two small links: PNG downloads a PNG of the diagram, and Edit opens it in niolesk. The PNG link is omitted for diagram types whose Kroki server doesn't generate PNG output (BPMN, Bytefield, D2, DBML, Excalidraw, Nomnoml, Pikchr, Svgbob, Symbolator, WaveDrom).

Including diagram source from a file

Instead of writing the diagram inline, the codeblock body can be just:

The path is relative to the vault root. The file's contents are used as the diagram source.

Settings

  • Server URL — the Kroki server to use (default https://kroki.io/). Self-hosting is encouraged.
  • White background — render diagrams on a white background; useful because Kroki returns transparent SVGs that can be unreadable on dark themes.
  • Diagram types — enable/disable each type and optionally change the code-block language it responds to. Changes take effect after Obsidian reloads. Types that accept a header — PlantUML, C4-PlantUML, Structurizr, Mermaid — show a full-width header textarea inside their own settings card; text typed there is prepended to every diagram of that type and is handy for shared themes, !includes, or Mermaid %%{init: …}%% directives. Each language's syntax is different, so each supported type has its own header. All other types (graphviz, d2, vega, tikz, …) have no header field — any non-empty prelude would break their parsers.

Types disabled by default

A few diagram types are shipped disabled because they need extra setup before they'll work:

  • mermaid and plantuml — disabled to avoid clashing with Obsidian's built-in mermaid code blocks and with the popular PlantUML plugin. To use Kroki's renderers, enable them in settings and rename the code-block language (e.g. kroki-mermaid, kroki-plantuml).
  • diagramsnet (draw.io) — Kroki renders diagrams.net via a separate companion service (the yuzutech/kroki-diagramsnet container, by default on port 8005). The public https://kroki.io instance does not run it; pointing the plugin there will get you Error 503: Connection refused. To use this type, host your own Kroki + diagramsnet companion (see Kroki install docs) and set Server URL accordingly.

Some other types (e.g. Excalidraw, BPMN) also rely on companion services; the public Kroki instance includes them, but a minimal self-host won't unless you start the companion containers too.

Examples

See kroki-test.md for examples of each of the currently supported diagram types.

Installation

Inside Obsidian

Settings > Third-party plugins > Community Plugins > Browse and search for Kroki.

Manually installing the plugin

  • Clone this repo
  • npm i to install dependencies (or nix develop for a pinned toolchain, then npm i)
  • npm run build
  • Copy over main.js, styles.css, manifest.json to your vault VaultFolder/.obsidian/plugins/obsidian-kroki/.

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
Diagrams.Net
4 years ago by Jens M Gleditsch
This repository contains a plugin for Obsidian for inserting and editing diagrams.net (previously draw.io) diagrams.
TikZJax
4 years ago by artisticat1
Render LaTeX and TikZ diagrams in your notes
D2
3 years ago by Terrastruct
The official D2 plugin for Obsidian. D2 is a modern diagram scripting language thats turns text to diagrams.
Adamantine Pick
3 years ago by Urist McMiner
Embeddable Pikchr(https://pikchr.org) diagrams renderer plugin for Obsidian(https://obsidian.md)
Mermaid Themes
3 years ago by jvsteiner
mermaid themes for obsidian
Typst Renderer
3 years ago by fenjalien
Renders typst code blocks in Obsidian into images using Typst through the power of WASM!
No more flickering inline math
3 years ago by Ryota Ushio
No longer disturbed by flickering inline math in Obsidian.
SwiftLaTeX Render
2 years ago by gboyd068
Universal renderer
2 years ago by Kloud
Obsidian plugin to render latex, dot, blockdiag, ditaa and other graphs
Excalidraw
5 years ago by Zsolt Viczian
A plugin to edit and view Excalidraw drawings in Obsidian
WaveDrom
5 years ago by Alex Stewart
Diagrams
5 years ago by Sam Greenhalgh
Draw.io plugin for obsidian.md
Nomnoml Diagram
5 years ago by Daeik Kim
Obsidian Plugin for nomnoml diagram
Pintora
2 years ago by Amias Lee
Create Pintora diagrams directly in the Obsidian.
Mermaid Popup
2 years ago by ChenPengyuan
MoreDraw
a year ago by webceoboy2011
mordraw.com for obsidian plugin
Sankey
a year ago by Finn Romaneessen
An Obsidian plugin to create sankey diagrams
Flowcharts
a year ago by land0r
Flowchart Plugin for Obsidian – Create and customize flowcharts seamlessly within your Obsidian vault. Powered by Flowchart.js and designed for productivity
GoBoard
4 months ago by Dmitry I. Sokolov
Obsidian plugin for rendering Go game diagrams from markdown code blocks
Mermaid Icons
4 months ago by toshs
Obsidian plugin enabling the use of icons in Mermaid diagrams.
Typst Mate
4 months ago by azyarashi
Render math expressions with Typst instead of MathJax in Obsidian.