Docs & Code Guide

Embed a diagram in Obsidian: markdown images, iframes, and what changes on Publish

Obsidian vaults collect engineering knowledge fast, and architecture notes are where that knowledge goes stale first. Obsidian renders external images and even raw iframes inside notes, so a live diagram works well in the app. The two things worth understanding are the syntax split between wikilinks and markdown links, and what changes when the note leaves the vault through Obsidian Publish.

6 min readFor engineers keeping system notes in an Obsidian vault

See it as a diagram

Everything below, as a diagram you can edit. Describe yours and see it in seconds.

173/20003 credits left
Try:

No account needed · Editable canvas, not a picture

Iframes work inside notes

Obsidian renders raw HTML in markdown, and its own help documents embedding web pages with an iframe tag. Point one at an interactive diagram page and the note gets a pannable, zoomable view of the current diagram, useful when the note is where you actually think about the system. The framed site must allow embedding; sites that send X-Frame-Options stay blank, while pages built for embedding render.

For most notes the plain image is enough and lighter. Both forms follow the source: the image is served with a five minute cache lifetime, so an edited diagram shows up in your notes within minutes.

A local-first vault meets a remote image

An Obsidian vault is files on disk, and external embeds are the one part of a note that does not travel with it. Offline, the image placeholder is what you get. Notes you rely on in no-network situations, an incident runbook read from a train, should carry a committed export next to the live embed, updated when it matters.

Sync between devices is unaffected, since the note stores only a URL, and the same line renders identically on desktop and mobile when the network is there.

Obsidian Publish is stricter than the app

What renders in your vault does not automatically render on an Obsidian Publish site. Community reports over the years include iframes blocked by content security policy on published sites and external images failing over plain http, which Publish does not load; https URLs are the baseline.

The practical guidance: the https image form is the safer of the two on Publish, and whatever you choose, check the published page rather than trusting the in-app preview. If the diagram must be interactive for public readers, link out to the diagram page instead of framing it.

Keeping the diagram current behind the note

The note now shows whatever the diagram is; keeping the diagram truthful is the remaining work. Datadef ships an MCP server (registry name io.datadef/mcp), so an agent with repository access, Claude Code or Cursor, can update the diagram from what it reads in the code when you ask it to, or from CI after merges. Datadef does not watch repositories; the update happens when an agent call or CI command requests it. The API key behind it comes from the paid plans.

The embed URLs require the project to be shared public and 404 if it goes private, which matters for personal vaults documenting employer systems: keep confidential detail out of the shared diagram. The wider problem of knowledge living in one head, which vaults both help and hide, is the subject of tribal knowledge in engineering teams.

FAQ

How do I embed an external image in Obsidian?

Use standard markdown image syntax: ![alt](https://your-url). The wikilink form ![[...]] only resolves files inside the vault and silently fails for URLs. External images render in both reading view and live preview when the network is available.

Can I embed an iframe in an Obsidian note?

Yes. Obsidian renders raw HTML in notes, and an iframe pointing at an embeddable page works in reading view. The framed site must allow embedding; sites sending X-Frame-Options render as an empty box.

Why does my embedded image not show in Obsidian?

The two usual causes: wikilink syntax used for an external URL, which fails because ![[...]] only resolves vault files, or no network, since a local-first vault fetches external images at view time. Use ![alt](https://...) and check connectivity.

Do external images and iframes work on Obsidian Publish?

External https images generally render on Publish; plain http images do not load. Iframes are less reliable, with community reports of content security policy blocking them on published sites. Test the published page, and prefer the image form with a link to the interactive version for public readers.

Does the diagram in my note update by itself?

The note follows the source diagram: the image is served with a five minute cache lifetime, so an edit shows up within minutes without touching the note. Editing the diagram when the system changes is still a human or agent action; nothing watches your code for you.