Skip to content

Latest commit

 

History

History
79 lines (61 loc) · 3.19 KB

File metadata and controls

79 lines (61 loc) · 3.19 KB

Recipes

GraphCompose recipes are split into focused pages so each page covers one topic end-to-end. All recipes use only the canonical session-first authoring API; public application code should not import com.demcha.compose.engine.*.

Topic-focused recipe pages

Page Covers
Themes BusinessTheme.classic / modern / executive, page background, palette slots, text scale, the CvThemeBusinessTheme bridge
Shapes and visual primitives Filled cards, dividers, spacers, lines, ellipses, image fit modes, soft panels
Shape-as-container addCircle / addEllipse / addContainer with ClipPolicy (clipped layered children)
Transforms and z-index rotate / scale mixin, per-layer zIndex for overlays
Tables Row span, zebra rows, totals row, repeated header on page break
Streaming and output buildPdf / writePdf / toPdfBytes, DOCX export, layout snapshots, header / footer chrome, guide lines
Extending GraphCompose New semantic node, fluent setter, render backend, snapshot-based regression tests

For longer-form material:

Common DSL primitives — quick snippets

The following snippets cover the three smallest "I just want to put text on a page" patterns. Use them as starting points before reaching for a focused recipe page.

Paragraph module

document.pageFlow(page -> page
        .module("Professional Summary", module -> module.paragraph(
                "Backend engineer focused on secure Java systems and reliable document generation.")));

Bullet list

document.pageFlow(page -> page
        .module("Technical Skills", module -> module.bullets(
                "Java 21",
                "Spring Boot",
                "PostgreSQL",
                "Docker")));

Markerless rows

document.pageFlow(page -> page
        .module("Projects", module -> module.rows(
                "GraphCompose - Declarative PDF/document layout engine.",
                "CVRewriter - Profile-aware CV tailoring platform.")));

Snapshot regression in a test

import com.demcha.compose.testing.layout.LayoutSnapshotAssertions;

try (DocumentSession document = GraphCompose.document().create()) {
    document.pageFlow(page -> page
            .module("Snapshot Example", module -> module.paragraph("Hello GraphCompose")));

    LayoutSnapshotAssertions.assertMatches(document, "my-feature/hello");
}

See recipes/extending.md § 4 for the full snapshot workflow including baseline approval.