Merge pull request #1143 from Guillergood/feat/penpot-import-export

M6: import and export Penpot 2.x files offline
This commit is contained in:
BFlat
2026-10-29 14:20:14 +07:00
committed by GitHub
23 changed files with 10435 additions and 28 deletions
+10 -2
View File
@@ -64,7 +64,7 @@ page 1 "Screens": 380 nodes, 4 top-level
…
```
### `export <file> -o <out> [--format png|jpg|svg|webp|pdf|xml|fig] [--scale N] [--page NAME] [--node ID|NAME] [--bleed LENGTH] [--crop-marks] [--bleed-marks] [--cmyk] [--vd-compat bestEffort|exact|ignore]`
### `export <file> -o <out> [--format png|jpg|svg|webp|pdf|xml|fig|penpot] [--scale N] [--page NAME] [--node ID|NAME] [--bleed LENGTH] [--crop-marks] [--bleed-marks] [--cmyk] [--vd-compat bestEffort|exact|ignore]`
- `<out>` is a directory: one file per top-level frame of the page (default the first page), named
after the frame (`Home.png`, `Settings.png`…); with no frames, one file per top-level layer.
@@ -86,6 +86,13 @@ page 1 "Screens": 380 nodes, 4 top-level
approximated), `exact` (left out) or `ignore` (no notes: overlapping layer opacity is dropped,
even-odd fills keep `fillType="evenOdd"`, diamond gradients are left out). See
`docs/file-format-parity.md`.
- `--format penpot` (or an `<out>` ending in `.penpot`) writes the whole file as a Penpot 2.x
archive (`manifest.json` plus one JSON per file, page and shape) that Penpot imports into a team:
pages, boards, groups, rectangles, ellipses, paths, booleans and text, fills, strokes, shadows and
blurs, flex and grid layout, components and variants, design tokens and prototype interactions.
Layers opened from a `.penpot` keep their Penpot ids, and unchanged text, layouts, interactions
and tokens are written back from the original. What Penpot cannot represent is printed as
`note:` lines.
- The format comes from `--format`, else `<out>`'s extension, else png. `--scale` (default 1, max 64)
applies to raster formats.
- SVG/PDF/XML exports with visible descendants more than 256 levels below an exported root fail with
@@ -117,7 +124,8 @@ By extension. Inputs: `.figcraft`, `.json` (FigCraft or REST API file JSON), `.f
shapes, text, gradients, masks and effects; `info` lists what it left out as `note:` lines), `.png/.jpg/.webp/.gif/.tif/.bmp`
(an image layer). Outputs: `.figcraft`, `.json` (FigCraft JSON, pretty-printed), `.svg`,
`.png/.jpg/.webp` (the current page rendered at 1x with its background), `.pdf` (the current page's
frames, one page each), `.fig` (the whole file, experimental, as `export --format fig`).
frames, one page each), `.fig` (the whole file, experimental, as `export --format fig`), `.penpot`
(the whole file as a Penpot 2.x archive, as `export --format penpot`).
### `render <file> -o <out.png> [--scale N] [--page NAME]`