Variants and signature
Goal: write one Markdown story and a data table, draw a partner signature on every card or slide, validate that every placeholder resolves, and export one PDF or image set per row.
When a tour visits ten cities or a campaign ships with several local partners, copying a .md file
per venue quickly drifts out of sync. Récit lets you keep a single story source, pull per-row values
from a variants: table into {{…}} placeholders, and stamp a brand: signature on each rendered
card or slide.
The complete working files for this guide live in examples/ (places.csv,
places.md, and places-).
1. Create the variants table
Create a .csv, .json, or .yaml file next to your story, one row per variant. An id column
names each row: Récit uses it to select a variant during preview and to name the exported files.
Without one, a row is named by its number (1, 2…); two rows with the same id are an error.
Code
2. Reference variants: and write {{…}} placeholders
Point variants: in the story's front matter to your data file (resolved relative to the .md
file), then reference any column name with {{column}} inside headings, body text, directive
attributes, or front matter fields.
Here is examples/:
Markdown
To display literal double braces in your text without substituting a variable, escape the opening
braces with a backslash: \{{city}} renders as {{city}}.
The exact same variants: table and brand: block also work in a deck
(places-, without format:, so Récit treats it as a deck), as
well as in a JSON twin (settings. and settings. of kind:).
3. Configure the brand signature
brand draws a compact signature (logo, mention, or both) on the story's visual surfaces. You
can set it once for an entire project in
recit. or per story in the front
matter (settings. in the JSON twin), each layer overriding the previous one key by key, and
use {{…}} placeholders from the variant row inside its fields:
YAML
- Keys:
logo(a path relative to the story or project, or anhttp(s)URL to an SVG, PNG, JPEG or WebP image),mention(short attribution line, which may contain{{…}}variables),position(top-left,top-right,bottom-left, orbottom-right, the default),inFilm(boolean,falseby default), andcolor(the background colour of the film's signature badge; the text is black or white, whichever contrasts more; without it the badge stays dark). - Where it draws: automatically on web story cards (above
::ctawhen both sit at the bottom) and on deck slides (on screen, in the presenter view, in print/PDF, and when published in a site through@recit/). In a motion film, the signature is omitted by default and drawn on every shot whensite- stories inFilm: true(recit buildand image exports copy a locallogo, whilerecit renderembeds it as adata:URI in the film). A missing locallogois an error at its line. - Empty signature: when neither
logonormentionis set (or when both resolve to an empty string), Récit renders nothing and reserves no space on the card, slide or shot.
4. Preview or build one variant
Pass --variant <id> to recit dev while authoring, or to recit build when publishing a static
bundle for one row of the table:
Bash
In recit dev --, Récit materializes the selected row across the story's language files
and reloads whenever either the story or its variants: file changes, cleaning up temporary files
on exit.
5. Export every variant at once
Pass --variants to recit export with --to pdf or --to images
to render one output per row in variants: (combinable with --locale or --all-):
Bash
When -o points to a directory, Récit names each PDF <stem>. (or one subfolder per
row for --to images) and writes an exports.json manifest recording each file's variant and its
original source. When -o contains {variant}, Récit substitutes each row's id into the path.
6. Check the stories
Run recit validate on both stories:
Bash
recit validate checks the variants: file (variants- on an unreadable file or duplicate
id), substitutes every row across Markdown, MDX and JSON twins, and refuses any {{variable}}
placeholder that has no value in a row — naming the variant and line (variable-) — or any
{{variable}} in a story without variants:. When it prints 0 errors and 0 warnings, every
variant and its signature are ready to export.