renderizr
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRenderizr — a Structurizr workspace as one shareable file
Renderizr — 将Structurizr工作区转换为单个可共享文件
This skill renders a Structurizr workspace — its views, documentation and decision log — into a browsable static site, or into a single self-contained HTML file that can be uploaded as a Claude artifact and opened by anyone, with no server and no network.
Diagrams are drawn by Structurizr's own renderer rather than re-implemented, so they pan, zoom and play back dynamic views exactly as they do in Structurizr.
本技能可将Structurizr工作区(包括其视图、文档和决策日志)渲染为可浏览的静态站点,或单个自包含HTML文件,该文件可作为Claude工件上传,任何人无需服务器和网络即可打开。
图表由Structurizr官方渲染器绘制,而非重新实现,因此它们的平移、缩放和动态视图回放效果与在Structurizr中完全一致。
When to use this skill
何时使用本技能
- The user wants to see an architecture model rather than read its source.
- The user wants to share a model with people who have no Structurizr account, no server and no copy of the DSL.
- The user asks for an artifact, a preview, or "publish the diagrams".
- The user is working in a repository that has an folder — often one created by Scaffoldizr — and wants output from it.
./architecture
Do not use this skill to author or edit a model. Renderizr renders; it does not parse DSL and never writes to the workspace. Editing the model is Scaffoldizr's job.
- 用户希望查看架构模型,而非阅读其源代码。
- 用户希望与没有Structurizr账户、服务器或DSL副本的人分享模型。
- 用户要求生成工件、预览或“发布图表”。
- 用户正在包含文件夹的仓库中工作(通常由Scaffoldizr创建),并希望从中获取输出。
./architecture
请勿使用本技能创作或编辑模型。Renderizr仅负责渲染;它不解析DSL,也绝不会写入工作区。编辑模型是Scaffoldizr的职责。
The one command
单条命令
bash
npx github:FormulaMonks/renderizr <workspace.json|url> --single-file --out <dir>That writes two files into :
<dir>| File | What it is | Use it for |
|---|---|---|
| The page without its own | Uploading as a Claude artifact — the host supplies the document |
| The same page as a complete standalone document | Opening from disk, emailing, dropping in a bucket |
Both inline every stylesheet, script, font, icon and the workspace itself. Neither makes a single network request.
For a Claude artifact, use . Handing over instead produces a document nested inside a document.
artifact.htmlindex.htmlDrop to get a directory — plus — for hosting on a static server or GitHub Pages.
--single-fileindex.htmlassets/bash
npx github:FormulaMonks/renderizr <workspace.json|url> --single-file --out <dir>该命令会在目录中生成两个文件:
<dir>| 文件 | 说明 | 使用场景 |
|---|---|---|
| 不含自身 | 上传为Claude工件 — 由宿主提供文档结构 |
| 完整的独立文档页面 | 本地打开、邮件发送、存入存储桶 |
两个文件均内联了所有样式表、脚本、字体、图标以及工作区本身。均不会发起任何网络请求。
若要生成Claude工件,请使用。 若提供,会导致文档嵌套在宿主文档内部。
artifact.htmlindex.html移除参数可生成包含和目录的文件夹,用于部署到静态服务器或GitHub Pages。
--single-fileindex.htmlassets/Getting a workspace to render
获取待渲染的工作区
Renderizr takes JSON, either a local path or a URL. It does not parse DSL.
-
Aalready on disk — usually
workspace.json. Use it directly../architecture/workspace.json -
Only a— export it first with structurizr-cli, which exports a DSL workspace to JSON. In a Scaffoldizr repository,
workspace.dsl(or./architecture/scripts/export.sh) does this for you.export.ps1 -
A URL — passed straight through, e.g. the Big Bank plc example:bash
npx github:FormulaMonks/renderizr \ https://raw.githubusercontent.com/structurizr/ui/main/examples/big-bank-plc.json \ --single-file --out /tmp/big-bank
workspace.jsonRenderizr接收JSON格式的输入,可以是本地路径或URL。它不解析DSL。
-
本地已存在— 通常位于
workspace.json,可直接使用。./architecture/workspace.json -
仅存在— 需先通过structurizr-cli将其导出为JSON。在Scaffoldizr仓库中,
workspace.dsl(或./architecture/scripts/export.sh)可自动完成此操作。export.ps1 -
URL — 直接传入即可,例如Big Bank plc示例:bash
npx github:FormulaMonks/renderizr \ https://raw.githubusercontent.com/structurizr/ui/main/examples/big-bank-plc.json \ --single-file --out /tmp/big-bank
在Scaffoldizr仓库中,是编译输出文件。可对其进行渲染,但切勿编辑 — 下次导出时它会被覆盖。
workspace.jsonRecommended flow
推荐流程
-
Find the workspace. Look for. If only
./architecture/workspace.jsonexists, export it first and say so; do not silently render a stale JSON.workspace.dsl -
Render it, into a temporary directory rather than the repository, unless the user asked for the output to be kept:bash
npx github:FormulaMonks/renderizr ./architecture/workspace.json --single-file --out /tmp/renderizr-out -
Check it is genuinely self-contained before handing it over — see verifying. One command, and it is the difference between an artifact that opens and one that renders blank for the recipient.
-
Hand over. Say which file it is and roughly how big; a real model lands around 1 MB.
artifact.html
-
查找工作区。寻找。若仅存在
./architecture/workspace.json,请先导出并告知用户;切勿静默渲染过时的JSON文件。workspace.dsl -
执行渲染,将输出保存到临时目录而非仓库中,除非用户要求保留输出:bash
npx github:FormulaMonks/renderizr ./architecture/workspace.json --single-file --out /tmp/renderizr-out -
移交前验证文件是否真正自包含 — 参考验证。只需一条命令,就能确保接收方打开的是正常显示的工件,而非空白页面。
-
移交。告知用户文件名及大致大小;真实模型的文件大小约为1 MB。
artifact.html
Flags
命令参数
Full reference in flags. The ones that matter most:
| Flag | Effect |
|---|---|
| One self-contained document, plus |
| Output directory (default |
| Base public path for the multi-file build, e.g. |
| Image top-left in the header, embedded as a data URI |
| A Google Web Font, fetched at build time and embedded as woff2 |
--font--logo完整参数说明请参考参数。最常用的参数如下:
| 参数 | 作用 |
|---|---|
| 生成单个自包含文档及 |
| 输出目录(默认值为 |
| 多文件构建的基础公共路径,例如项目Pages的 |
| 页眉左上角的图片,以data URI形式嵌入 |
| Google Web字体,构建时获取并以woff2格式嵌入 |
--font--logoThings that will bite you
注意事项
Each of these has been verified against the tool, not inferred:
- Node 20 is a hard floor. runs against whatever Node is first on
npx, which is often not the one the shell reports. Renderizr checks and exits with a clear message rather than failing deep inside the build.PATH - and
artifact.htmlare not interchangeable. See the table above.index.html - The output directory is emptied before writing. Never point at a directory holding anything you want to keep.
--out - in the output is not a leak. A rendered page contains ordinary hyperlinks to
https://,structurizr.comand the like. Self-containment is about asset references —c4model.com,<script src>,<link href>— of which there are none. Check the right thing; see verifying.<img src> - Working inside a clone of the Renderizr repository is different. — and specifically not
pnpm build <workspace> [flags], which makes the flag arrive as a second workspace.pnpm build -- <workspace> --flagis the opposite and does want thepnpm dev. This only applies inside the repository;--users are unaffected.npx
以下均为经过工具验证的实际问题,而非推断:
- Node 20是最低要求。会使用
npx中优先级最高的Node版本,这可能与Shell显示的版本不同。Renderizr会进行版本检查,若版本不满足则会输出清晰提示,而非在构建过程中深层报错。PATH - 和
artifact.html不可互换。请参考上方表格说明。index.html - 输出目录会被清空后再写入文件。切勿将指向包含重要文件的目录。
--out - 输出中的并非信息泄露。渲染后的页面包含指向
https://、structurizr.com等网站的普通超链接。自包含性针对的是资源引用(如c4model.com、<script src>、<link href>),此类引用在输出中不存在。请参考验证确认正确内容。<img src> - 在Renderizr仓库克隆内工作时有所不同。需使用— 特别注意不能使用
pnpm build <workspace> [flags],否则参数会被当作第二个工作区。pnpm build -- <workspace> --flag则相反,需要添加pnpm dev。此规则仅适用于仓库内部;--用户不受影响。npx
References
参考文档
- flags — every CLI flag, what it does, and what it costs
- artifacts — the Claude artifact path in detail, including size and what to hand over
- verifying — proving an artifact is self-contained before you hand it over
- 参数 — 所有CLI参数的作用及说明
- 工件 — Claude工件的详细说明,包括大小及移交建议
- 验证 — 移交前验证工件是否自包含的方法