# One source

A chapter is written once. The book renders it a single time into an intermediate HTML where
numbers, cross-references and notes are already resolved; only its serialisation changes with the
output.

| Output | What the chapter becomes                                                                                               |
| ------ | ---------------------------------------------------------------------------------------------------------------------- |
| Web    | One page per chapter, notes at its end with a link back to each call, the table of contents as the sidebar.            |
| EPUB 3 | One XHTML file per chapter, notes as `aside epub:type="footnote"`, the table of contents in `nav.xhtml`.               |
| PDF    | The printable view of the print chain ([plan 15](https://plans.recit.dev/15-export-pdf)): named pages, running heads, page numbers. |

## The web edition

The third chapter of the novella, as the web edition shows it; the first is on the
[home page](/book).

<StoryEmbed slug="book/novella" format="book" chapter="dolor" />

## The source

The entry of the book lists its chapters in reading order; each chapter is a Markdown file beside
it.

<SourceFile deck="book/novella" title="examples/book-novella/book.md" />

## The EPUB

```bash
npx recit export --to epub examples/book-novella/book.md
npx recit export --to epub examples/book-novella/book.md --locale fr
```

Each command writes one EPUB per language and lists it in the `exports.json` beside the book, with
its size and its SHA-256. Two exports of the same book give the same bytes.

On the site, the "Downloads" panel under the first page of [the novella](/book/novella) and of
[the handbook](/book/handbook) offers each book's EPUB and PDF, written by the same export after the
build.

Opened, the EPUB of the novella holds the same chapters as the web edition, one XHTML file each,
beside its cover and its table of contents:

```text
book.en.epub
├── mimetype                  application/epub+zip, first and uncompressed
├── META-INF/container.xml    points to the package document
└── OEBPS/
    ├── content.opf           title, author, language, the manifest and the reading order
    ├── nav.xhtml             the table of contents and the landmarks
    ├── cover.xhtml           the cover, images/cover.svg
    ├── styles.css
    ├── preface.xhtml, lorem.xhtml, ipsum.xhtml, dolor.xhtml
    └── images/
```

## The JSON twin

Every file of a book has a typed JSON twin, checked by the schema of the format:

```bash
npx recit convert book.md --to json --chapters
```

writes `book.json` to the standard output and `01-lorem.json`, `02-ipsum.json`… next to their
chapters. The book assembled from the JSON files is the same book, page for page.
