Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,24 @@ follow semantic versioning; release dates are ISO 8601.
template surface, including its isolated theme tokens, visual
regression baselines, and reusable `Subheadline` /
`SectionHeader.flatSpacedCaps` widget support.
- Added the **Mint Editorial** template set: a two-page, two-column
editorial CV preset `MintEditorial` (centred spaced-caps masthead with
a full-width mint accent rule; sidebar contact / interests / education /
expertise / skill-bars / social beside a profile / experience / awards /
references main column) and its paired `MintEditorialLetter`, both on
`CvTheme.mintEditorial()` and with visual regression baselines.
- Added two reusable `cv/v2/widgets`: `SkillBar` (data-driven proficiency
bar — spaced-caps label above a track with a level-positioned marker;
no bar when the level is absent) and `IconTextRow` (inline icon + text
row, optionally a single click target), with `WidgetSmokeTest` coverage.
- Added optional proficiency levels to `SkillGroup` via the new
`CvSkill` record and `SkillsSection.Builder.leveledGroup(...)`. Fully
backward-compatible: name-only skills carry no level and every existing
name-based renderer is unaffected.
- Added `MintEditorial.Options` (and a matching `MintEditorialLetter.Options`)
— an additive masthead colour API (accent, rule, name, and an optional
full-width page-1 header band) whose defaults reproduce the stock render
exactly, so the committed look and the parity baselines are unchanged.

### Public API

Expand Down
18 changes: 18 additions & 0 deletions docs/templates/v2-layered/authoring-presets.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,24 @@ in `com.demcha.compose.document.templates.widgets`.
| `SectionHeader.upperRule(host, title, theme, titleStyle, ruleColor, ruleWidth)` | Uppercase label with short rule below |
| `SectionHeader.spacedCapsRule(host, title, theme, titleStyle, ruleColor, ruleWidth, ruleThickness, ruleMargin)` | Spaced-caps label with short rule below |

### `SkillBar` — data-driven proficiency bar

| Variant | Visual |
|---|---|
| `SkillBar.render(host, skill, trackWidth, theme)` | Spaced-caps skill label above a thin track with a level-positioned marker; renders the label with **no bar** when `skill.level()` is absent |

Reads the level from `CvSkill.level()` (`[0, 1]`); used by the Mint
Editorial skills sidebar.

### `IconTextRow` — inline icon + text row

| Variant | Visual |
|---|---|
| `IconTextRow.render(host, icon, iconSize, text, style, link, margin)` | A glyph image followed by a label on one baseline; the whole row is a single click target when a `link` is supplied |

Used for the icon-led contact and social rows in sidebar CV layouts
(Mint Editorial).

### Higher-order CV widgets

| Widget | Visual |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package com.demcha.examples.templates.cv.v2;

import com.demcha.compose.GraphCompose;
import com.demcha.compose.document.api.DocumentPageSize;
import com.demcha.compose.document.api.DocumentSession;
import com.demcha.compose.document.style.DocumentColor;
import com.demcha.compose.document.templates.api.DocumentTemplate;
import com.demcha.compose.document.templates.cv.v2.data.CvDocument;
import com.demcha.compose.document.templates.cv.v2.presets.MintEditorial;
import com.demcha.examples.support.ExampleDataFactory;
import com.demcha.examples.support.ExampleOutputPaths;

import java.nio.file.Path;

/**
* Renders the Mint Editorial CV against the rich "Rose Harris" showcase
* dataset with a single <strong>custom colour</strong> via
* {@link MintEditorial.Options} — a soft kraft-paper header band that fills
* the whole masthead zone from the top page edge down to the mint rule. Only
* {@code headerBandColor} is set; everything else stays default, so the dark
* name, mint tagline, and mint full-width rule are unchanged and read cleanly
* on the light tan band. This demonstrates the colour-customisation API; the
* default-coloured render lives in {@code CvMintEditorialExample} and is left
* untouched.
*
* <p>Output:
* {@code examples/target/generated-pdfs/templates/cv/cv-mint-editorial-v2-custom.pdf}.</p>
*/
public final class CvMintEditorialCustomExample {

private CvMintEditorialCustomExample() {
}

public static Path generate() throws Exception {
Path outputFile = ExampleOutputPaths.prepare(
"templates/cv", "cv-mint-editorial-v2-custom.pdf");
CvDocument doc = ExampleDataFactory.mintEditorialShowcaseCv();

// Set ONLY the header band colour — a soft warm kraft-paper tan. Every
// other knob stays default: dark ink name, mint tagline, mint
// full-width rule. The dark name reads cleanly on the light tan band.
MintEditorial.Options options = MintEditorial.Options.builder()
.headerBandColor(DocumentColor.rgb(228, 217, 198)) // kraft-paper tan band
.build();
DocumentTemplate<CvDocument> template = MintEditorial.create(options);

float m = (float) MintEditorial.RECOMMENDED_MARGIN;
try (DocumentSession document = GraphCompose.document(outputFile)
.pageSize(DocumentPageSize.A4)
.margin(m, m, m, m)
.create()) {
template.compose(document, doc);
document.buildPdf();
}
return outputFile;
}

public static void main(String[] args) throws Exception {
System.out.println("Generated: " + generate());
}
}
Loading