# Exports

A story has no PDF: it leaves the browser as **images**, one per card, and as a **film**, the same
cards played by the blocks of motion. Both come from the same Markdown file as the player.

## One image per card

`recit export --to images` captures each card at rest, without the controls, at the scale of the
story (`3` by default: `1080×1920` for a `360×640` card). With `--all-locales` it writes one folder
per language.

```bash
npx recit export launch.md --to images --all-locales
```

```text
out/launch/
├── en/01-hook.png … en/06-cta.png
├── fr/01-hook.png … fr/06-cta.png
└── exports.json
```

`exports.json` lists every file with its size and the `id` of its card. `--image-format` (`png`,
`jpeg`, `webp`), `--scale` and `--cards` override the story's `images:` settings, which override the
`webstory.images` section of `recit.config`.

`--preset` names the pictures of a social network instead of a scale: one folder per preset, each
picture at its size, and the preset written beside each file in `exports.json`. A preset fits the
story's ratio: `instagram-story` and `tiktok` a `9:16` story, `instagram-post` a `4:5` one, `square`
and `linkedin-post` a `1:1` one; another is refused with the `aspectRatio` to set.

For a preset whose app draws over the picture (`instagram-story`, `tiktok`), the export measures
each card before the capture: a text or a call to action that crosses a covered margin is a warning
on the console and in the `warnings` of its file in `exports.json`, with the sides in pixels of the
preset. `recit dev` shows the same margins over the card (the **Safe area** button, or the key G).

```bash
npx recit export launch.md --to images --preset instagram-story,tiktok
```

```text
out/launch/
├── instagram-story/01-hook.png … instagram-story/06-cta.png
├── tiktok/01-hook.png … tiktok/06-cta.png
└── exports.json
```

## A vertical film

`recit render` plays the story as a 9:16 film: a card with a `type` is played by its block, a card
of text by the block its content fits (a title, a list, a statement), a background image by a
`panel`. A card's `dur` is its time on screen.

```bash
npx recit render launch.md -o out/
```

What a film cannot show is a warning, never a silent loss: a call to action, a color under a block.
A video background becomes a `panel` shot that plays the video, muted, for the card's duration. `-o`
(`--output`) takes a `.mp4` file or a folder, `out/` by default.

## From a film back to a story

The other way has no command: `motionToWebstory` of `@recit/webstory/bridge` turns a 9:16 film back
into a story, each shot becoming a card with the same `type`, `props`, `dur`, `hold` and `accent`,
its `voiceover` becoming `notes`. A film of another aspect is refused with an error, never cropped.

```ts
import { motionToWebstory } from "@recit/webstory/bridge";

const { webstory, diagnostics } = motionToWebstory(film);
if (webstory) await writeFile("launch.json", JSON.stringify(webstory, null, 2));
```

`film` is the typed source of a `format: motion` story (its twin, `kind: "story"`), and `webstory`
the twin of the story; `recit convert launch.json --to md` writes its Markdown.
`recit convert --to webstory` reads only a calendar or a report.

The details are on [docs.recit.dev](https://docs.recit.dev/formats/webstory/overview).
