Skip to content

Commit 5c77211

Browse files
authored
Merge pull request #2 from lordvins226/feat/strict-schema-custom-size
feat(quoteforge): schema hardening, custom dimensions, vertical alignment, and presets
2 parents ac12f9c + 185ca50 commit 5c77211

47 files changed

Lines changed: 4089 additions & 127 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Changelog
2+
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+
10+
## 0.5.0
11+
12+
### Added
13+
- Five non-social size presets: `og` (1200×630), `readme-hero` (1280×640),
14+
`slide-16x9` (1920×1080), `4x3` (1600×1200), `3x2` (1500×1000).
15+
- `align` (`top` | `center` | `bottom` | `spread`) on cards, deck defaults, and slides,
16+
controlling vertical placement of content.
17+
- `--fit-content` (alias `--trim`) on `generate`/`slides`/`batch`, cropping the output to the
18+
content bounding box plus theme padding.
19+
20+
### Fixed
21+
- Studio: `size: "custom"` cards and deck slides now render at their given dimensions in preview and export (previously blank).
22+
23+
### Changed
24+
- **Rendering change:** content is now vertically centered by default instead of distributed
25+
over the full canvas height. Existing cards re-render with content grouped. Add
26+
`"align": "spread"` to approximate the previous look.
27+
28+
## 0.4.0
29+
30+
### Fixed
31+
- `--version` reported a hardcoded `0.1.0` regardless of the installed version.
32+
- `size: "custom"` produced a blank image at the browser's default viewport. Custom
33+
dimensions are now applied to both the viewport and the type-scale calculation.
34+
35+
### Changed
36+
- **Breaking:** unknown keys are now rejected by every content and theme schema.
37+
Files that previously validated with stray keys will now fail, naming the key.
38+
`meta` and `$schema` remain the supported extension points.
39+
- **Breaking:** `size: "custom"` now requires `width` and `height`. Supplying them
40+
alongside a preset size is rejected rather than silently ignored.
41+
42+
### Documentation
43+
- Documented the custom-theme workflow (duplicate, edit, render) and custom dimensions.

README.md

Lines changed: 73 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +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-
--open Open output file after generation
87-
--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
8890
```
8991

9092
**Examples:**
@@ -93,23 +95,27 @@ quoteforge generate <file> [options]
9395
quoteforge generate content/my-card.json
9496
quoteforge generate content/my-card.json --size facebook-post --theme dark-orange
9597
quoteforge generate content/my-card.json --no-timestamp --open
98+
quoteforge generate content/my-card.json --safe-aspect 16:9
99+
quoteforge generate content/my-card.json --fit-content
96100
```
97101

98102
### `slides` — Deck → numbered PNGs + ZIP
99103

100104
```
101105
quoteforge slides <file> [options]
102106
103-
-t, --theme <name> Override theme for all slides
104-
-s, --size <name> Override size for all slides
105-
-o, --output <dir> Output directory
106-
--slide <n> Render only slide N (1-indexed), no ZIP
107-
--no-zip Skip ZIP creation
108-
--no-counter Disable counter overlay for all slides
109-
--concurrency <n> Parallel render workers (default: 4)
110-
--zip-level <n> ZIP compression level 0-9 (default: 6)
111-
--scale <n> Pixel ratio (default: 2)
112-
--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
113119
```
114120

115121
**Examples:**
@@ -118,6 +124,7 @@ quoteforge slides <file> [options]
118124
quoteforge slides decks/intro-deck.json
119125
quoteforge slides decks/intro-deck.json --size facebook-square
120126
quoteforge slides decks/intro-deck.json --slide 3
127+
quoteforge slides decks/intro-deck.json --safe-aspect 16:9
121128
quoteforge slides decks/intro-deck.json --no-counter --theme light-minimal
122129
```
123130

@@ -176,11 +183,13 @@ quoteforge themes validate <file> # Validate a theme file
176183
```
177184
quoteforge batch <directory> [options]
178185
179-
-t, --theme <name> Override theme for all files
180-
-s, --size <name> Override size for all files
181-
-o, --output <dir> Output directory
182-
--concurrency <n> Parallel workers (default: 2)
183-
--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
184193
```
185194

186195
### `validate` — Validate content files
@@ -214,10 +223,19 @@ All formats with exact pixel dimensions:
214223
| `threads-port` | 1080 × 1350 | 4:5 | Threads portrait *(recommended)* |
215224
| `threads-land` | 1080 × 566 | 1.91:1 | Threads landscape |
216225
| `story` | 1080 × 1920 | 9:16 | Stories (IG / FB / TW) |
226+
| `og` | 1200 × 630 | 1.91:1 | Open Graph / default social preview |
227+
| `readme-hero` | 1280 × 640 | 2:1 | Blog/README header |
228+
| `slide-16x9` | 1920 × 1080 | 16:9 | Slides (presentation) |
229+
| `4x3` | 1600 × 1200 | 4:3 | Slides / covers |
230+
| `3x2` | 1500 × 1000 | 3:2 | Article headers |
217231
| `custom` | variable | free | Custom dimensions |
218232

219233
> Facebook carousels render best with `facebook-square` (1080×1080).
220234
235+
### Vertical alignment
236+
237+
By default, card content is vertically centered on the canvas. Add `"align": "spread"` to your card root to distribute blocks edge-to-edge (the pre-0.5.0 behavior). Other values are `"top"` and `"bottom"`. In decks, set alignment in `defaults` or override per-slide.
238+
221239
## Themes
222240

223241
12 built-in themes, covering terminal, editorial, brutalist, and zen aesthetics:
@@ -237,7 +255,40 @@ All formats with exact pixel dimensions:
237255
| `kyoto` | `#FAF8F3` | `#D4411E` | Shippori Mincho / Inter |
238256
| `mono-slate` | `#F5F5F4` | `#0C0A09` | Syne / JetBrains Mono |
239257

240-
Create your own: `quoteforge themes create my-brand`
258+
### Themes are fork points, not a fixed menu
259+
260+
The twelve built-ins are starting points. Duplicating one and changing a single color
261+
is usually enough to match an existing brand:
262+
263+
```bash
264+
quoteforge themes duplicate terminal-green my-brand
265+
```
266+
267+
That writes `~/.config/quoteforge/themes/my-brand.json` — plain, hand-editable JSON.
268+
Change the accent:
269+
270+
```json
271+
{
272+
"name": "my-brand",
273+
"displayName": "My Brand",
274+
"colors": {
275+
"accent": "#4ecdc4"
276+
}
277+
}
278+
```
279+
280+
Then render with it:
281+
282+
```bash
283+
quoteforge generate card.json --theme my-brand
284+
```
285+
286+
`quoteforge themes show my-brand` prints the resolved theme with color swatches, and
287+
`quoteforge themes list` includes it alongside the built-ins.
288+
289+
`terminal-green` is a good base for a dark developer palette — JetBrains Mono on a
290+
near-black background. `paper-cream` and `light-minimal` suit editorial and print-like
291+
work.
241292

242293
## Templates
243294

0 commit comments

Comments
 (0)