Roxiewang46 downloadsRender AI-generated UI wireframes inside your notes. Turn plain-text input into self-contained SVGs, no external tools required.
在 Obsidian 中把文本直接渲染成 UI 线框图 —— 一键可视化 AI 生成的界面原型。
Wireloom for Obsidian 是一个 Obsidian 社区插件,它将 Wireloom —— 一种专为 AI 智能体设计的文本线框图语言 —— 无缝集成到 Obsidian 的 Markdown 渲染管线中。
在你的 Obsidian 笔记中写一个 ```wireloom 代码块,插件就会自动将其渲染为自包含的 SVG 线框图。无需切换工具、无需粘贴截图、无需维护外部文件 —— 线框图与文档同源,真正做到「文档即设计」。
在 AI 时代,LLM 可以直接从自然语言描述生成 Wireloom 代码。这意味着:
下面是一个用 Wireloom 勾勒的本地任务看板(cc-task)示例:

五个以渐进色区分的泳道区域(section)承载任务卡片(slot),卡片内是右对齐的键值对(kv)标签/值行,并可挂上进度条(progress)、状态胶囊(status)和页脚操作按钮(footer)。页头用徽标(chip)与状态胶囊(status)标识连接状态,右侧再用一个固定宽度的面板(panel)装任务详情。在此基础上叠加分隔线(divider)、输入框(input)与带引线的标注(annotation)等元素,就能勾勒出一个完整的任务看板应用界面。
本项目遵循以下核心设计原则:
| 原则 | 描述 |
|---|---|
| AI 原生 | 插件架构允许 LLM 直接生成和修改线框图代码,无需手动 GUI 操作 |
| 文本优先 | 所有线框图信息以纯文本存储,原生支持 Git 版本控制和差异审查 |
| 零运行时依赖 | 渲染出的 SVG 完全自包含 —— 无外部字体、脚本或网络请求 |
| 原生 Obsidian 体验 | 与 Obsidian 的主题系统、设置面板和 Markdown 渲染管线深度集成 |
| 懒加载性能 | Wireloom 引擎按需加载,不影响 Obsidian 启动时间 |
| 错误友好 | 语法错误精确定位到行列,并给出智能修正提示 |
```wireloom 围栏代码块并渲染为 SVGannotation 节点,沿 SVG 边缘绘制引导线标注| 项目 | 最低版本 | 说明 |
|---|---|---|
| Obsidian | v0.15.0+ | 需要 registerMarkdownCodeBlockProcessor API |
| Node.js | v18.0+ | 仅构建时需要 |
| npm | v8.0+ | 仅构建时需要 |
| Wireloom | v0.4.1+ | 运行时依赖,通过 npm 安装 |
cd /path/to/your/vault/.obsidian/plugins/
git clone https://github.com/weakingwang/Wireloom-for-Obsidian.git wireloom
cd wireloom
或下载本项目的 ZIP 压缩包并解压到 wireloom 目录。
npm install
如果安装缓慢,可以使用镜像源:
npm install --registry=https://registry.npmmirror.com
生产构建(推荐):
npm run build
构建成功后,目录中会生成一个 main.js 文件(约 120KB+,包含 Wireloom 引擎)。
开发构建(带文件监听,源码变更时自动重新构建):
npm run dev
ls -la main.js manifest.json styles.css
确认这三个文件都存在,且 main.js 大于 50KB(这表示 Wireloom 引擎已正确打包)。
main.js、manifest.json 和 styles.css.obsidian/plugins/wireloom/
├── main.js
├── manifest.json
└── styles.css
如果你使用 BRAT 插件来管理测试版插件:
本项目通过 Obsidian 社区插件审核后,你可以在 设置 → 第三方插件 → 浏览 中搜索 "Wireloom" 一键安装。
在 Obsidian 笔记中插入一个 ```wireloom 代码块:
## 登录页线框图
```wireloom
window "User Login":
header:
text "Welcome back" bold id="title"
panel:
input placeholder="Enter email" id="email"
input placeholder="Enter password" type=password id="password"
row:
checkbox "Remember me" id="remember"
text "Forgot password?" id="forgot"
button "Sign in" primary id="submit"
footer:
text "No account? Sign up"
annotation "Page title" target="title" position=top
annotation "Primary action button" target="submit" position=right
```
切换到 预览模式 或 阅读模式 即可看到渲染出的 SVG 线框图。
| 分类 | 组件 |
|---|---|
| 容器 | window、header、footer、panel、section、tabs、row、col、list、grid、navbar、tabbar |
| 输入 | input、combo、slider、checkbox、radio、toggle |
| 按钮 | button |
| 内容 | text、kv、image、icon、chip、avatar、spinner |
| 其他 | tree、breadcrumb、divider |
| 标注 | annotation |
请参阅 Wireloom 官方文档:design/grammar.md
在 Obsidian 设置 → 第三方插件 → Wireloom 下,可以配置以下选项:
| 设置项 | 可选值 | 默认值 | 说明 |
|---|---|---|---|
| 渲染主题 | 自动 / 浅色 / 深色 | 自动 | "自动" 会实时跟随 Obsidian 当前主题 |
| 最大宽度 | 任意 CSS 宽度值 | 100% | 控制 SVG 在预览中的最大显示宽度 |
body.theme-dark 类变化ENOENT: main.js原因:缺少构建产物。ZIP 源码包不包含 main.js,需要先运行 npm run build。
解决方案:
cd .obsidian/plugins/wireloom
npm install
npm run build
Cannot find package 'builtin-modules'原因:esbuild.config.mjs 依赖 builtin-modules 包,但它未在 package.json 中声明。
解决方案:
npm install builtin-modules
npm run build
原因:你当前处于 编辑模式,或处于 实时预览(Live Preview) 的编辑状态。
解决方案:切换到 阅读模式 或 预览模式。Obsidian 的 registerMarkdownCodeBlockProcessor 只在非编辑状态生效。
原因:wireloom npm 包未正确安装,或在构建时未打包进 main.js。
解决方案:
node_modules/wireloom 存在npm install && npm run buildmain.js 文件大小是否大于 50KB原因:Wireloom 使用内联 SVG 渲染,默认字体依赖系统字体栈。
解决方案:在 Obsidian 自定义 CSS 中为 .wireloom-block svg 添加 font-family 覆盖,或确保系统安装了支持中文的字体。
原因:插件依赖 Wireloom 的 JS 库(package.json 中的 wireloom 依赖),而 JS 库版本可能落后于 Wireloom 协议本身,导致某些较新的组件或语法在生成 UI 文本时无法正常显示。
解决方案:当 Wireloom JS 库有更新时,及时更新 package.json 中的 wireloom 依赖版本,然后重新运行 npm install && npm run build。
┌─────────────────────────────────────────────────────────────┐
│ Obsidian editor │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────┐ │
│ │ Markdown │───→│ Wireloom │───→│ SVG wireframe │ │
│ │ source │ │ code block │ │ (self-contained,│ │
│ │ │ │ processor │ │ no scripts) │ │
│ └─────────────┘ └──────┬──────┘ └─────────────────┘ │
│ │ │
│ ┌──────┴──────┐ │
│ │ Lazy-loaded │ │
│ │ engine │ │
│ │ wireloom │ │
│ │ (ESM/CJS) │ │
│ └─────────────┘ │
└─────────────────────────────────────────────────────────────┘
| 决策 | 理由 |
|---|---|
| 懒加载 | import("wireloom") 延迟到遇到第一个代码块时才执行,避免拖慢 Obsidian 启动 |
| 动态 import 桥接 | Wireloom 是 ESM 包,而 Obsidian 插件是 CJS;await import() 提供兼容性 |
| innerHTML 注入 | Wireloom 官方保证返回的 SVG 无 <script> 且无外部引用,因此可以直接安全注入 |
| 防抖刷新 | 主题变化时 300ms 防抖,避免频繁重新渲染 |
| 错误降级 | 引擎加载失败或语法错误时显示友好提示,不会阻塞整个文档渲染 |
本项目基于 MIT License 开源,完整条款见仓库根目录的 LICENSE 文件。
注意:本项目由社区驱动,并非 Wireloom 官方产品。Wireloom 商标及核心引擎版权归 Stardock 所有。
Render text directly into UI wireframes inside Obsidian — visualize AI-generated interface prototypes in one click.
Wireloom for Obsidian is an Obsidian community plugin that seamlessly integrates Wireloom — a text-based wireframe language designed for AI agents — into Obsidian's Markdown rendering pipeline.
Write a ```wireloom code block in your Obsidian note, and the plugin automatically renders it as a self-contained SVG wireframe. No tool switching, no screenshot pasting, no external file maintenance — the wireframe lives in the same source as the document, achieving true "document as design".
In the age of AI, LLMs can generate Wireloom code directly from natural-language descriptions. This means:
Here is a local task board (cc-task) sketched with Wireloom:

Five color-graded swimlane sections hold task-card slots, each carrying right-aligned kv label/value rows plus optional progress bars, status pills, and a footer of action buttons. A header marks connection state with a chip and a status pill, while a fixed-width panel on the right holds the task details. Layer dividers, an input, and leader-lined annotations on top, and you can sketch a complete task-board application screen.
This project follows these core design principles:
| Principle | Description |
|---|---|
| AI-native | The plugin architecture lets LLMs generate and modify wireframe code directly, without manual GUI interaction |
| Text-first | All wireframe information is stored as plain text, with native support for Git version control and diff review |
| Zero runtime dependencies | Rendered SVGs are self-contained — no external fonts, scripts, or network requests |
| Native Obsidian experience | Deeply integrated with Obsidian's theme system, settings panel, and Markdown rendering pipeline |
| Lazy-loading performance | The Wireloom engine loads on demand, without affecting Obsidian's startup time |
| Error-friendly | Syntax errors pinpoint exact line and column, with smart correction hints |
```wireloom fenced code blocks and renders them as SVGannotation node, drawing leader-line callout labels along the SVG edges| Item | Minimum version | Notes |
|---|---|---|
| Obsidian | v0.15.0+ | Requires the registerMarkdownCodeBlockProcessor API |
| Node.js | v18.0+ | Build-time only |
| npm | v8.0+ | Build-time only |
| Wireloom | v0.4.1+ | Runtime dependency, installed via npm |
cd /path/to/your/vault/.obsidian/plugins/
git clone https://github.com/weakingwang/Wireloom-for-Obsidian.git wireloom
cd wireloom
Or download this project's ZIP archive and extract it into the wireloom directory.
npm install
If installation is slow, you can use a mirror registry:
npm install --registry=https://registry.npmmirror.com
Production build (recommended):
npm run build
After a successful build, a main.js file (about 120KB+, including the Wireloom engine) is generated in the directory.
Development build (with file watching, auto-rebuilds on source changes):
npm run dev
ls -la main.js manifest.json styles.css
Confirm that all three files exist and that main.js is larger than 50KB (which indicates the Wireloom engine was bundled correctly).
main.js, manifest.json, and styles.css are generated.obsidian/plugins/wireloom/
├── main.js
├── manifest.json
└── styles.css
If you use the BRAT plugin to manage beta plugins:
Once this project passes Obsidian community plugin review, you can search for "Wireloom" in Settings → Community plugins → Browse and install it in one click.
Insert a ```wireloom code block into an Obsidian note:
## Login page wireframe
```wireloom
window "User Login":
header:
text "Welcome back" bold id="title"
panel:
input placeholder="Enter email" id="email"
input placeholder="Enter password" type=password id="password"
row:
checkbox "Remember me" id="remember"
text "Forgot password?" id="forgot"
button "Sign in" primary id="submit"
footer:
text "No account? Sign up"
annotation "Page title" target="title" position=top
annotation "Primary action button" target="submit" position=right
```
Switch to Preview mode or Reading mode to see the rendered SVG wireframe.
| Category | Components |
|---|---|
| Containers | window, header, footer, panel, section, tabs, row, col, list, grid, navbar, tabbar |
| Inputs | input, combo, slider, checkbox, radio, toggle |
| Buttons | button |
| Content | text, kv, image, icon, chip, avatar, spinner |
| Other | tree, breadcrumb, divider |
| Annotations | annotation |
See the official Wireloom documentation: design/grammar.md
Under Obsidian Settings → Community plugins → Wireloom, you can configure the following options:
| Setting | Options | Default | Description |
|---|---|---|---|
| Render theme | Auto / Light / Dark | Auto | "Auto" follows Obsidian's current theme in real time |
| Max width | Any CSS width value | 100% | Controls the maximum display width of the SVG in preview |
body.theme-dark class changeENOENT: main.jsCause: missing build artifacts. The ZIP source package does not include main.js; you must run npm run build first.
Solution:
cd .obsidian/plugins/wireloom
npm install
npm run build
Cannot find package 'builtin-modules'Cause: esbuild.config.mjs depends on the builtin-modules package, but it is not declared in package.json.
Solution:
npm install builtin-modules
npm run build
Cause: you are currently in Edit Mode, or in the editing state of Live Preview.
Solution: switch to Reading Mode or Preview Mode. Obsidian's registerMarkdownCodeBlockProcessor only takes effect outside editing state.
Cause: the wireloom npm package is not installed correctly, or was not bundled into main.js at build time.
Solution:
node_modules/wireloom existsnpm install && npm run buildmain.js file size is greater than 50KBCause: Wireloom renders using inline SVG, and the default font relies on the system font stack.
Solution: add a font-family override for .wireloom-block svg in Obsidian's custom CSS, or ensure a font that supports Chinese is installed on the system.
Cause: the plugin relies on the Wireloom JS library (the wireloom dependency in package.json), and the JS library version may lag behind the Wireloom protocol itself, so some newer components or syntax may not display correctly when generating UI text.
Solution: when the Wireloom JS library has an update, update the wireloom dependency version in package.json, then re-run npm install && npm run build.
┌─────────────────────────────────────────────────────────────┐
│ Obsidian editor │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────┐ │
│ │ Markdown │───→│ Wireloom │───→│ SVG wireframe │ │
│ │ source │ │ code block │ │ (self-contained,│ │
│ │ │ │ processor │ │ no scripts) │ │
│ └─────────────┘ └──────┬──────┘ └─────────────────┘ │
│ │ │
│ ┌──────┴──────┐ │
│ │ Lazy-loaded │ │
│ │ engine │ │
│ │ wireloom │ │
│ │ (ESM/CJS) │ │
│ └─────────────┘ │
└─────────────────────────────────────────────────────────────┘
| Decision | Rationale |
|---|---|
| Lazy loading | import("wireloom") is deferred until the first code block is encountered, avoiding slowdown of Obsidian startup |
| Dynamic import bridging | Wireloom is an ESM package while Obsidian plugins are CJS; await import() provides compatibility |
| innerHTML injection | Wireloom officially guarantees the returned SVG has no <script> and no external references, so it can be safely injected directly |
| Debounced refresh | A 300ms debounce on theme changes avoids frequent re-rendering |
| Error degradation | Engine load failure or syntax errors show a friendly message without blocking the whole document from rendering |
This project is open source under the MIT License. See the LICENSE file in the repository root for the full terms.
Note: This project is community-driven and not an official Wireloom product. The Wireloom trademark and core engine are copyright of Stardock.