1.4 KiB
1.4 KiB
description, argument-hint
| description | argument-hint |
|---|---|
| Export a diagram-design HTML file to SVG and PNG | <html-file> [--svg-only|--png-only] [--scale=N] [--output=<path>] |
Export diagram HTML at $1 to .svg or .png. Locate available diagram-design skill using its SKILL.md path advertised by Pi. Read that SKILL.md, then read references/export.md relative to its directory. Treat that reference as source of truth. Do not assume the package lives under the current working directory.
Full argument string: $ARGUMENTS
Defaults
- Produce both
.svgand.pngnext to source (for example,diagram.html→diagram.svg+diagram.png). - Render PNG at
device_scale_factor=2.
Flags
--svg-only— emit SVG only. Skip Playwright.--png-only— emit PNG only.--scale=1,--scale=2, or--scale=3— override PNG device scale factor.--output=<path>— override output base path; append format extension.
Required behavior
- No source path → ask user which
.htmlfile to export. Do not guess. - Source is
assets/index.html→ refuse; ask for specific diagram file. - Source lacks
<svg>→ refuse; write nothing. - PNG requested without Playwright → show install instruction from reference verbatim; stop. Do not auto-install.
--scaleoutside {1, 2, 3} → reject.- Both
--svg-onlyand--png-onlysupplied → reject them as mutually exclusive.
After export, report output paths plus sizes.