# Bridges

A **bridge** takes a story written for one format and tells it in another. Some bridges are a single
line, `format:` in the front matter; the others are a command, `recit convert … --to …`. Récit only
promises a bridge whose mapping is **closed**: every part of the source has one place in the target,
written in a table. What the table does not cover is an **error with its file and its line**, never
a guess, a summary or a silent drop.

## The bridges

| From → to           | How                                                                                       | Mapping                                                                    | Status                             |
| ------------------- | ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ---------------------------------- |
| deck → motion       | `format: motion` in the front matter                                                      | layouts → animated blocks, one slide → one shot                            | <StatusBadge status="available" /> |
| report → deck       | `recit convert report.md --to deck`                                                       | one section → one slide, charts and tables kept                            | <StatusBadge status="available" /> |
| bible → deck        | `recit convert cast.md --to deck`                                                         | each character, set, style or beat template → a slide, traits in the notes | <StatusBadge status="preview" />   |
| bible → book        | `recit convert cast.md --to book`                                                         | the characters → one "Dramatis personae" chapter, name and summary         | <StatusBadge status="preview" />   |
| webtoon → motion    | [`webtoonToFilm`](/formats/webtoon/overview#bridges) of `@recit/webtoon/bridge`           | one panel → one `9:16` shot with a vertical pan                            | <StatusBadge status="available" /> |
| book → docs         | [the entry of a book in a site](/formats/book/overview#bridges)                           | one chapter → one page, table of contents → sidebar                        | <StatusBadge status="preview" />   |
| roadmap → calendar  | `include:` of a roadmap in a calendar                                                     | each dated milestone or item → an event                                    | <StatusBadge status="available" /> |
| calendar → webstory | `recit convert cal.md --to webstory`                                                      | the upcoming events → an "upcoming" story                                  | <StatusBadge status="available" /> |
| calendar → atlas    | `recit convert cal.md --to atlas`                                                         | each event with a `geo` → a view of the map                                | <StatusBadge status="preview" />   |
| webstory ⇄ motion   | [`webstoryToFilm`](/formats/webstory/overview#bridges) of `@recit/webstory/bridge`        | one card → one `9:16`, `4:5` or `1:1` shot, same animated blocks           | <StatusBadge status="available" /> |
| report → webstory   | `recit convert report.md --to webstory`                                                   | each KPI or chart → a card                                                 | <StatusBadge status="available" /> |
| form → report       | `recit convert survey.md --to report`                                                     | the prose steps → sections, every field → one printable form               | <StatusBadge status="preview" />   |
| webstory → webtoon  | `recit convert story.md --to webtoon`                                                     | one card → one panel, its text → captions stacked at the top               | <StatusBadge status="preview" />   |
| Fountain ⇄ webtoon  | [`recit convert script.fountain`](/documentation/scenario/bible#a-screenplay-in-fountain) | a scene heading or a shot → a panel, a dialogue → a stacked bubble         | <StatusBadge status="preview" />   |
| → PDF               | `recit export --to pdf`                                                                   | the formats of the closed print list, one print chain                      | <StatusBadge status="available" /> |
| deck → PowerPoint   | `recit export --to pptx` (`@recit/pptx`)                                                  | measured slides → editable `.pptx` text, shapes, charts, notes             | <StatusBadge status="preview" />   |

The formats added since have their own bridges, listed on their page:
[atlas](/formats/atlas/overview#bridges) (to a deck, a film or a web story, and from a calendar),
[directory](/formats/directory/overview) and [glossary](/formats/glossary/overview).

Every bridge marked available or preview has a conversion test and a test of the case it refuses. A
bridge marked planned does not exist yet: asking for it is refused, it is never approximated.

## Who owns a bridge

The source format owns its outgoing bridges: `reportToDeck` is in `@recit/report`, `atlasToFilm` in
`@recit/atlas`. The exception is a bridge that would make the source depend on its target. Three
bridges are owned by their target for that reason, each one tested:

| Bridge              | Owned by                                         | Why                                                 |
| ------------------- | ------------------------------------------------ | --------------------------------------------------- |
| roadmap → calendar  | `roadmapCalendarEvents` of `@recit/calendar`     | the roadmap would depend on the calendar it feeds   |
| calendar → webstory | `calendarToWebstory` of `@recit/webstory/bridge` | the calendar would depend on the webstory format    |
| calendar → atlas    | `calendarToAtlas` of `@recit/atlas/bridge`       | the calendar would depend on the atlas and its maps |

Each one reads only the fields of the source model it needs, so the dependency goes one way.

`calendarToAtlas` is the exception written down on purpose: it stays in `@recit/atlas/bridge`, and
the calendar model it reads, `Calendar`, `CalendarEvent` and `Occurrence`, lives in
`@recit/time/calendar` (re-exported by `@recit/calendar`), so `@recit/atlas` depends on
`@recit/time` and never on `@recit/calendar`. The same goes for `calendarToWebstory` in
`@recit/webstory/bridge`. The [webstory](/formats/webstory/overview#bridges),
[calendar](/formats/calendar/overview#bridges) and [roadmap](/formats/roadmap/overview#bridges)
pages show them.

## Deck → motion, the bridge of 1.0

A deck becomes a film by one line. The source stays the same, scenes keep their `id`, and the
layouts map to the blocks of the motion format:

```md
---
title: Lorem ipsum
format: motion
---

--- id=open layout=cover

# Dolor sit amet.

--- id=chapter layout=section

## Consectetur adipiscing
```

| Deck layout | Motion block |
| ----------- | ------------ |
| `cover`     | `title`      |
| `section`   | `chapter`    |
| `quote`     | `statement`  |
| a list      | `list`       |

The whole table, with the shapes each block accepts, is on the
[motion page](/formats/motion/overview). A deck written for slides plays as a film when its scenes
keep to that table. When one does not, the film is refused, and the message names every scene that
has no block, at its line:

```text
slides.md:42: layout "grid" has no motion block
```

This bridge and the `./bridge` subpaths of the formats in the 1.0 contract (`report`, `webtoon`,
`calendar`, `roadmap`, `directory`, `webstory`) are part of Récit 1.0 (see
[Stability](/documentation/reference/stability)). A bridge whose source or target stays outside 1.0
(`docs`, `atlas`, `@recit/pptx`) joins the contract with that package, in a 1.x minor.

## A story outside every bridge

Asking for a target no bridge reaches is an error too, before anything is written:

```text
$ recit convert slides.md --to deck
slides.md is a deck story: only a report converts to a deck (--to deck).
```

`recit convert` without `--to` keeps the format and switches between the Markdown and its
[JSON twin](/documentation/reference/cli#json-and-languages), which is not a bridge: the story stays
the same, only its notation changes.
