@aivorynet/slaide 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,22 +40,37 @@ My Talk
40
40
  | Key | Values | Meaning |
41
41
  |---|---|---|
42
42
  | `layout` | a master layout name | Which grid to use. |
43
- | `transition` | `none`,`fade`,`slide-left/right/up/down`,`zoom`,`morph` | Transition **into** this slide. |
43
+ | `transition` | a transition name (§3.1) | Transition **into** this slide. |
44
+ | `transition-ms` | milliseconds | Duration override for this slide's transition. |
45
+ | `transition-ease` | a CSS easing | Easing override (`ease`, `cubic-bezier(…)`). |
44
46
  | `background` | a master background name | Override the layout's background. |
45
47
  | `variant` | a master variant name | Scoped token overrides (e.g. a light section). |
46
48
  | `morph` | an id | Participate in a shared-element morph. |
47
49
  | `footer` | inline Markdown | Per-slide footer; also `{{footer}}`. |
48
50
  | `chrome` | `both`,`header`,`footer`,`none`,`false` | Header/footer visibility this slide. |
49
51
  | `logo` | `false` | Hide the corner logo this slide. |
52
+ | `notes` | inline Markdown | Speaker note for this slide (frontmatter form of a `???` line). |
50
53
  | *any other scalar* | — | Available as a `{{placeholder}}`. |
51
54
 
52
55
  **Cascade vs scope:** a bare key (`transition: zoom`) is this-slide-only; a `~`-prefixed key cascades to this slide and every later one until overridden (also valid in headmatter).
53
56
 
57
+ ### 3.1 Transition names
58
+
59
+ `transition:` takes one of these built-ins; per-slide `transition-ms` / `transition-ease` override timing, and the master's `transitions: { default, duration }` sets the deck-wide default.
60
+
61
+ | Group | Names |
62
+ |---|---|
63
+ | Fades | `none`, `fade`, `dissolve`, `fade-through-black` (alias `fade-black`) |
64
+ | Slides | `slide-left` (alias `slide`), `slide-right`, `slide-up`, `slide-down` |
65
+ | Push/cover | `push`, `cover`, `reveal` |
66
+ | Scale/3-D | `zoom`, `zoom-out`, `flip` |
67
+ | Shared-element | `morph` — pairs a `{#id}` image (or a `morph:` id) with the same id on the next slide |
68
+
54
69
  ## 4. Slide body
55
70
 
56
71
  - **Regions:** `:: name ::` on its own line routes following Markdown into slot `name`. Text before any marker → the main slot (`body`, else the first slot).
57
72
  - **Markdown:** standard CommonMark — headings, lists, **bold**, *italic*, `code`, fences, > quotes, links, tables, images. (A single newline is a space; blank line = new paragraph.)
58
- - **Builds `>>>`:** end an item/block with `>>>` to reveal it; steps auto-number in order, same step = simultaneous. PDF shows all.
73
+ - **Builds `>>>`:** end an item/block with `>>>` to reveal it; steps auto-number in order, same step = simultaneous. PDF shows all. Add an entrance and timing after the sigil (§4.7).
59
74
  - **Notes `??? …`:** a `???` line (until a blank line) is a speaker note — presenter overlay only, hidden from audience and PDF.
60
75
 
61
76
  ### 4.1 Inline styled spans — `[text]{.class …}`
@@ -114,6 +129,17 @@ Both render to **theme-coloured inline SVG** (web/PDF/PNG/PPTX); `slaide build`
114
129
 
115
130
  GFM pipe tables, styled by the master; use `[cell]{.class}` spans for emphasis.
116
131
 
132
+ ### 4.7 Build entrances — `>>> <entrance> [opts]`
133
+
134
+ A bare `>>>` reveals with the default entrance (`fade-up`). Name an entrance right after the sigil, optionally with `delay=`, `dur=` and `ease=` (bare numbers are milliseconds): `- Big reveal >>> zoom-in delay=200 dur=600`. An unknown name warns (`unknown-entrance`) and falls back to the default. A master `animations:` block can define custom entrances too.
135
+
136
+ | Group | Names |
137
+ |---|---|
138
+ | Fades | `fade`, `fade-up`, `fade-down`, `fade-left`, `fade-right`, `blur-in` |
139
+ | Slides | `slide-in-left`, `slide-in-right`, `slide-in-up`, `slide-in-down`, `rise` |
140
+ | Scale | `zoom-in`, `zoom-out`, `pop` |
141
+ | Instant | `none` |
142
+
117
143
  ## 5. Layers
118
144
 
119
145
  Each slide composites **background → content → chrome** by paint order. Backgrounds come from the master (per layout or per slide); content flows through the layout's named slots; chrome sits on top.
@@ -175,3 +201,33 @@ footer: A first deck
175
201
  ```
176
202
 
177
203
  See [themes.md](themes.md) to author a master.
204
+
205
+ ## 10. Diagnostics — what `validate` reports
206
+
207
+ `slaide validate <deck>` prints line-numbered diagnostics; `--strict` makes every warning fail. **Errors** fail regardless of `--strict`; everything else is a **warning** (a real render defect even when the deck "looks valid"). Every code:
208
+
209
+ | Code | Severity | Meaning |
210
+ |---|---|---|
211
+ | `parse-error` | error | The source could not be parsed at all. |
212
+ | `empty-deck` | error | No slides were found. |
213
+ | `no-master` | error | The deck's `master:` could not be resolved. |
214
+ | `unknown-layout` | error | A slide's `layout:` names no layout in the master. |
215
+ | `no-headmatter` | warning | No leading `---` deck headmatter block (e.g. `master:`). |
216
+ | `bad-config` | warning | A headmatter/frontmatter block is not valid YAML (rendered with defaults). |
217
+ | `ambiguous-frontmatter` | warning | A config-shaped **body** was eaten as frontmatter — escape the first line with `\` or add an explicit `---`. |
218
+ | `unknown-transition` | warning | A `transition:` names no built-in transition (§3.1). |
219
+ | `unknown-background` | warning | A `background:` names no master background. |
220
+ | `unknown-variant` | warning | A `variant:` names no master variant. |
221
+ | `unknown-slot` | warning | Content routed to a slot the chosen layout doesn't define (dropped silently). |
222
+ | `unknown-class` | warning | An inline `[x]{.cls}` is not a size / `.bold` / `.muted` / `.grad` / master colour / CSS colour. |
223
+ | `unknown-gradient` | warning | A `.grad-<name>` or slot `fill:` names no master gradient (text gets no fill — often invisible). |
224
+ | `unknown-color` | warning | A slot `color:`/`box:` names no master role/palette or CSS colour (falls back to a literal, often invisible). |
225
+ | `unknown-entrance` | warning | A `>>> <name>` build entrance isn't a known effect (§4.7). |
226
+ | `stray-build` | warning | A `>>>` on a non-list line (headings, bold labels, paragraphs). |
227
+ | `low-contrast` | warning | Resolved text ≈ its background (dark-on-dark / light-on-light) — bind a `variant:` or set an explicit `color:`. |
228
+ | `bad-chart` | warning | An ````echart` option didn't parse — rendered as a plain code block instead. |
229
+ | `bad-animation` | warning | A master `animations:` entry is missing its required keyframes/`hidden` state. |
230
+ | `unknown-token` | warning | A master token reference names nothing. |
231
+ | `token-cycle` | warning | A master token references itself in a cycle. |
232
+ | `non-embeddable-font` | warning | A font won't embed in `.pptx` — PowerPoint will substitute it. |
233
+ | `unknown-placeholder` | warning | A `{{name}}` resolves to nothing (renders empty). |
@@ -47,12 +47,14 @@ colors:
47
47
  accent: "{palette.brand}"
48
48
  layouts:
49
49
  cover:
50
- align: center
51
- areas: ["title", "subtitle"]
50
+ areas: ["title visual", "subtitle visual"]
52
51
  rows: "auto auto"
52
+ cols: "1.1fr 0.9fr"
53
+ gap: "0.5em 3em"
53
54
  slots:
54
55
  title: { type: title, style: { font: display, size: h1, weight: "900" } }
55
56
  subtitle: { type: subtitle, style: { size: h3, color: accent } }
57
+ visual: { type: image, style: { valign: center } }
56
58
  title-content:
57
59
  areas: ["title", "body"]
58
60
  rows: "auto 1fr"
@@ -69,7 +71,7 @@ layouts:
69
71
 
70
72
  ## fonts / typeScale
71
73
 
72
- **Use real Google Fonts only** (`provider: google`) — pick families that actually exist on Google Fonts and embed (avoid **JetBrains Mono**, which doesn't). A `display` (headings) + a `sans` (body) is plenty; add a `mono` role only if the deck shows code. A `provider: system`/`local` font that isn't a common system font (Arial, Calibri, Georgia…) **warns** (`non-embeddable-font`): it won't embed in the `.pptx`, so PowerPoint substitutes it off your machine.
74
+ **Use real Google Fonts only** (`provider: google`) — pick families that actually exist on Google Fonts. A `display` + `sans` is plenty; add `mono` only if the deck shows code. A `provider: system`/`local` font that isn't a common system font (Arial, Calibri, Georgia…) **warns** (`non-embeddable-font`): it won't embed in `.pptx`.
73
75
 
74
76
  ```yaml
75
77
  fonts:
@@ -195,6 +197,7 @@ layouts:
195
197
  | `box` | surface panel (bg + padding + radius) | `true`, a colour role/palette name (preferred), a **named master gradient** (`box: brand` → padded, rounded, gradient hero/closing panel), or a raw hex / CSS colour / gradient |
196
198
  | `bg` | background of the slot region | any CSS colour / gradient (literal) |
197
199
  | `anchor` | absolutely position the slot | `"x% y% w% h%"` of the canvas |
200
+ | `pad` / `opacity` / `radius` / `border` / `rotate` | fine control — padding / opacity / border-radius / border / rotation (also emitted by the importer) | CSS values (`rotate` accepts a bare deg or a full `transform`) |
198
201
 
199
202
  `color:`/`box:`/`fill:` are validated against the master — an unresolved name warns, so `validate` can't call an invisible-text slide valid. Run `slaide slots` for legal names.
200
203
 
@@ -208,8 +211,20 @@ Inline `[text]{.class}` resolves against this master: **colour** = any `palette`
208
211
 
209
212
  ## Tips for AI authors
210
213
 
211
- - Reference **roles** and **scale steps**, not raw hex/px, so a reskin is a palette swap. Add a layout by adding an `areas` map + `slots` — no code.
212
- - **Cards (`box:`) kill hollow tops.** A `box:` is bg + padding + radius only (solid colour — **no gradient/shadow/border**). With no `valign` a card **stretches to its grid row** and pins text to the top hollow in a tall `1fr` row. Two fixes: **`valign: center`** shrinks the card to its content and centres it; or, to keep a row of cards equal height, put them in an **`auto`** row and centre that block with spacer rows (`rows: "auto 1fr auto 1fr"`). On a light ground, tint the card surface off-white vs the page so it reads.
213
- - **Signature, not just tidy:** give the deck one repeated motif (a faint logo-derived shape or a recurring accent panel) and vary composition slide to slide. Make the **cover and closing command** don't leave half the canvas empty: pair a strong text column with a full-height brand/gradient panel or full-bleed motif.
214
- - **Inline `svg` needs a size:** give the `<svg>` explicit `width`/`height`, or a centered zero-size SVG collapses and vanishes.
215
- - **A deck about slaide itself?** Use the shipped brand in the sibling `slaide-hugo` repo (`themes/slaide/assets/css/slaide.css` `:root`; `static/images/slaide-*.svg`): slate-azure gradient `#243B6B→#3E6FB0→#6FA8DC` on cream `#FBF7F0` / ink `#15120E`; IBM Plex Sans + JetBrains Mono + Fraunces.
214
+ - Use **roles** and **scale steps**, not raw hex/px reskin = palette swap.
215
+ - **Chrome `logo:` is opt-in.** Only add it when the user supplies a real brand logo. Do NOT invent a generic icon/monogram — a tiny aimless mark in the corner of every slide is the #1 amateur tell.
216
+ - **Cards (`box:`):** bg + padding + radius only (no gradient/shadow/border). Without `valign` a card stretches full-height and pins text top (hollow). Fix: `valign: center` to shrink-wrap, or put cards in an `auto` row with `1fr` spacers. Tint card surface off-white vs the page.
217
+ - **Cover = dramatic hero.** Visual slot FILLS bold brand SVG, product mock, or illustrated motif at ≥ half the slide, not a small icon. Think Apple keynote: few bold shapes at large scale. Centred text on a gradient is a section divider, not a cover. Never `.grad` text on a gradient bg (vanishes). **Closing** = bold CTA or contact slide (name/role/email/URL for pitch/agency decks). Both must feel intentional.
218
+ - **Brand ground dominates.** Most slides use the brand's background role (warm cream, tinted neutral not generic white). Dark/gradient = accent moments only (cover, one stat, closing).
219
+ - **No text-only slides — no exceptions.** Every content slide needs a visual: ` ```echart ` for data, inline ` ```svg ` for diagrams/mockups (preferred — precise, brand-styled), `box:` cards, or a stat callout. A comparison/pro-con slide is NOT exempt: use cards, a table, or SVG icons. Mix visual types across the deck — all-SVG or all-cards = monotone.
220
+ - **Vary composition.** Never repeat the same layout archetype — two text+visual slides need structurally different layouts (not image-left twice). Mix archetypes, alternate dark/light grounds. One slide should break the pattern — oversized `.grad` stat, serif quote owning the canvas, or full-bleed visual.
221
+ - **One idea per slide.** Each slide delivers one clear message (4 bullets max). The visual and text reinforce the SAME idea — if the visual still communicates without the text, that's right.
222
+ - **Size contrast.** Pair `hero`/`stat` scale with body text. At least one slide MUST feature a single big number or statement using `.huge` or `.stat` — the audience remembers ONE number from every deck. No decorative accent lines under titles (AI tell).
223
+ - **Use every font role** defined in the master (serif, display, mono).
224
+ - **Whitespace.** `--slide-padding` ≥ 96px, `gap` ≥ 2em. `auto` rows for content, `1fr` spacers to centre. Cards need `pad`.
225
+ - **Avoid `<a>` links in slides.** They aren't clickable during presentations and their `link` role color can override slot `color:`. Write URLs as plain text; style with `[text]{.class}` spans.
226
+ - **Muted text must read at projection scale.** Keep well above 2.5:1 contrast. Never use light-ground `muted` inside a dark `box:`/`bg:` card — set explicit light `color:` instead.
227
+ - **Inline SVG:** explicit `width`/`height` required (collapses without them). Images fill their container (the layout controls sizing via grid areas + padding).
228
+ - **Academic / teaching decks** (symposia, lectures, workshops): clarity over flash. Favour ` ```svg ` / ` ```mermaid ` diagrams for processes and systems, ` ```echart ` for data/results. Use `>>>` heavily for progressive build. Larger body text (≥ h3). Section dividers between topics. End with summary/takeaways/questions, not a sales CTA. High-contrast, clean backgrounds.
229
+ - **Financial / board reports**: data credibility first. Heavy ` ```echart ` (bar, line, waterfall, pie). Stats use `.huge` with exact numbers. Comparison tables via `box:` card grids (Plan vs Actual). Conservative palette — dark text on light ground, accent on KPI highlights only. Section dividers per business unit or period. Cover = clean title + period, not a hero. End with outlook/risks.
230
+ - **A deck about slaide?** Brand from `slaide-hugo` repo: azure `#243B6B→#3E6FB0→#6FA8DC`, cream `#FBF7F0`, ink `#15120E`; IBM Plex Sans + JetBrains Mono + Fraunces.