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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</p>

> **Release status** &mdash;
> 🟢 **Latest stable**: [v2.1.0](https://github.com/DemchaAV/GraphCompose/releases/tag/v2.1.0) &mdash; the **PowerPoint** release: `graph-compose-render-pptx` turns the same resolved layout into an editable deck &mdash; one page per slide, geometry-identical to the PDF, text and panels as native shapes. Ships as `@Beta`. **[What each backend supports &darr;](docs/architecture/backend-capability-matrix.md)**
> 🟢 **Latest stable**: [v2.1.1](https://github.com/DemchaAV/GraphCompose/releases/tag/v2.1.1) &mdash; the **PowerPoint** release: `graph-compose-render-pptx` turns the same resolved layout into an editable deck &mdash; one page per slide, geometry-identical to the PDF, text and panels as native shapes. Ships as `@Beta`. **[What each backend supports &darr;](docs/architecture/backend-capability-matrix.md)**

> &nbsp;·&nbsp; ⬆️ **Upgrading from 1.x?** `graph-compose` stays a drop-in for PDF with no code change; see the [2.0 modules migration guide](./docs/migration/v2.0.0-modules.md)
> &nbsp;·&nbsp; See [API stability policy](./docs/api-stability.md) for tier definitions.
Expand Down
Binary file modified assets/readme/examples/engine-deck-v2.pdf
Binary file not shown.
Binary file modified assets/readme/examples/engine-deck.pdf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import com.demcha.compose.document.svg.SvgIcon;
import com.demcha.compose.font.FontName;
import com.demcha.examples.support.ExampleOutputPaths;
import com.demcha.examples.support.ExampleVersion;

import java.awt.image.BufferedImage;
import java.io.IOException;
Expand Down Expand Up @@ -112,7 +113,7 @@ public final class EngineDeckExample {
* filtering (e.g. straight from an IDE), so the banner never prints the raw
* {@code @…@} token.
*/
private static final String VERSION;
private static final String VERSION = ExampleVersion.withoutQualifier();
private static final String CODENAME;

static {
Expand All @@ -122,9 +123,8 @@ public final class EngineDeckExample {
banner.load(in);
}
} catch (IOException ignored) {
// Missing/unreadable metadata falls through to the defaults below.
// Missing/unreadable metadata falls through to the default below.
}
VERSION = resolved(banner.getProperty("version"), "dev");
CODENAME = resolved(banner.getProperty("codename"), "");
}

Expand Down Expand Up @@ -411,10 +411,10 @@ private static DocumentNode brandLine() {

/** Version pill ("v1.8.0") with the codename centred beside it as a tag. */
private static DocumentNode versionBlock() {
// Show the base version only: a dev/pre-release qualifier ("2.0.0-SNAPSHOT",
// "2.0.0-beta.1") is wider than the 96pt pill, and the engine wraps long
// tokens at their "." / "-" seams — the pill would break onto two lines.
String pillVersion = VERSION.replaceFirst("-.*$", "");
// VERSION already carries no qualifier: one would be wider than the 96pt
// pill, and the engine wraps long tokens at their "." / "-" seams, so the
// pill would break onto two lines.
String pillVersion = VERSION;
DocumentNode pill = new ShapeContainerBuilder().name("VerPill")
.roundedRect(96, 30, 8).fillColor(VIOLET_DEEP)
.center(new ParagraphBuilder().text("v" + pillVersion)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public final class EngineDeckV2Example {
private static final DocumentColor PALE_BLUE = DocumentColor.rgb(232, 243, 255);
private static final DocumentColor PALE_MINT = DocumentColor.rgb(230, 249, 242);

private static final String VERSION = ExampleVersion.current();
private static final String VERSION = ExampleVersion.withoutQualifier();

/**
* The {@code major.minor} of {@link #VERSION}, for the banner's prose labels.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@ public static String currentLine() {
return majorMinor(CURRENT);
}

/**
* {@link #current()} without any pre-release qualifier: {@code "2.1.1"} for
* {@code "2.1.1-SNAPSHOT"}.
*
* <p>Example documents are regenerated whenever their content changes, not
* only at a release, so between cuts the reactor version carries a
* {@code -SNAPSHOT} suffix. Rendering that suffix publishes a coordinate
* nobody can resolve, and the committed decks did exactly that after an
* off-cycle refresh. Anything a reader sees goes through here.</p>
*
* @return the version up to the first {@code -}
*/
public static String withoutQualifier() {
return CURRENT.replaceFirst("-.*$", "");
}

/**
* Reduces a version to its {@code major.minor} prefix.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.demcha.examples.support;

import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

/**
* Guards the version string the published example documents render.
*
* <p>Example PDFs are regenerated whenever their content changes, not only at a
* release, so between cuts the reactor version carries {@code -SNAPSHOT}. That
* suffix reached the committed decks once already, which meant the README-linked
* asset advertised a coordinate nobody could resolve. The strip lived privately
* in one deck and the other never inherited it; it is shared now, and this is
* what keeps a future caller from reaching for {@code current()} by habit.</p>
*/
class ExampleVersionTest {

@Test
void theRenderedVersionCarriesNoPreReleaseQualifier() {
assertThat(ExampleVersion.withoutQualifier())
.describedAs("published examples must not render a -SNAPSHOT or -rc coordinate")
.doesNotContain("-");
}

@Test
void itKeepsTheReleaseDigitsIntact() {
assertThat(ExampleVersion.withoutQualifier())
.describedAs("stripping the qualifier must not eat the version itself")
.isEqualTo(ExampleVersion.current().replaceFirst("-.*$", ""));
}

@Test
void theLineIsTheLeadingMajorMinor() {
assertThat(ExampleVersion.majorMinor("2.1.1-SNAPSHOT")).isEqualTo("2.1");
assertThat(ExampleVersion.majorMinor("dev")).isEqualTo("dev");
}
}
Binary file modified web/showcase/pdf/flagships/default/engine-deck-v2.pdf
Binary file not shown.
Binary file modified web/showcase/pdf/flagships/default/engine-deck.pdf
Binary file not shown.
Loading