Skip to content

Commit 8d2a996

Browse files
DemchaAVclaude
andcommitted
Release v1.4.1 — restore README guards dropped by v1.4.0 rewrite
CI on the v1.4.0 main commit failed DocumentationCoverageTest because the README rewrite removed three structural sections that the test baselines: - ## Table component (canonical addTable / DocumentTableColumn snippet) - ## Line primitive (canonical addDivider / addShape snippet) - ## Architecture at a glance (mermaid diagram) This patch re-adds the three sections (with the table snippet now also pointing readers at the v1.4 column-span feature) and bumps the project version to 1.4.1. Documentation-only patch release; no public API changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b56d2d0 commit 8d2a996

4 files changed

Lines changed: 79 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## v1.4.1 - 2026-04-27
4+
5+
### Documentation
6+
7+
- README rewrite for v1.4.0 dropped three structural sections (`## Table component`, `## Line primitive`, `## Architecture at a glance`) that the `DocumentationCoverageTest` guards baseline. CI flagged the regression on the `main` branch; v1.4.1 restores the sections (the table snippet now also points readers to the new column-span feature), keeps the canonical-DSL anti-patterns out of the snippets, and moves the architecture mermaid diagram back into its dedicated section.
8+
9+
### Tooling
10+
11+
- `examples/src/main/java/com/demcha/examples/GenerateAllExamples.java` now wires `CinematicProposalFileExample.generate()` into the orchestrator, so the runnable examples module produces all seven fixtures (including `project-proposal-cinematic.pdf`) used by the README visual previews.
12+
13+
This is a documentation-only patch release. There are no public API changes; v1.4.0 consumers can upgrade with no code changes.
14+
15+
---
16+
317
## v1.4.0 - 2026-04-27
418

519
### Headline — "cinematic document engine"

README.md

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -346,17 +346,61 @@ To bless a fresh baseline, set `-Dgraphcompose.visual.approve=true` (or `GRAPHCO
346346

347347
---
348348

349-
## Extending GraphCompose
349+
## Table component
350350

351-
GraphCompose is built around explicit seams &mdash; you do not have to fork the library to add a new node, a new backend, or a new template family.
351+
```java
352+
import com.demcha.compose.document.style.DocumentColor;
353+
import com.demcha.compose.document.style.DocumentInsets;
354+
import com.demcha.compose.document.table.DocumentTableColumn;
355+
import com.demcha.compose.document.table.DocumentTableStyle;
356+
357+
document.pageFlow()
358+
.name("StatusSection")
359+
.spacing(12)
360+
.addTable(table -> table
361+
.name("StatusTable")
362+
.columns(
363+
DocumentTableColumn.fixed(90),
364+
DocumentTableColumn.auto(),
365+
DocumentTableColumn.auto())
366+
.width(520)
367+
.defaultCellStyle(DocumentTableStyle.builder()
368+
.padding(DocumentInsets.of(6))
369+
.build())
370+
.headerStyle(DocumentTableStyle.builder()
371+
.fillColor(DocumentColor.LIGHT_GRAY)
372+
.padding(DocumentInsets.of(6))
373+
.build())
374+
.header("Role", "Owner", "Status")
375+
.rows(
376+
new String[]{"Engine", "GraphCompose", "Stable"},
377+
new String[]{"Feature", "Table Builder", "Canonical"}))
378+
.build();
379+
```
352380

353-
- **Add a new semantic node.** Implement `DocumentNode`, register a `NodeDefinition<MyNode>` with the `NodeRegistry`, and the layout compiler picks it up. The definition controls measurement, pagination policy, splitting, and fragment emission. See [`com.demcha.compose.document.layout.NodeDefinition`](./src/main/java/com/demcha/compose/document/layout/NodeDefinition.java) and the built-ins in `BuiltInNodeDefinitions` for the established pattern.
354-
- **Add a fragment payload.** Reuse `BuiltInNodeDefinitions.ShapeFragmentPayload` / `ParagraphFragmentPayload` / `LineFragmentPayload` / `BarcodeFragmentPayload` / `ImageFragmentPayload` &mdash; or define your own and register a matching `PdfFragmentRenderHandler`. The PDF backend dispatches by payload type.
355-
- **Add a fluent builder.** Extend `AbstractFlowBuilder<T, N>` to inherit `addParagraph / addTable / addRow / addSection / addRich / softPanel / accent*` etc. for free.
356-
- **Add a backend.** Implement `FixedLayoutBackend<R>` (PDF-style) or `SemanticBackend` (DOCX/PPTX-style) and consume the resolved `LayoutGraph`. Page background, layer stacks, spans, and theme tokens are all expressed in canonical fragment types &mdash; no engine internals needed.
357-
- **Test for layout regressions.** Use `LayoutSnapshotAssertions` (graph-level) and `PdfVisualRegression` (pixel-level). Both ship in test scope, both gate at the snapshot/baseline level so you can refactor with confidence.
381+
For totals rows, header groupings, and full-width section dividers, combine the snippet above with `DocumentTableCell.text(...).colSpan(n)` &mdash; see [Column spans](#column-spans).
358382

359-
The architecture diagram:
383+
## Line primitive
384+
385+
```java
386+
import com.demcha.compose.document.style.DocumentColor;
387+
388+
document.pageFlow()
389+
.name("LinePrimitives")
390+
.spacing(12)
391+
.addDivider(divider -> divider
392+
.name("HorizontalRule")
393+
.width(220)
394+
.thickness(3)
395+
.color(DocumentColor.ROYAL_BLUE))
396+
.addShape(shape -> shape
397+
.name("VerticalAccent")
398+
.size(3, 90)
399+
.fillColor(DocumentColor.ORANGE))
400+
.build();
401+
```
402+
403+
## Architecture at a glance
360404

361405
```mermaid
362406
graph TD
@@ -382,6 +426,16 @@ graph TD
382426

383427
Public authoring lives in `com.demcha.compose`, `document.api`, `document.dsl`, `document.node`, `document.style`, `document.table`, `document.theme` (v1.4), and `font`. Engine internals live under `com.demcha.compose.engine.*` and are not the recommended application API; they are guarded by `PublicApiNoEngineLeakTest`.
384428

429+
## Extending GraphCompose
430+
431+
GraphCompose is built around explicit seams &mdash; you do not have to fork the library to add a new node, a new backend, or a new template family.
432+
433+
- **Add a new semantic node.** Implement `DocumentNode`, register a `NodeDefinition<MyNode>` with the `NodeRegistry`, and the layout compiler picks it up. The definition controls measurement, pagination policy, splitting, and fragment emission. See [`com.demcha.compose.document.layout.NodeDefinition`](./src/main/java/com/demcha/compose/document/layout/NodeDefinition.java) and the built-ins in `BuiltInNodeDefinitions` for the established pattern.
434+
- **Add a fragment payload.** Reuse `BuiltInNodeDefinitions.ShapeFragmentPayload` / `ParagraphFragmentPayload` / `LineFragmentPayload` / `BarcodeFragmentPayload` / `ImageFragmentPayload` &mdash; or define your own and register a matching `PdfFragmentRenderHandler`. The PDF backend dispatches by payload type.
435+
- **Add a fluent builder.** Extend `AbstractFlowBuilder<T, N>` to inherit `addParagraph / addTable / addRow / addSection / addRich / softPanel / accent*` etc. for free.
436+
- **Add a backend.** Implement `FixedLayoutBackend<R>` (PDF-style) or `SemanticBackend` (DOCX/PPTX-style) and consume the resolved `LayoutGraph`. Page background, layer stacks, spans, and theme tokens are all expressed in canonical fragment types &mdash; no engine internals needed.
437+
- **Test for layout regressions.** Use `LayoutSnapshotAssertions` (graph-level) and `PdfVisualRegression` (pixel-level). Both ship in test scope, both gate at the snapshot/baseline level so you can refactor with confidence.
438+
385439
## Performance (v1.4)
386440

387441
All numbers below come from `scripts/run-benchmarks.ps1` &mdash; the full local benchmark workflow that builds the test classpath once and runs `current-speed`, `comparative`, `core-engine`, `full-cv`, `scalability`, and `stress` suites in sequence. They were captured on a developer laptop; CI machines are typically 1.5&ndash;2&times; slower.

examples/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
<groupId>io.github.demchaav</groupId>
88
<artifactId>graphcompose-examples</artifactId>
9-
<version>1.4.0</version>
9+
<version>1.4.1</version>
1010
<name>GraphCompose Examples</name>
1111
<description>Runnable file-render examples for GraphCompose templates.</description>
1212

1313
<properties>
14-
<graphcompose.version>1.4.0</graphcompose.version>
14+
<graphcompose.version>1.4.1</graphcompose.version>
1515
<logback.version>1.5.18</logback.version>
1616
<maven.compiler.release>21</maven.compiler.release>
1717
</properties>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>io.github.demchaav</groupId>
88
<artifactId>graphcompose</artifactId>
9-
<version>1.4.0</version>
9+
<version>1.4.1</version>
1010

1111
<name>GraphCompose</name>
1212
<description>A declarative layout engine for programmatic document generation, implemented primarily in Java.</description>

0 commit comments

Comments
 (0)