Skip to content

Commit 89e940a

Browse files
committed
docs(templates): redraw the cv.v2 layer diagrams for the extracted core
The cv.v2 package now owns four layers (data / components / widgets / presets); theme, the neutral header widgets, and the markdown/text helpers moved to templates.core.*. Update the docs that still drew the pre-extraction structure. - cv/v2/package-info + quickstart: redraw the ASCII layer diagrams as "four CV layers, built on the shared core"; correct the widget homes (header bricks in core.identity), preset count (16), and the theme / text attributions. - AUTHORS: correct the layer list. - DocumentTemplate: drop the v1.6 migration-window wording and the phantom CvTemplate; the factory theme type is per-family (BrandTheme for cv / cover-letter and the layered invoice / proposal presets). - themes/Spacing + Typography: reword the dangling historical BrandTheme.spacing / .defaultTheme() references.
1 parent 9f61fe2 commit 89e940a

6 files changed

Lines changed: 96 additions & 106 deletions

File tree

docs/templates/v2-layered/quickstart.md

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ GraphCompose's templates v2 (layered) gives you:
1414
- **Themes describing visuals**`BrandTheme` (palette + typography +
1515
spacing + decoration). Swap a theme to change colours, fonts,
1616
bullet glyphs without touching renderers.
17-
- **Widgets as visual LEGO bricks**`Headline`, `Subheadline`,
18-
`ContactLine`, `SectionHeader`. Each one is a named visual decision
19-
you can drop into a preset.
17+
- **Widgets as visual LEGO bricks** — the neutral header bricks
18+
(`Headline`, `Subheadline`, `ContactLine`) live in the shared
19+
`templates.core.identity`; CV-specific ones (`SectionHeader` and
20+
friends) in `cv.v2.widgets`. Each is a named visual decision you
21+
drop into a preset.
2022
- **Presets as compositions** — a preset orchestrates widgets in a
21-
page flow. `BoxedSections`, `MinimalUnderlined`,
22-
`ModernProfessional`, `CenteredHeadline`, `BlueBanner`,
23-
`EditorialBlue`, `ClassicSerif`, `NordicClean`, and `CompactMono`
24-
ship today; writing your own is ~150 lines.
23+
page flow. Sixteen ship today (`BoxedSections`, `ModernProfessional`,
24+
`NordicClean`, `EditorialBlue`, `Executive`, `EngineeringResume`,
25+
`TimelineMinimal`, …); writing your own is ~150 lines.
2526

2627
You hand a `CvDocument` to a preset, you get a PDF. The preset
2728
internally composes widgets that read theme tokens that ultimately
@@ -84,50 +85,50 @@ Same data, different visual. That's the layering.
8485

8586
---
8687

87-
## The 5 layers
88+
## The layers
8889

8990
```
90-
┌─────────────────────────────────────────────────────────────┐
91-
│ presets/ BoxedSections, MinimalUnderlined, │
92-
│ ModernProfessional, CenteredHeadline, │
93-
│ BlueBanner, EditorialBlue, ClassicSerif, │
94-
│ NordicClean, CompactMono │
95-
│ — composition of widgets in a page flow │
96-
└─────────────────────────────────────────────────────────────┘
91+
┌────────────────────────────────────────────────────────────────────────────┐
92+
│ presets/ 16 CV compositions │
93+
│ BoxedSections, ModernProfessional, NordicClean, ... │
94+
│ -- widgets composed in a page flow │
95+
└────────────────────────────────────────────────────────────────────────────┘
9796
│ compose from widgets
9897
99-
┌─────────────────────────────────────────────────────────────┐
100-
│ widgets/ Headline, Subheadline, ContactLine, │
101-
│ SectionHeader │
102-
│ — named visual LEGO bricks │
103-
└─────────────────────────────────────────────────────────────┘
104-
│ delegate to ↓ │ read tokens from ↓
105-
▼ ▼
106-
┌─────────────────────┐ ┌──────────────────────────────────┐
107-
│ components/ │ │ theme/ │
108-
│ SectionDispatcher │ │ Palette (colours) │
109-
│ EntryRenderer │ │ Typography (fonts + sizes) │
110-
│ RowRenderer │ │ Spacing (margins + gaps) │
111-
│ ParagraphRenderer │ │ Decoration (bullet, sep) │
112-
│ + primitives │ │ BrandTheme (bundle + factories) │
113-
└─────────────────────┘ └──────────────────────────────────┘
114-
│ renders into DSL
98+
┌────────────────────────────────────────────────────────────────────────────┐
99+
│ widgets/ CV-specific visual bricks │
100+
│ SectionHeader, FlowSectionHeader, SkillBar, SectionModule, ... │
101+
│ (neutral header bricks -- Headline, Subheadline, ContactLine, │
102+
│ Masthead, SvgGlyph -- live in core.identity) │
103+
└────────────────────────────────────────────────────────────────────────────┘
104+
│ delegate to
115105
116-
┌─────────────────────────────────────────────────────────────┐
117-
│ data/ CvDocument, CvIdentity, CvSection (sealed), │
118-
│ ParagraphSection / SkillsSection / RowsSection │
119-
│ / EntriesSection, │
120-
│ CvRow, CvEntry, Slot │
121-
│ — pure records, zero rendering deps │
122-
└─────────────────────────────────────────────────────────────┘
106+
┌────────────────────────────────────────────────────────────────────────────┐
107+
│ components/ CV section renderers │
108+
│ SectionDispatcher, EntryRenderer, RowRenderer, ParagraphRenderer │
109+
└────────────────────────────────────────────────────────────────────────────┘
110+
│ render into
111+
112+
┌────────────────────────────────────────────────────────────────────────────┐
113+
│ data/ CvDocument, CvIdentity, CvSection (sealed), │
114+
│ ParagraphSection / SkillsSection / RowsSection / EntriesSection, │
115+
│ CvRow, CvEntry, Slot -- pure records, zero rendering deps │
116+
└────────────────────────────────────────────────────────────────────────────┘
117+
118+
...all built on the shared, family-neutral core (templates.core.*):
119+
┌────────────────────────────────────────────────────────────────────────────┐
120+
│ core.theme BrandTheme = Palette / Typography / Spacing / Decoration │
121+
│ core.identity Headline, Subheadline, ContactLine, Masthead, SvgGlyph │
122+
│ core.text MarkdownText, RichParagraphRenderer, TextStyles │
123+
└────────────────────────────────────────────────────────────────────────────┘
123124
```
124125

125126
**What each layer is for** (in plain English):
126127

127128
| Layer | "Answers the question…" |
128129
|---|---|
129130
| `data/` | "What goes on the page?" — content, no styling. |
130-
| `theme/` | "How does it look?" — colours, fonts, glyphs. |
131+
| `core.theme` | "How does it look?" — colours, fonts, glyphs (shared `BrandTheme`). |
131132
| `components/` | "How is one element drawn?" — paragraph, row, entry primitives. |
132133
| `widgets/` | "Which visual building block do I want here?" — named LEGO bricks. |
133134
| `presets/` | "In what order, with which widgets, on which page flow?" — composition. |

src/main/java/com/demcha/compose/document/templates/api/DocumentTemplate.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,22 @@
1010
* {@link DocumentSession}. The interface is intentionally minimal — just
1111
* identity (for registry lookup) and one composition seam.</p>
1212
*
13-
* <p><strong>Templates v2 contract</strong> (introduced in v1.6 alongside
14-
* the templates restructure):</p>
13+
* <p>Implementation contract:</p>
1514
* <ul>
16-
* <li>Implementations should be plain factory-style classes whose
17-
* {@code create(BusinessTheme)} method returns a configured
18-
* {@code DocumentTemplate<S>}.</li>
15+
* <li>Implementations are plain factory-style classes — a static
16+
* {@code create(theme)} method returns a configured
17+
* {@code DocumentTemplate<S>}. The theme type is the family's own:
18+
* the layered cv / cover-letter presets take a {@code BrandTheme};
19+
* the layered invoice / proposal presets take a
20+
* {@code BusinessTheme}.</li>
1921
* <li>Implementations are stateless after construction — composing the
2022
* same spec twice produces the same output.</li>
2123
* <li>Implementations do not call {@code session.buildPdf()}; the caller
2224
* owns session lifecycle. They only place semantic nodes via the
2325
* session DSL.</li>
2426
* </ul>
2527
*
26-
* <p>Domain-specific interfaces ({@code CvTemplate}, {@code InvoiceTemplate},
27-
* etc.) remain in this package during the v1.6 migration window for
28-
* backward compatibility. New templates should implement
29-
* {@code DocumentTemplate<S>} directly.</p>
30-
*
31-
* @param <S> the spec type rendered by this template (e.g. {@code CvSpec},
28+
* @param <S> the spec type rendered by this template (e.g. {@code CvDocument},
3229
* {@code InvoiceSpec}, {@code ProposalSpec})
3330
*/
3431
public interface DocumentTemplate<S> {

src/main/java/com/demcha/compose/document/templates/cv/v2/AUTHORS.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ on top of the v2 surface. It complements the JavaDoc in
55
`package-info.java` with longer, copy-pasteable recipes.
66

77
If you have never used this package before, read
8-
[the package overview](./package-info.java) first. The four layers
9-
(`data/` · `theme/` · `components/` · `presets/`) and what each is for
8+
[the package overview](./package-info.java) first. The four CV layers
9+
(`data/` · `components/` · `widgets/` · `presets/`) — plus the shared
10+
theme / text / identity in `templates.core.*` — and what each is for
1011
are explained there.
1112

1213
This guide answers the **"how do I…"** questions.

0 commit comments

Comments
 (0)