Skip to content

Commit fe6bbdd

Browse files
authored
feat(examples): a six-slide carousel sized for a LinkedIn document post (#472)
* feat(examples): a five-slide carousel sized for a LinkedIn document post 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. * feat(examples): open the carousel with the social card, and correct its 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. * docs(examples): describe the carousel that shipped, and scale the boxes 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.
1 parent dc854f0 commit fe6bbdd

3 files changed

Lines changed: 550 additions & 1 deletion

File tree

examples/src/main/java/com/demcha/examples/GenerateAllExamples.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import com.demcha.examples.flagships.FinancialReportPptxExample;
5353
import com.demcha.examples.flagships.MasterShowcaseExample;
5454
import com.demcha.examples.flagships.MasterShowcasePptxExample;
55+
import com.demcha.examples.flagships.LinkedInCarouselExample;
5556
import com.demcha.examples.flagships.SocialCardExample;
5657
import com.demcha.examples.flagships.MavenBannerPptxExample;
5758
import com.demcha.examples.flagships.ModuleFirstFileExample;
@@ -225,6 +226,8 @@ public static void main(String[] args) throws Exception {
225226
System.out.println("Generated: " + MavenBannerPptxExample.generate());
226227
System.out.println("Generated: " + SocialCardExample.generate());
227228
System.out.println("Generated: " + SocialCardExample.generatePptx());
229+
System.out.println("Generated: " + LinkedInCarouselExample.generate());
230+
System.out.println("Generated: " + LinkedInCarouselExample.generatePptx());
228231
System.out.println("Generated: " + TwinOutputExample.generate());
229232
System.out.println("Generated: " + FinancialReportExample.generate());
230233
System.out.println("Generated: " + FinancialReportPptxExample.generate());

0 commit comments

Comments
 (0)