You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/src/docs/cli.mdx
+39-1Lines changed: 39 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,42 @@ quoteforge generate card.json --fit-content # crop to content, no surrounding
18
18
19
19
When used with `slides`, the flag may produce slides with different heights (if content height varies per slide). This is intentional but worth noting in deck workflows. On a deck, `--fit-content` also drops the slide-counter overlay, which sits outside the content box.
20
20
21
+
### `--safe-aspect`
22
+
23
+
The `--safe-aspect <ratio>` flag constrains the layout so all content survives a center-crop toward the given ratio. This is useful when rendering cards for embedded display in mismatched `object-fit: cover` containers (e.g., a square card to be embedded in a 16:9 player or carousel).
24
+
25
+
**Accepted ratio formats:**
26
+
-`W:H` (e.g., `16:9`, `4:3`)
27
+
-`WxH` (e.g., `16x9`)
28
+
- Decimal (e.g., `1.78` for 16:9)
29
+
30
+
**Recommendation:** pair `--safe-aspect` with `align: center` (the default). Do not combine with `--fit-content` (they have opposite intents: safe-aspect maintains full size, fit-content crops to content).
31
+
32
+
**Example:** A square card (1080×1080) made safe for a 16:9 embed:
33
+
34
+
1. Create a card with square dimensions (`size: "instagram-sq"`) and `align: "center"`:
{ "type": "text", "content": "All content fits in the central 1920×1080 band, surviving center-crop to 16:9." }
45
+
]
46
+
}
47
+
```
48
+
49
+
2. Render it with `--safe-aspect 16:9`:
50
+
51
+
```bash
52
+
quoteforge generate card.json --safe-aspect 16:9
53
+
```
54
+
55
+
The output remains 1080×1080 but all content is constrained to the central 16:9 region (1080×607px). When embedded in a 16:9 container with `object-fit: cover`, the entire content box will remain visible.
0 commit comments