Compile a whole deck
Compile a full <deck> of component slides into render plans and a .pptx: each slide on its own, problems collected per slide, and broken slides replaced with placeholders.
Lesson 20 of 4413 min+35 XPHands-on
Everything is in place: components, a library, themes, content-sized layout and text fitting. This lesson ties them into the the rest of the course relies on, and it ends the engine half of the project.
parseXml
the whole <deck>
expandAll
components → layout
applyTheme
$tokens → values
layoutSlide
boxes + fitted text
slides[]
one render plan per slide
problems[]
{ slide: 3, message: '<Card> needs a “title” prop' }
compileDeck(xml, themeName)
- Parse the whole
<deck>. If that fails, there's nothing to compile: return one deck-level problem (slide 0). - Pick the theme: the argument, then the deck's
themeattribute, then light. - For each slide, in its own
try: expand components, apply the theme, check it's a<slide>, and lay it out. Copy the layout's problems into the list with the slide number. - If anything throws, record the problem and push a placeholder slide, so the deck still has the right number of slides and still opens.
Cobots in Small Factories
What they cost, and what they save
Why owners are buying now
•
Skilled labor is hard to hire and keep
•
Most cells pay back within a year
•
No safety cages, so they fit small floors
Three quick wins
Labor
Free people from themost repetitive work.
Quality
The same result onevery cycle.
Speed
Changeovers inminutes, not days.
By the numbers
40%
faster changeovers
<12 mo
typical payback
3x
more jobs automated
“The robot didn't replace anyone. It replacedthe worst hour of everyone's day.”
- Plant manager, Ohio
Start with one cell
Pick the most repetitive job first
Key takeaways
- Each slide runs through expand, theme and layout on its own.
- Problems are collected as { slide, message } instead of thrown, so one bad slide can't sink the deck.
- A broken slide becomes a visible placeholder, and the problem list says exactly what to fix.
Sign in to run the exercise
Reading is free. Writing code here needs an account so we have somewhere to keep your Gemini key and the +35 XP you are about to earn.