3.2 Incremental pagination
Each block measures into a flow of fragments plus the places a page may end. After an edit, unchanged blocks keep their measured flows, pagination resumes at the first page the edit can reach, and stops as soon as a new page starts where an old one did.
A keystroke in a book of several thousand pages therefore touches one or two pages. Unchanged pages are returned as the same objects, so a renderer skips them by identity.
Every rule below is data on a break, so the paginator stays one linear walk and host block types inherit pagination by returning a flow.
Table 3.1 Pagination rules, expressed as breaks
| Rule | Expressed as | Penalty |
|---|---|---|
| Line boundary | break | 0 |
| Widows, orphans | break | 1 |
| keepWithNext | boundary | 1 |
| keepLinesTogether | every line | 1 |
break · penalty 0