# Deck grammar

How a slide is written as data, with the slide kinds, the layouts and the block types an agent writes.

A slide is a kind, a layout and typed blocks in named slots, on a sheet of 1600 by 900 pixels. An agent writes the document, not the pixels: there are no coordinates except on the freeform layout. The validator refuses a slide that breaks the schema, and the grammar linter reports the rules a slide breaks.

## Slide kinds

| Kind        | Name           | What it is                                                                                                                                                                                                                                                         |
| ----------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `content`   | Content        | A layout with typed blocks in its slots.                                                                                                                                                                                                                           |
| `opener`    | Section opener | The plate lower left at 740 px: the section title and one sentence listing the section’s slide families in order; in General Translation over a full-bleed two-tone picture with its credit, in another theme on the theme’s ground (the empty picture reference). |
| `mood`      | Mood           | A full-bleed dithered photograph with the plate lower right at 560 px: the picture’s title at 44 px, one or two sentences on why it is in the deck, the credit. A mood slide follows a dense content slide and never sits directly before an opener.               |
| `closing`   | Closing        | The deck closes as it opens: a plate upper left at 720 px carrying the kit’s logo, the thesis and the three domains; in General Translation over a two-tone render, in another theme on the theme’s ground (the empty picture reference).                          |
| `title`     | Title          | The mark at 132 by 84, the h1 and a muted lead, left and vertically centered.                                                                                                                                                                                      |
| `statement` | Statement      | One centered big line at 72 px with a measure in ch.                                                                                                                                                                                                               |

## Layouts

| Layout     | Name                      | What it is                                                                                                                                                                      |
| ---------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cols`     | Columns                   | Two columns at 5/7 (522.5 and 731.5 px), 4/8 (418 and 836), 1/1 (627 and 627) or one fixed column, 72 px gap, centered.                                                         |
| `split`    | Head over body            | A head above a body with a 56 px gap; the head is single or two columns, the body fills and aligns its content.                                                                 |
| `center`   | Center                    | One centered block.                                                                                                                                                             |
| `left-mid` | Left, vertically centered | One block at the left, vertically centered.                                                                                                                                     |
| `stack`    | Stack                     | A vertical flex column with a 22 px gap.                                                                                                                                        |
| `freeform` | Freeform                  | Every block carries pos, its box on the 1600 by 900 sheet, snapped to the 8 px grid, the rails, the plate edges and the column seams; flagged by layout/freeform at severity 1. |

## Blocks

### Text

| Type        | Name       | What it is                                                                                                     |
| ----------- | ---------- | -------------------------------------------------------------------------------------------------------------- |
| `heading`   | Heading    | A display line at h1 88 px, h2 44 px, big 72 px or the mood plate title 44 px, weight 500, no trailing period. |
| `paragraph` | Paragraph  | Body copy at 22 px on 1.5, lead 26 px, cap 15 px titanium; measure caps at 32ch or 56ch.                       |
| `credit`    | Credit     | The 15 px titanium credit line on a plate; required when the picture is share-alike.                           |
| `panel`     | Code panel | Code on the #101010 panel in white monospace at 17 or 15 px on 1.7; the one string where \n is honored.        |

### Ruled lists

| Type    | Name                 | What it is                                                                                                                                                                                               |
| ------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `rows`  | Ruled rows           | A ruled key and value table at 20 px; the key column snaps to the deck set, values run two lines at most.                                                                                                |
| `plain` | Ruled statement list | Statements as ruled rows at 24 px display weight 500, never bullets; a struck row is excluded.                                                                                                           |
| `refs`  | References           | A two-column reference list at 20 px with soft rules.                                                                                                                                                    |
| `say`   | Two registers        | Two quoted registers side by side at 34 px display, each with a 15 px note; a struck quote is the rejected register.                                                                                     |
| `board` | Status board         | One ruled row per surface: a 128 by 72 capture, the name and address, the state with its icon, a note.                                                                                                   |
| `table` | Table                | A grid of Text cells in the .rows idiom: a hairline above, a rule under every row, the header row at display weight 500 with an ink rule, tabular numerals, text alignment per column; at most 20 by 20. |

### Figures

| Type         | Name             | What it is                                                                                                                                                                                                                                           |
| ------------ | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `shot`       | Screenshot       | One bordered capture with a light and dark twin and an optional caption at 16 or 15 px.                                                                                                                                                              |
| `pair`       | Pair             | Two figures side by side with captions; equal gaps are a lint.                                                                                                                                                                                       |
| `tiles`      | Tile grid        | A grid of 4 to 6 captured tiles at one aspect with 15 or 20 px labels and an optional closing line.                                                                                                                                                  |
| `details`    | Detail grid      | Three 425 px columns of 2x crops with 15 px captions; row heights are set per row.                                                                                                                                                                   |
| `composite`  | Composite figure | A declared grid of cells holding blocks; M5 retires the last html escapes with it.                                                                                                                                                                   |
| `logoPlates` | Logo plates      | Fixed-white 150 by 90 plates for external logos with 15 px names; the one sanctioned fixed color outside swatches and the panel.                                                                                                                     |
| `material`   | Material         | A shader material as a recipe (catalog id, preset, uniforms, frame anchor, two-tone, plate); material.capture freezes it into a frame asset the block shows, and the editor mounts the live shader over it.                                          |
| `picture`    | Picture          | A photograph as an object on a canvas slide, drawn at object-fit cover with the theme’s twins or the material’s shader at its box; the converted photograph of a picture slide, or the picture Change background inserts at the bottom of the stack. |

### Diagrams

| Type     | Name        | What it is                                                                                                                                                                |
| -------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `scales` | Scales      | Slider rows: a 150 px label, a hairline track with an 11 px square marker, a 150 px label; the marker is derived from the value.                                          |
| `dia`    | Diagram     | An inline SVG with 1 or 1.5 px strokes in ink, mid or hair, fills only ink, paper or plate, 11 px markers, labels 12 px clear of lines.                                   |
| `dither` | Dither ramp | The live 220 px ramp canvas drawn with the 8 by 8 Bayer screen from ink to paper.                                                                                         |
| `matrix` | Matrix      | A ruled table of numerals at 22 px tabular, the 4 by 4 Bayer threshold matrix.                                                                                            |
| `chart`  | Chart       | A bar, column, line or pie chart from categories and series, drawn in the diagram grammar with 1 px ink axes and palette series colours; a native chart in Editable text. |

### Specimens

| Type       | Name          | What it is                                                                                                             |
| ---------- | ------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `spec`     | Type specimen | Inter at 58 px in the listed weights with a 90 px weight column; the one place weight passes 500.                      |
| `lang`     | Scripts       | A two-column multilingual grid at 34 px with 14 px script labels; CJK, Arabic and Indic rows take their system stacks. |
| `ladder`   | Type ladder   | One sample line per size with a right-aligned 14 px label in a 200 or 320 px column.                                   |
| `swatches` | Swatches      | Five color plates at 190 px with a 20 px name and a 15 px value; the fixed plate colors are a sanctioned exception.    |

### The mark

| Type        | Name       | What it is                                                                                |
| ----------- | ---------- | ----------------------------------------------------------------------------------------- |
| `mark`      | Mark       | The standalone GT mark at a stated size; the symbol is 1213 by 771.                       |
| `markSizes` | Mark sizes | The compression specimen: the mark at 16, 32, 64, 128 and 256 px over ruled 16 px labels. |

### Primitives

| Type    | Name     | What it is                                                                                                                                                                                                                                                                                            |
| ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `box`   | Box      | A bordered box with an optional text inside: fill, stroke and text color from the palette, a corner radius and padding; a hairline outline unless set.                                                                                                                                                |
| `shape` | Shape    | One of the 135 shape presets (Shapes, Arrows, Callouts, Equation) or a line kind (line, arrow, elbow connector, curved connector, curve, polyline, scribble) filling its box, with palette fill and stroke, a stroke width, a dash, a text inside a closed shape, adjust values and line decorations. |
| `rule`  | Rule     | A horizontal or vertical hairline in a palette color at 1, 1.5 or 2 px; the slot width in a flow layout, its box on a freeform slide.                                                                                                                                                                 |
| `text`  | Text box | One Text in the four-rule markup with typography (size, weight, align, tracking, leading) and a palette color over the body defaults of 22 px on 1.5.                                                                                                                                                 |
| `icon`  | Icon     | One sprite glyph on its own at 16 to 96 px in a palette color; the semantic hues stay on icons (DECK-GRAMMAR.md:30, 40).                                                                                                                                                                              |

### Escape

| Type   | Name        | What it is                                                                         |
| ------ | ----------- | ---------------------------------------------------------------------------------- |
| `html` | HTML escape | Scoped CSS and HTML the grammar cannot express; flagged by lint, raster on export. |

The full grammar, with every field of every block and every lint rule, is in [/llms-full.txt](/llms-full.txt).
