Skip to content

Commit 9038df8

Browse files
committed
docs(quoteforge[cli]): document --safe-aspect
1 parent 9e73671 commit 9038df8

3 files changed

Lines changed: 78 additions & 25 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 0.6.0
4+
5+
### Added
6+
- `--safe-aspect <ratio>` on `generate`/`slides`/`batch`: constrains the layout so all content
7+
survives a center-crop toward the given ratio (e.g. `--safe-aspect 4:3`), for images embedded
8+
in mismatched `object-fit: cover` containers. Opt-in; no effect when absent.
9+
310
## 0.5.0
411

512
### Added
@@ -10,6 +17,9 @@
1017
- `--fit-content` (alias `--trim`) on `generate`/`slides`/`batch`, cropping the output to the
1118
content bounding box plus theme padding.
1219

20+
### Fixed
21+
- Studio: `size: "custom"` cards and deck slides now render at their given dimensions in preview and export (previously blank).
22+
1323
### Changed
1424
- **Rendering change:** content is now vertically centered by default instead of distributed
1525
over the full canvas height. Existing cards re-render with content grouped. Add

README.md

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,14 @@ quoteforge preview content/examples/manifesto-wiki.json
7979
```
8080
quoteforge generate <file> [options]
8181
82-
-t, --theme <name> Override theme
83-
-s, --size <name> Override size (see Size Reference below)
84-
-o, --output <path> Output file path
85-
--scale <n> Pixel ratio (default: 2)
86-
--fit-content Crop to content bounding box + theme padding
87-
--open Open output file after generation
88-
--no-timestamp Omit timestamp from filename
82+
-t, --theme <name> Override theme
83+
-s, --size <name> Override size (see Size Reference below)
84+
-o, --output <path> Output file path
85+
--scale <n> Pixel ratio (default: 2)
86+
--safe-aspect <ratio> Constrain content for center-crop (e.g. 16:9)
87+
--fit-content Crop to content bounding box + theme padding
88+
--open Open output file after generation
89+
--no-timestamp Omit timestamp from filename
8990
```
9091

9192
**Examples:**
@@ -94,6 +95,7 @@ quoteforge generate <file> [options]
9495
quoteforge generate content/my-card.json
9596
quoteforge generate content/my-card.json --size facebook-post --theme dark-orange
9697
quoteforge generate content/my-card.json --no-timestamp --open
98+
quoteforge generate content/my-card.json --safe-aspect 16:9
9799
quoteforge generate content/my-card.json --fit-content
98100
```
99101

@@ -102,17 +104,18 @@ quoteforge generate content/my-card.json --fit-content
102104
```
103105
quoteforge slides <file> [options]
104106
105-
-t, --theme <name> Override theme for all slides
106-
-s, --size <name> Override size for all slides
107-
-o, --output <dir> Output directory
108-
--slide <n> Render only slide N (1-indexed), no ZIP
109-
--no-zip Skip ZIP creation
110-
--no-counter Disable counter overlay for all slides
111-
--fit-content Crop each slide to content bounding box + theme padding
112-
--concurrency <n> Parallel render workers (default: 4)
113-
--zip-level <n> ZIP compression level 0-9 (default: 6)
114-
--scale <n> Pixel ratio (default: 2)
115-
--open Open output folder after generation
107+
-t, --theme <name> Override theme for all slides
108+
-s, --size <name> Override size for all slides
109+
-o, --output <dir> Output directory
110+
--slide <n> Render only slide N (1-indexed), no ZIP
111+
--no-zip Skip ZIP creation
112+
--no-counter Disable counter overlay for all slides
113+
--safe-aspect <ratio> Constrain content for center-crop (e.g. 16:9)
114+
--fit-content Crop each slide to content bounding box + theme padding
115+
--concurrency <n> Parallel render workers (default: 4)
116+
--zip-level <n> ZIP compression level 0-9 (default: 6)
117+
--scale <n> Pixel ratio (default: 2)
118+
--open Open output folder after generation
116119
```
117120

118121
**Examples:**
@@ -121,6 +124,7 @@ quoteforge slides <file> [options]
121124
quoteforge slides decks/intro-deck.json
122125
quoteforge slides decks/intro-deck.json --size facebook-square
123126
quoteforge slides decks/intro-deck.json --slide 3
127+
quoteforge slides decks/intro-deck.json --safe-aspect 16:9
124128
quoteforge slides decks/intro-deck.json --no-counter --theme light-minimal
125129
```
126130

@@ -179,12 +183,13 @@ quoteforge themes validate <file> # Validate a theme file
179183
```
180184
quoteforge batch <directory> [options]
181185
182-
-t, --theme <name> Override theme for all files
183-
-s, --size <name> Override size for all files
184-
-o, --output <dir> Output directory
185-
--fit-content Crop each output to content bounding box + theme padding
186-
--concurrency <n> Parallel workers (default: 2)
187-
--decks Also process deck files into individual ZIPs
186+
-t, --theme <name> Override theme for all files
187+
-s, --size <name> Override size for all files
188+
-o, --output <dir> Output directory
189+
--safe-aspect <ratio> Constrain content for center-crop (e.g. 16:9)
190+
--fit-content Crop each output to content bounding box + theme padding
191+
--concurrency <n> Parallel workers (default: 2)
192+
--decks Also process deck files into individual ZIPs
188193
```
189194

190195
### `validate` — Validate content files

site/src/docs/cli.mdx

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,42 @@ quoteforge generate card.json --fit-content # crop to content, no surrounding
1818

1919
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.
2020

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"`:
35+
36+
```json
37+
{
38+
"template": "quote",
39+
"theme": "dark-teal",
40+
"size": "instagram-sq",
41+
"align": "center",
42+
"blocks": [
43+
{ "type": "headline", "parts": [{ "text": "Center-safe for 16:9", "style": "normal" }] },
44+
{ "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.
56+
2157
Options:
2258

2359
| Flag | Default | Description |
@@ -26,6 +62,7 @@ Options:
2662
| `-s, --size <name>` | (from file) | Override size (e.g. `instagram-sq`) |
2763
| `-o, --output <path>` | `outputs/` | Output directory |
2864
| `--scale <n>` | `2` | Pixel ratio (1 or 2) |
65+
| `--safe-aspect <ratio>` || Constrain content to safe band for center-crop (e.g. `16:9`) |
2966
| `--fit-content` || Crop output to content bounding box + theme padding |
3067
| `--no-timestamp` || Don't append ISO timestamp to filename |
3168
| `--open` || Open the PNG after generation |
@@ -48,6 +85,7 @@ Options:
4885
| `--slide <n>` || Render only slide N (1-indexed), no ZIP |
4986
| `--no-zip` || Skip ZIP creation |
5087
| `--no-counter` || Disable counter overlay |
88+
| `--safe-aspect <ratio>` || Constrain content to safe band for center-crop (e.g. `16:9`) |
5189
| `--fit-content` || Crop each slide to content bounding box + theme padding |
5290
| `--concurrency <n>` | `4` | Parallel render workers |
5391
| `--scale <n>` | `2` | Pixel ratio |
@@ -61,7 +99,7 @@ Render every JSON file in a directory.
6199
quoteforge batch <dir> [options]
62100
```
63101

64-
Options include `--theme`, `--size`, `--output`, `--fit-content`, `--concurrency`, and `--decks` (to also process deck files).
102+
Options include `--theme`, `--size`, `--output`, `--safe-aspect`, `--fit-content`, `--concurrency`, and `--decks` (to also process deck files).
65103

66104
## `validate`
67105

0 commit comments

Comments
 (0)