charonwwang98 downloadsClick an Archify diagram thumbnail to preview its self-contained interactive HTML in a sandboxed frame inside the app.
English | 简体中文
Click an Archify diagram thumbnail in your notes and explore its self-contained interactive HTML — theme toggle, pan/zoom, search, and Story mode all work — without leaving the app.

Archify emits its diagrams as a set of artifacts, referenced from Markdown like this:
[](diagrams/system-architecture.html)
This "image wrapped in a link" syntax is valid CommonMark, and most Markdown previews render the thumbnail and open the linked HTML interactively. In Obsidian, however, the chain breaks in four places: relative paths resolve differently, .html files are not recognized by default, there is no built-in HTML renderer, and a plain iframe cannot load local files.
This plugin bridges exactly those gaps: it fixes up the thumbnail, detects Archify-style links, and opens the linked HTML in a sandboxed in-app preview.
[](x.html) links, including Archify's naming heuristic (*.visual-check.<W>x<H>.<theme>.png with a sibling *.archify.json), and shows an "Interactive" badge on hover..archify.json.sandbox="allow-scripts" (opaque origin), so a diagram can never touch your vault files.file://, so behavior is identical everywhere (isDesktopOnly: false).See demo/demo.md for a working example of the Archify reference format, with a sample interactive diagram (demo.html) and source definition (demo.archify.json).
No changes to your notes are required. Any "thumbnail linking an .html file" (the standard Archify output format) is enhanced automatically:
[](architecture/diagrams/system-architecture.html)
Click the thumbnail to open the interactive version inside the app. There is also a command: Open active HTML file in the interactive preview.
Requires Obsidian 1.4.0 or newer.
Download main.js, manifest.json, and styles.css from the latest release into <vault>/.obsidian/plugins/archify-html-preview/, then enable the plugin in Settings → Community plugins.
npm install
npm run build
Copy main.js, manifest.json, styles.css into <vault>/.obsidian/plugins/archify-html-preview/. For development, npm run dev watches and rebuilds on change — pair it with the third-party Hot-Reload plugin for auto-reload.
| Setting | Default | Description |
|---|---|---|
| Click behavior | New tab | New tab / Modal / Inline expand |
There are three surfaces, each with only the actions that make sense for it:
| Surface | Toolbar (right-aligned) | Notes |
|---|---|---|
| New tab | Refresh · Source definition · Open in browser · Open in new window | full-size view |
| Modal | Refresh · Source definition · Open in browser · Open in new window | draggable by its title, resizable from the corner, closed with the built-in button (no pop-out button — it is already a modal) |
| Inline expand | Source definition · Open in browser · Open in new window · Collapse | height adjustable by dragging the bottom grip (remembered) |
Buttons are right-aligned and use Obsidian's native control styling. Ctrl/Cmd + click always opens a new tab, whatever the mode.
| Setting | Default | Meaning |
|---|---|---|
Take over .html files |
Off | When on, double-clicking an .html file also opens the interactive preview (reload the plugin after changing). Mutually exclusive with HTML Viewer / Polyglot Renderer-style plugins |
| Allow same-origin | Off | Lets previewed pages use localStorage, at the cost of the opaque-origin isolation |
| Inline height | 560px | iframe height for inline mode (drag the bottom grip to adjust; it is remembered) |
Everything an interactive artifact normally needs works in the preview:
canvas.toBlob + <a download>) — sandbox grants allow-downloadsnavigator.clipboard does not exist in an
opaque origin, so the preview injects a runtime shim that forwards text to
the plugin frame via postMessage, where the clipboard really workslocalStorage throws in an opaque origin; the shim
backs it with an in-memory store so artifacts keep workingOpen in browser hands the file to a real browser. It tries, in order:
spawning a known browser executable directly (Edge / Chrome / Firefox, then the
OS opener), Obsidian's openWithDefaultApp, Electron's shell.openPath /
shell.openExternal (each raced against a 1.2 s timeout so a stalled bridge
cannot swallow the action), and finally the app:// resource URL. Success is
silent; only a total failure reports — and then it copies the absolute path so
you can paste it into the address bar.
Open in new window pops the preview into a detached OS window owned by the app, without touching the OS shell or any file association.
All surfaces expose stable CSS hooks for user snippets
(.obsidian/snippets/*.css): .archify-linked-html, .archify-badge,
.archify-inline-wrap, .archify-inline-grip, .archify-preview-view,
.archify-toolbar, .archify-preview-modal, .archify-frame-box,
.archify-float, .archify-float-header, .archify-float-title. All colors go
through Obsidian theme variables, so light/dark themes follow automatically.
.html files" setting.localStorage/sessionStorage are unavailable inside the preview (inherent browser behavior). Archify artifacts are self-contained so this rarely matters; enable "Allow same-origin" if a diagram needs storage..archify.json suffix ends in json, so it cannot be registered as its own file type (extension registration only looks at the last segment) — only the "Source definition" shortcut is provided.The settings UI, commands, badges and notices follow the app's interface
language automatically. Currently included: English, 简体中文, 繁體中文, 日本語.
The full documentation is also available in 简体中文.
Contributions for other languages are welcome — add a dictionary in
src/i18n.ts and register it in the STRINGS map.
├── src/
│ ├── main.ts # plugin entry: registration, markdown enhancement, click routing
│ ├── resolve.ts # path resolution + Archify metadata parsing
│ ├── settings.ts # settings interface, defaults, settings tab
│ ├── view.ts # sandboxed iframe, ItemView, Modal, inline child
│ └── i18n.ts # localization (en / zh / zh-TW / ja)
├── demo/ # sample note + interactive HTML + source definition
├── esbuild.config.mjs
├── manifest.json
├── styles.css
└── versions.json
version in manifest.json and mirror it in versions.json ({"<version>": "<minAppVersion>"}).v prefix) — the bundled GitHub Actions workflow builds and attaches main.js, manifest.json, styles.css to the release.community-plugins.json, following the Plugin guidelines.