Skip to content

docs(examples): show a CV assembled at runtime rather than written in Java - #589

Merged
DemchaAV merged 2 commits into
feature/cv-constructor-layerfrom
feat/cv-runtime-modules-example
Aug 21, 2026
Merged

docs(examples): show a CV assembled at runtime rather than written in Java#589
DemchaAV merged 2 commits into
feature/cv-constructor-layerfrom
feat/cv-runtime-modules-example

Conversation

@DemchaAV

@DemchaAV DemchaAV commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Why

The constructor layer shipped across several changes — ModuleSection, CvItem, CvKind,
role-first routing, the modular capability — and had no example anywhere.
grep ModuleSection examples/ returned nothing. A feature whose entire premise is that a CV
arrives as data had nothing showing what that looks like end to end.

What

CvRuntimeModulesExample builds every section from a PAYLOAD constant standing in for
parsed JSON — a title, a role, a kind, and items, with absent fields arriving as null the
way a parser leaves them. The mapping layer is one method, and nothing in it is a
compile-time decision. The design is chosen at runtime too, looked up through
CvTemplates.modular() rather than ids(): those are the templates that promise to draw a
module they were not written for, and the lookup returns ModularCvTemplate, so the promise
is carried by the type. A template outside that list composes a fixed set of slots and drops
a module without a word — the failure this layer exists to remove, so the example does not
point readers at it.

The payload isolates one variable per claim, and each is checkable in the rendered PDF
rather than only asserted in prose:

  • The kind decides which fields are read. Experience and Certifications carry
    identical items — same subtitle, location, period and body. ENTRIES_DATED against
    ENTRIES is the only difference, and the date column is the only difference in the
    output: 2022-2025 and 2019-2022 appear in the text layer, 2023-2024 and 2018-2020
    do not.
  • A category the catalogue has no name for needs no new type. Volunteering is
    SectionRole.OTHER built exactly like Experience, so it renders exactly like it, under
    a heading nobody in the library chose.
  • The heading stays the author's. editorial-blue renames a classic section by keyword —
    a CvSection titled "Certifications" prints as EDUCATION — and deliberately does not do
    that to a module. The PDF says CERTIFICATIONS with no EDUCATION anywhere.

One modelling point the render settled: the payload carries prose-vs-points per item,
because BodyStyle is a separate axis from CvKind and only the author of the data knows
which a body is. Deciding it from the kind instead draws a project description as a bullet
nested under a bullet, with a doubled full stop.

Tests

Full reactor gate green. The whole example catalogue regenerates — 106 documents, exit 0 —
and the documentation guards read examples/README.md, so the new row and section are
covered by the gate rather than by inspection.

Registered in GenerateAllExamples and ShowcaseMetadata, with a README row and section,
a pointer from docs/templates/v2-layered/using-templates.md where the API is introduced,
and the preview committed at assets/readme/examples/cv-runtime-modules-v2.pdf.

… Java

The constructor layer shipped over several changes — ModuleSection, CvItem,
CvKind, the role-first routing, the modular capability — and had no example
anywhere in examples/. A feature whose whole point is that a CV arrives as
data had nothing showing what that looks like.

CvRuntimeModulesExample builds every section from a payload standing in for
parsed JSON: a title, a role, a kind, and items. The mapping is one method,
and nothing in it is a compile-time decision. The design is picked at runtime
too — CvTemplates.byId(...) takes an id and hands back a template, with
recommendedMargin(...) for its page setup.

Three things the rendered PDF shows. Certifications and Experience carry the
same item fields; the first is ENTRIES and prints no dates, the second is
ENTRIES_DATED and prints them — the Oracle entry's 2023 appears nowhere in
the text layer. Volunteering is a category the catalogue has no role for
(OTHER) and comes out shaped exactly like Certifications, with no new type
existing for it. Every heading is the author's own.

The payload carries prose-vs-points per item, because BodyStyle is a separate
axis from CvKind and only the author of the data knows which a body is:
collapsing the two draws a project description as a bullet nested under a
bullet.

Registered in GenerateAllExamples (106 documents now) and ShowcaseMetadata,
with a row and a section in examples/README.md and the preview committed.
The first version stated three things and its own PDF contradicted them.
Certifications was ENTRIES and Volunteering ENTRIES_DATED, so the two
sections the text called identically shaped were the two that differ by
definition — one printed a date column. Experience and Certifications were
offered as "same data, one value different" while their items also differed
in location and body style. And the preset it rendered with, boxed-sections,
renames nothing and reads no role, so two of the claims were unfalsifiable
there: the reader saw a non-event.

The payload now isolates each variable. Experience and Certifications carry
identical items and differ only by kind, so only the date column differs.
Volunteering is built exactly like Experience and renders exactly like it,
under a heading nobody in the library chose. The template is editorial-blue,
which renames a classic section by keyword — a CvSection titled
"Certifications" prints as EDUCATION — so the module keeping the author's
heading is something the PDF shows rather than something the text asserts.

The Javadoc also invited swapping in any id from CvTemplates.ids(). Nine of
the sixteen are not modular and drop a module without a word, which is the
failure this layer exists to remove; it now points at modular(), and the
lookup goes through modular() so the promise is carried by the type.

The mapping method reads like the import layer it stands for: fields arrive
null as a parser leaves them, CvItem normalises them, and the body goes
through body(List, BodyStyle) — the overload written for callers holding a
list they did not build literally. Substituting the section heading for a
missing item title is restricted to PARAGRAPH, where the title is not read;
elsewhere it printed the heading as a row label.

Adds the CHANGELOG entry, points using-templates.md at the example from the
section that introduces the API, and restores the alphabetical order of the
CV block in GenerateAllExamples.
@DemchaAV
DemchaAV merged commit 7b86348 into feature/cv-constructor-layer Aug 21, 2026
10 checks passed
@DemchaAV
DemchaAV deleted the feat/cv-runtime-modules-example branch August 21, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant