Skip to content

Commit 9f61fe2

Browse files
authored
docs(templates): point template docs at the extracted templates.core (#252)
Update the current template docs to the post-extraction names: the CV theme is BrandTheme in templates.core.theme, and the markdown/text helpers, header widgets, and shared widgets live under templates.core.*. - package-map: add core.theme/text/identity/widgets rows, fold the old widgets+decorations entries into one core.widgets row, note MarkdownText moved to core.text. - v2-layered guides, AUTHORS, which-template-system, api-stability, recipes, overview, CONTRIBUTING: CvTheme to BrandTheme, cv.v2.theme to core.theme, and corrected widget package homes. - coverletter package-info: the reused renderer is core.text.RichParagraphRenderer. Historical records (ADRs, CHANGELOG, migration guides) are left as point-in-time records.
1 parent 842db31 commit 9f61fe2

14 files changed

Lines changed: 105 additions & 96 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ implementation; read it before starting yours.
272272
variant alongside `ModernProfessional`, a new invoice preset
273273
alongside `InvoiceTemplateV2`):
274274

275-
- Constructor takes a `BusinessTheme` (or `CvTheme` for CV
275+
- Constructor takes a `BusinessTheme` (or `BrandTheme` for CV
276276
templates). Provide a no-arg overload that picks a default theme.
277277
- Compose against `DocumentDsl` — no PDF-specific imports.
278278
- Route every visible token through `theme.palette()` /

docs/api-stability.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ matrix.
2828

2929
| Tier | Marker | Used for | Breaking changes allowed in |
3030
|---|---|---|---|
31-
| **Stable** | _(default — no annotation)_ | The canonical authoring surface that user code is meant to call: `GraphCompose.document(...)`, `DocumentSession`, `DocumentDsl`, `RowBuilder` / `SectionBuilder` / `ParagraphBuilder` and friends, `DocumentInsets` / `DocumentColor` / `DocumentTextStyle`, the `BusinessTheme` and `CvTheme` factories, the recommended template presets in `cv.v2.*` and `coverletter.v2.*`. | **Major releases only.** |
31+
| **Stable** | _(default — no annotation)_ | The canonical authoring surface that user code is meant to call: `GraphCompose.document(...)`, `DocumentSession`, `DocumentDsl`, `RowBuilder` / `SectionBuilder` / `ParagraphBuilder` and friends, `DocumentInsets` / `DocumentColor` / `DocumentTextStyle`, the `BusinessTheme` and `BrandTheme` factories, the recommended template presets in `cv.v2.*` and `coverletter.v2.*`. | **Major releases only.** |
3232
| **Supported** | _(no annotation; called out in the page's Javadoc)_ | A canonical surface that ships through 1.x but won't be in 2.0 — its replacement is already the Stable path. The `cv.presets.*` "classic" CV preset surface is the only Supported tier in 1.x today (replaced by `cv.v2.*` per [`which-template-system.md`](templates/which-template-system.md)). Bug fixes + behaviour-preserving refactors only. | **Minor releases for behaviour-preserving refactors; removed wholesale in 2.0.** |
3333
| **Extension SPI** | [`@Beta`](../src/main/java/com/demcha/compose/document/api/Beta.java) | Public extension points that authors are expected to **implement**, not only call: render-handler interfaces, [`NodeDefinition`](../src/main/java/com/demcha/compose/document/layout/NodeDefinition.java), custom `Theme` subtype contracts, fragment payload interfaces designed for extension. | Minor releases, with a one-minor deprecation window where possible. |
3434
| **Experimental** | [`@Beta`](../src/main/java/com/demcha/compose/document/api/Beta.java) _(same annotation as Extension SPI; the distinction lives in the docstring on the annotated element)_ | A brand-new public type shipping in its first minor release before its contract has stabilised. The contract is in active flux. | Any minor release, including removal. No deprecation window. |
@@ -178,7 +178,7 @@ window starts, and its `Status` flips to `deprecated 1.x`.
178178
|---|---|---|---|---|---|---|
179179
| `DocumentSession.pageMargins(List<PageMarginRule>)` / `PageMarginRule` | Stable | planned | Per-page margins resolve a block's content width by the page it *begins* on (the engine measures each block once, before pagination). A margin that changes the content width therefore does not re-wrap a block mid-flow across a page boundary. | Revisit a page-aware per-line/per-fragment width model so a block can re-wrap when it crosses a margin boundary, if demand warrants. |||
180180
| `templates.api.CoverLetterTemplate` | Stable | deprecated 1.9 | Orphan interface — nothing implements it; cover-letter presets implement the generic `DocumentTemplate<CoverLetterDocumentSpec>` seam. | Remove; callers implement `DocumentTemplate<CoverLetterDocumentSpec>`. |||
181-
| `templates.cv.v2.components.HeadlineRenderer` / `ContactRenderer` / `BannerRenderer` | Stable | deprecated 1.9 | Pre-widgets delegating shims superseded by the `cv.v2.widgets` `Headline` / `ContactLine` / `SectionHeader` widgets; no callers. | Remove; use the widgets. |||
181+
| `templates.cv.v2.components.HeadlineRenderer` / `ContactRenderer` / `BannerRenderer` | Stable | deprecated 1.9 | Pre-widgets delegating shims superseded by the `Headline` / `ContactLine` / `SectionHeader` widgets; no callers. | Remove; use the widgets. |||
182182

183183
---
184184

@@ -194,7 +194,7 @@ Javadoc per element.
194194
| `com.demcha.compose.document.dsl` | **Stable** | All builder types (`RowBuilder`, `SectionBuilder`, `ParagraphBuilder`, etc.). |
195195
| `com.demcha.compose.document.node` | **Stable** | Node records (`RowNode`, `SectionNode`, `ParagraphNode`, ...). Sealed where relevant — see § 2. |
196196
| `com.demcha.compose.document.style` | **Stable** | `DocumentColor`, `DocumentInsets`, `DocumentTextStyle`, `DocumentTransform`, ... |
197-
| `com.demcha.compose.document.templates.cv.v2.*` | **Stable** | Layered CV presets, `CvDocument`, `CvTheme`. Recommended template surface. |
197+
| `com.demcha.compose.document.templates.cv.v2.*` | **Stable** | Layered CV presets, `CvDocument`, `BrandTheme`. Recommended template surface. |
198198
| `com.demcha.compose.document.templates.coverletter.v2.*` | **Stable** | Layered cover-letter presets. |
199199
| `com.demcha.compose.document.templates.builtins` | **Stable** | `InvoiceTemplateV2`, `ProposalTemplateV2`, `BusinessTheme`. |
200200
| `com.demcha.compose.document.templates.cv.presets.*` | **Stable but Supported** | The "classic" v1.6 rebuild surface. See [`which-template-system.md`](templates/which-template-system.md). Supported through 1.x; removed in 2.0. |

docs/architecture/overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ need to reach below it.
9393
(`DocumentImageData`, `DocumentImageFitMode`).
9494
- **`document.theme`**`BusinessTheme` design tokens
9595
(`DocumentPalette`, `SpacingScale`, `TextScale`, `TablePreset`). The
96-
layered CV theme `CvTheme` lives separately under
97-
`…templates.cv.v2.theme`.
96+
layered CV theme `BrandTheme` lives separately under
97+
`…templates.core.theme`.
9898
- **`document.output`** — backend-neutral output options
9999
(`DocumentMetadata`, `DocumentWatermark`, `DocumentProtection`,
100100
`DocumentHeaderFooter`).
@@ -128,7 +128,7 @@ the same `DocumentDsl` an application would use directly.
128128
- **`...templates.builtins`** — concrete built-ins
129129
(`InvoiceTemplateV1`, `InvoiceTemplateV2`, `ProposalTemplateV1`,
130130
`ProposalTemplateV2`, `CvTemplateV1`, plus a CV gallery that takes a
131-
`BusinessTheme` or `CvTheme` in their constructor).
131+
`BusinessTheme` or `BrandTheme` in their constructor).
132132
- **`...templates.support`** — backend-neutral scene composers per
133133
domain (`...support.cv`, `...support.business`, `...support.schedule`)
134134
plus shared composition primitives in `...support.common`.

docs/architecture/package-map.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,12 @@ intended.
6868
| `com.demcha.compose.document.templates.support.schedule` | Schedule-specific scene composer. | Keep schedule-specific table/rhythm decisions isolated here. |
6969
| `com.demcha.compose.document.templates.theme` | Older shared theme *objects* for built-ins (e.g. `WeeklyScheduleTheme`). Distinct from `…templates.themes` (plural) below. | Themes carry styling decisions, not document content. New v2 token work goes in `themes`, not here. |
7070
| `com.demcha.compose.document.templates.themes` | Templates-v2 theme *token records*`Spacing`, `Typography` (future `Palette`). Pure value types, no engine / session dependencies. | One source of truth per token group; keep it dependency-free. |
71-
| `com.demcha.compose.document.templates.components` | Templates-v2 reusable composition components shared across families `Header`, `Module`, `MarkdownText`. | Stateless after construction; produce `DocumentNode`s. Family-specific components go in `<family>.v2.components`. |
71+
| `com.demcha.compose.document.templates.components` | Gen-2 composition components — `Header`, `Module` (`MarkdownText` moved to `core.text`). | Stateless after construction; produce `DocumentNode`s. |
7272
| `com.demcha.compose.document.templates.blocks` | Templates-v2 module-body block kinds — `ParagraphBlock`, `BulletListBlock`, `NumberedListBlock`, `IndentedBlock`, `KeyValueBlock`, `MultiParagraphBlock`, `EducationBlock`, `WorkHistoryBlock`. | A block declares *what* content appears; the renderer expands it per active theme / tokens. |
73-
| `com.demcha.compose.document.templates.decorations` | Templates-v2 decoration library — `Divider`, `AccentStrip`, `Spacer` (Panel / Banner / Ornament reserved). | First-class artefacts any preset can attach; not baked into composer logic. |
74-
| `com.demcha.compose.document.templates.widgets` | Shared visual widgets usable by every family — `CardWidget`, `TableWidget`, `TimelineAxisWidget`. | Keep generic (no CV-only assumptions) so invoice / proposal / cover-letter can reuse them. |
73+
| `com.demcha.compose.document.templates.core.theme` | Family-neutral theme tokens — `BrandTheme` + `Palette` / `Typography` / `Spacing` / `Decoration`. | The single token source every family's presets read. |
74+
| `com.demcha.compose.document.templates.core.text` | Family-neutral text rendering — `MarkdownText`, `MarkdownInline`, `RichParagraphRenderer`, `TextStyles`, `TextOrnaments`. | Markdown → DSL nodes; no family data model. |
75+
| `com.demcha.compose.document.templates.core.identity` | Family-neutral identity — `PartyIdentity` contract + header widgets (`Headline`, `ContactLine`, `Masthead`, `Subheadline`, `SvgGlyph`) + `Contact` / `Link`. | A masthead is the same shape in every family. |
76+
| `com.demcha.compose.document.templates.core.widgets` | Family-neutral shared widgets + decoration primitives — `CardWidget`, `TableWidget`, `TimelineAxisWidget`, `Divider`, `AccentStrip`, `Spacer`. | Keep generic (no CV-only assumptions) so any family can reuse them. |
7577

7678
> **Preset families.** Concrete document families live under `…templates.<family>``cv`, `coverletter`, `invoice`, `proposal`, `schedule`. CV and cover letter additionally ship a layered v2 surface (`…cv.v2.*` / `…coverletter.v2.*`: `data` / `theme` / `components` / `widgets` / `presets`). These per-family packages are documented by the template guides rather than enumerated here — see [which-template-system.md](../templates/which-template-system.md) for the status matrix and [templates/v2-layered/](../templates/v2-layered/README.md) for the layered architecture.
7779

docs/recipes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ authoring API; public application code should not import
1111
| --- | --- |
1212
| [Charts](recipes/charts.md) | Native vector bar / line / area / pie-donut charts: data–spec–style layers, axis & grid toggles, point markers, value-label halos, legend placement, translucent area fills |
1313
| [Keep-together pagination](recipes/keep-together.md) | `keepTogether()` / `keepEntriesTogether()` — blocks that relocate whole instead of orphaning a heading at a page break |
14-
| [Themes](recipes/themes.md) | `BusinessTheme.classic / modern / executive`, page background, palette slots, text scale, the `CvTheme``BusinessTheme` bridge |
14+
| [Themes](recipes/themes.md) | `BusinessTheme.classic / modern / executive`, page background, palette slots, text scale, the `BrandTheme``BusinessTheme` bridge |
1515
| [Shapes and visual primitives](recipes/shapes.md) | Filled cards, dividers, spacers, lines, ellipses, image fit modes, soft panels |
1616
| [Shape-as-container](recipes/shape-as-container.md) | `addCircle` / `addEllipse` / `addContainer` with `ClipPolicy` (clipped layered children) |
1717
| [Transforms and z-index](recipes/transforms.md) | `rotate` / `scale` mixin, per-layer `zIndex` for overlays |

docs/recipes/themes.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ side; V2 is the cinematic theme-driven path.
103103
## CV themes
104104

105105
CV templates are themed independently of `BusinessTheme`. The layered
106-
CV presets (`cv.v2.presets.*`) carry their own theme type, `CvTheme`
107-
(in `com.demcha.compose.document.templates.cv.v2.theme`), so CV tokens
106+
CV presets (`cv.v2.presets.*`) carry their own theme type, `BrandTheme`
107+
(in `com.demcha.compose.document.templates.core.theme`), so CV tokens
108108
stay separate from invoice / proposal vocabulary. Each preset ships a
109109
default theme; render one against a `CvDocument` with its `create()`
110110
factory:
@@ -118,7 +118,7 @@ DocumentTemplate<CvDocument> cv = ModernProfessional.create();
118118
cv.compose(session, cvDocument);
119119
```
120120

121-
To restyle, pass a custom `CvTheme` to the preset's `create(...)`
121+
To restyle, pass a custom `BrandTheme` to the preset's `create(...)`
122122
overload, or use its `Options` builder where one is provided (for
123123
example `MintEditorial.Options.builder().headerBandColor(...).build()`
124124
`MintEditorial.create(options)`). See

docs/templates/v1-classic/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ copy-and-tweak entry point for callers extending their own branding.
121121

122122
## Authoring features built into every preset
123123

124-
- **Inline markdown** &mdash; body strings carrying `**bold**` and `*italic*` markers render with proper `DocumentTextDecoration` via `templates.components.MarkdownText`.
124+
- **Inline markdown** &mdash; body strings carrying `**bold**` and `*italic*` markers render with proper `DocumentTextDecoration` via `templates.core.text.MarkdownText`.
125125
- **Active hyperlinks** &mdash; header email + LinkedIn / GitHub labels become clickable `mailto:` / `https:` runs via `DocumentLinkOptions`.
126126
- **Slot-based layouts** &mdash; multi-column presets (`Panel`, `SidebarPortrait`, `MonogramSidebar`) declare named slots (`MAIN`, `SIDEBAR`); custom presets rearrange modules via `.place(slot, "Module Name", ...)`.
127127
- **Adaptive sidebar fill** &mdash; sidebar layouts size the trailing spacer dynamically from `canvas().innerHeight()` so background panels reach the page bottom on A4 / Letter / smaller fixtures without overflow.

docs/templates/v2-layered/authoring-presets.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,15 @@ visual decision you can read like a recipe.
6060
<a id="the-widget-catalog"></a>
6161
## The widget catalog
6262

63-
The CV widget classes live in
64-
`com.demcha.compose.document.templates.cv.v2.widgets`. Each has a
65-
small set of named variants. Generic widgets that can be reused by
66-
CVs, proposals, invoices, and cover letters live one package higher
67-
in `com.demcha.compose.document.templates.widgets`.
63+
The neutral header widgets — `Headline`, `Subheadline`, `ContactLine`,
64+
`Masthead`, `SvgGlyph` — live in
65+
`com.demcha.compose.document.templates.core.identity`. The CV-specific
66+
section widgets (`SectionHeader` and friends) stay in
67+
`com.demcha.compose.document.templates.cv.v2.widgets`. The generic
68+
`CardWidget` / `TableWidget` / `TimelineAxisWidget` reusable by CVs,
69+
proposals, invoices, and cover letters live in
70+
`com.demcha.compose.document.templates.core.widgets`. Each has a small
71+
set of named variants.
6872

6973
### `Headline` — top-of-document name
7074

@@ -143,14 +147,14 @@ Used for the icon-led contact and social rows in sidebar CV layouts
143147

144148
The separator glyph used by `ContactLine`, the bullet glyph used by
145149
`RowRenderer`, and other character-level choices come from
146-
`theme.decoration()` — swap a `CvDecoration` to change them
150+
`theme.decoration()` — swap a `Decoration` to change them
147151
globally.
148152

149153
Some presets also expose narrow preset-specific options when the
150154
visual decision is structural rather than a reusable widget. Example:
151155
`NordicClean.Options` lets authors move the skills rail to the right
152156
and override the accent colour, rail fill, or profile-band fill
153-
without mutating shared `CvTheme` defaults or changing other presets.
157+
without mutating shared `BrandTheme` defaults or changing other presets.
154158

155159
---
156160

@@ -169,17 +173,17 @@ public final class MyPreset {
169173
private MyPreset() { }
170174

171175
public static DocumentTemplate<CvDocument> create() {
172-
return create(CvTheme.boxedClassic());
176+
return create(BrandTheme.boxedClassic());
173177
}
174178

175-
public static DocumentTemplate<CvDocument> create(CvTheme theme) {
179+
public static DocumentTemplate<CvDocument> create(BrandTheme theme) {
176180
Objects.requireNonNull(theme, "theme");
177181
return new Template(theme);
178182
}
179183

180184
private static final class Template implements DocumentTemplate<CvDocument> {
181-
private final CvTheme theme;
182-
Template(CvTheme theme) { this.theme = theme; }
185+
private final BrandTheme theme;
186+
Template(BrandTheme theme) { this.theme = theme; }
183187

184188
@Override public String id() { return ID; }
185189
@Override public String displayName() { return DISPLAY_NAME; }
@@ -192,7 +196,7 @@ public final class MyPreset {
192196
}
193197
```
194198

195-
Two factories (`create()` and `create(CvTheme)`), three constants
199+
Two factories (`create()` and `create(BrandTheme)`), three constants
196200
(`ID`, `DISPLAY_NAME`, `RECOMMENDED_MARGIN`), one inner `Template`
197201
class implementing `DocumentTemplate<CvDocument>`. Stable.
198202

@@ -216,18 +220,18 @@ public final class CardStyle {
216220
private CardStyle() { }
217221

218222
public static DocumentTemplate<CvDocument> create() {
219-
return create(CvTheme.boxedClassic());
223+
return create(BrandTheme.boxedClassic());
220224
}
221225

222-
public static DocumentTemplate<CvDocument> create(CvTheme theme) {
226+
public static DocumentTemplate<CvDocument> create(BrandTheme theme) {
223227
Objects.requireNonNull(theme, "theme");
224228
return new Template(theme);
225229
}
226230

227231
private static final class Template implements DocumentTemplate<CvDocument> {
228232

229-
private final CvTheme theme;
230-
Template(CvTheme theme) { this.theme = theme; }
233+
private final BrandTheme theme;
234+
Template(BrandTheme theme) { this.theme = theme; }
231235

232236
@Override public String id() { return ID; }
233237
@Override public String displayName() { return DISPLAY_NAME; }
@@ -365,7 +369,7 @@ When you do add a new widget:
365369
2. **`public final class`** with a private constructor.
366370
3. **1-3 named factories** + a lower-level `.render(...)` when useful.
367371
4. **First parameter is always `SectionBuilder host`**.
368-
5. **Pass `CvTheme theme` when the widget reads shared tokens**;
372+
5. **Pass `BrandTheme theme` when the widget reads shared tokens**;
369373
pass an explicit style only when the preset owns that unique style.
370374
6. **No instance state** — all static, all stateless.
371375
7. **JavaDoc the visual** — what does this look like? Who uses it?

docs/templates/v2-layered/contributor-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ differ.
115115
## Naming rules
116116

117117
- **Family prefix** on top-level records to avoid name collisions.
118-
CV uses `CvName`, `CvContact`, `CvTheme`. Invoice should use
118+
CV uses `CvName`, `CvIdentity`, `CvSection`. Invoice should use
119119
`InvoiceParty`, `InvoiceLine`, `InvoiceTheme`. Cover letter:
120120
`CoverLetterRecipient`, `CoverLetterTheme`. Etc.
121121
- **`<Family>Document`** for the root record. (`CvDocument`,

docs/templates/v2-layered/quickstart.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ GraphCompose's templates v2 (layered) gives you:
1111

1212
- **Records describing content**`CvDocument`, `CvIdentity`,
1313
`CvSection`. No styling, no rendering, just structured data.
14-
- **Themes describing visuals**`CvTheme` (palette + typography +
14+
- **Themes describing visuals**`BrandTheme` (palette + typography +
1515
spacing + decoration). Swap a theme to change colours, fonts,
1616
bullet glyphs without touching renderers.
1717
- **Widgets as visual LEGO bricks**`Headline`, `Subheadline`,
@@ -105,11 +105,11 @@ Same data, different visual. That's the layering.
105105
▼ ▼
106106
┌─────────────────────┐ ┌──────────────────────────────────┐
107107
│ components/ │ │ theme/ │
108-
│ SectionDispatcher │ │ CvPalette (colours) │
109-
│ EntryRenderer │ │ CvTypography (fonts + sizes) │
110-
│ RowRenderer │ │ CvSpacing (margins + gaps) │
111-
│ ParagraphRenderer │ │ CvDecoration (bullet, sep) │
112-
│ + primitives │ │ CvTheme (bundle + factories) │
108+
│ SectionDispatcher │ │ Palette (colours) │
109+
│ EntryRenderer │ │ Typography (fonts + sizes) │
110+
│ RowRenderer │ │ Spacing (margins + gaps) │
111+
│ ParagraphRenderer │ │ Decoration (bullet, sep) │
112+
│ + primitives │ │ BrandTheme (bundle + factories) │
113113
└─────────────────────┘ └──────────────────────────────────┘
114114
│ renders into DSL
115115

0 commit comments

Comments
 (0)