Skip to content

feat(examples): a six-slide carousel sized for a LinkedIn document post#472

Open
DemchaAV wants to merge 3 commits into
developfrom
feat/linkedin-carousel
Open

feat(examples): a six-slide carousel sized for a LinkedIn document post#472
DemchaAV wants to merge 3 commits into
developfrom
feat/linkedin-carousel

Conversation

@DemchaAV

@DemchaAV DemchaAV commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Why

The existing social card is 1280x640 — a link-preview image. LinkedIn's document post is a swipeable carousel, and it crops anything wider than 4:5, so an announcement needs its own asset rather than a reuse of the preview.

What

LinkedInCarouselExample — portrait 1280x1600 (4:5), six slides, composed through the canonical DSL and rendered by the engine it describes. It opens with SocialCardExample's card at native size rather than restating it, and that is what sets the page width:

  1. the social card, letterboxed into the taller frame
  2. the one-composition premise, with the three format lanes
  3. what the PPTX backend actually is — fixed layout behind the same SPI as PDF, native shapes, one source
  4. the comparative numbers at 1000 rows, charted from live data
  5. the guarantees behind those numbers — snapshots, the measurement-count gate, the capability matrix, japicmp
  6. how to depend on it, with a runnable snippet

Nothing datable is written out. The version line comes from the filtered banner.properties; the timings and ratios come from the committed benchmark snapshot through EngineDeckData, shown with the capture date. The coordinate slide deliberately does not print the reactor version — this renders from a -SNAPSHOT tree, and publishing that string would advertise a coordinate that is not on Central.

The same composition also writes linkedin-carousel.pptx. Slide two claims the PPTX backend places the same geometry as the PDF one; emitting both from one compose(...) is what keeps that true when this file changes.

Two engine behaviours the layout had to work with

  • A section measures to its longest line. A stack of cards whose text happens to be shorter renders with ragged right edges. A zero-height spacer at the card's inner width sets the floor, and they line up.
  • Leading whitespace is trimmed during inline layout. The code sample would have flattened to the left margin and read as broken, so it indents with non-breaking spaces — Courier is monospaced, so the substitute occupies the same advance.

Neither is a defect; both are worth knowing when composing this kind of slide.

Tests

examples 44/44, javadoc:javadoc clean. Registered in GenerateAllExamples, so the Examples Generation Smoke Test covers it. All six slides were rendered and inspected.

DemchaAV added 3 commits July 27, 2026 10:35
Portrait 1080x1350, which is the tallest frame LinkedIn shows without cropping,
so the type can be sized for a phone rather than a desktop preview. Five slides:
the one-composition premise, what the PPTX backend actually is, the comparative
numbers, the guarantees behind them, and how to depend on it.

Figures are read at render time - the version line from the filtered
banner.properties, the comparative timings from the committed benchmark
snapshot - so the file does not need remembering on the next release.

The coordinate slide deliberately does not print the reactor version: this
renders from a -SNAPSHOT tree, and publishing that string would advertise a
coordinate that is not on Central.

Two engine details the layout needed. A section measures to its longest line,
so a stack of cards renders with ragged right edges; a zero-height spacer sets
the width floor and they line up. Leading whitespace is trimmed during inline
layout, so the code sample indents with non-breaking spaces, which occupy the
same advance in a monospaced face.

The same composition also writes a PPTX, which is what keeps slide two's claim
about identical geometry honest whenever this file changes.
…ts licence

The carousel now leads with SocialCardExample's artwork rather than restating
it, so the post opens on the picture that already explains the premise.

That drove the page size. The card is a 1280pt canvas with absolute
coordinates, and the DSL has no node-level scale outside images, so scaling it
would have meant rebuilding it against a width. Widening the carousel to
1280x1600 keeps the frame at 4:5 and carries the card at native size instead.
Everything else was drawn against a 1080-wide page, so the three type helpers
multiply by the ratio and the slides keep their proportions.

Its own page takes a zero margin so the artwork reaches the edges, and a spacer
centres it in the taller frame; both share the night background, so the space
above and below reads as letterboxing rather than a gap.

The closing slide said APACHE-2.0. The repository is MIT - LICENSE, the README
badge and the card's own footer all agree - so the carousel was contradicting
the slide it now opens with. The Maven coordinate also broke mid-artifact at
that width and is set as groupId over artifactId.
…es with the type

The prose still described the first commit: five slides at 1080x1350, where
adding the social card made it six at 1280x1600. Class javadoc and the method
comment both said five.

The widening scaled the type helpers but left the gaps, corner radii, accent
bars and stroke widths at their 1080-era values, so "the slides keep their
proportions" was true of the text and not of the boxes around it. They take the
same ratio now, and the constant's javadoc says which lengths it applies to
rather than leaving the next reader to guess.

The opening slide's centring spacer is floored at zero: a card taller than the
page would have asked for a negative height instead of simply filling the frame.
@DemchaAV DemchaAV changed the title feat(examples): a five-slide carousel sized for a LinkedIn document post feat(examples): a six-slide carousel sized for a LinkedIn document post Jul 27, 2026
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