docs(examples): show a CV assembled at runtime rather than written in Java - #589
Merged
DemchaAV merged 2 commits intoAug 21, 2026
Merged
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 CVarrives as data had nothing showing what that looks like end to end.
What
CvRuntimeModulesExamplebuilds every section from aPAYLOADconstant standing in forparsed JSON — a title, a role, a kind, and items, with absent fields arriving as
nulltheway 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 thanids(): those are the templates that promise to draw amodule they were not written for, and the lookup returns
ModularCvTemplate, so the promiseis 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:
identical items — same subtitle, location, period and body.
ENTRIES_DATEDagainstENTRIESis the only difference, and the date column is the only difference in theoutput:
2022-2025and2019-2022appear in the text layer,2023-2024and2018-2020do not.
SectionRole.OTHERbuilt exactly like Experience, so it renders exactly like it, undera heading nobody in the library chose.
editorial-bluerenames a classic section by keyword —a
CvSectiontitled "Certifications" prints as EDUCATION — and deliberately does not dothat 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
BodyStyleis a separate axis fromCvKindand only the author of the data knowswhich 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 arecovered by the gate rather than by inspection.
Registered in
GenerateAllExamplesandShowcaseMetadata, with a README row and section,a pointer from
docs/templates/v2-layered/using-templates.mdwhere the API is introduced,and the preview committed at
assets/readme/examples/cv-runtime-modules-v2.pdf.