Scaffolding
The static HTML inside a Layout or Flow that doesn't change as content flows through it.
Scaffolding is the part of a document's structure that repeats across pages while its content flows through it as pages fill. This includes elements such as headers, footers, decorative wrappers, or a <table> that holds streaming rows.
How scaffolding repeats
Both Layouts and Flows carry scaffolding, and each repeats on its own condition.
Layout scaffolding renders on every page the Layout produces. When Format opens a new page, the Layout's scaffolding renders again, identically. This includes Frames: a <div data-type="frame"> (or other block element) is another piece of scaffolding inside the Layout. The difference from a header or footer is that Format measures the Frame's bounds, so a Flow inside it has a constrained region. A Frame renders on every page the Layout produces, even after the Flows inside have run out of items.
A Flow's scaffolding is everything inside the Flow that is not its Stream. It renders only on pages where the Flow has items to place; once its stream runs out, the Flow stops appearing, even when the Layout above continues rendering pages with other Flows' content. So a <thead> inside a Flow's scaffolding renders only on pages where the Flow has content.
Nested Flows carry scaffolding too, and it repeats each time the content reaches a new page. When a nested Flow's content splits across pages, its scaffolding reprints on each page the split spans, so each page is a self-contained, valid render of that Flow.
The Stream itself carries no scaffolding. It's a marker that pinpoints where the items land, not an HTML container.
A worked example
The <table>, <thead>, <tbody>, and <tfoot> are all scaffolding. Only the <tr> rows inside the Stream paginate. When rows overflow the page, Format opens a new page, reprints the whole scaffolding shell with its own <table>, <thead> row, and <tfoot> row, then continues placing rows at the Stream.
A bare Flow has no Stream, so all of its children are the stream and none of it repeats as scaffolding. Add a Stream only when markup must wrap the items and reprint on every page.
Nested-flow panels
Place a Flow inside another Flow's stream when a block of repeating content sits within the outer stream, such as a per-client panel whose heading repeats while its rows flow. The inner Flow carries scaffolding of its own:
The <section class="panel"> and its <h2> are the nested Flow's scaffolding. They reprint on every page the panel's content reaches, while the findings inside the Stream flow.
Varying across pages
The scaffolding HTML is the same on every page where its containing type renders. To vary appearance across pages, use CSS in the Layout to target specific pages: hide a footer on the last page, restyle a header on the first, adjust margins by page number, and so on. The scaffolding HTML stays unchanged; only its presentation varies.
When the content itself needs to be different (a totals row with computed values on the last page, or a cover page with a different layout), that's a structural change rather than a visual one, and it needs a separate Layout with its own design.
Where to place scaffolding
Where a block of repeating markup belongs depends on how often it should appear:
| To appear... | Put it in… |
|---|---|
| On every page the Layout produces, in the Layout's general space | Layout scaffolding (outside any Frame or Flow) |
| On every page the Layout produces, constrained to a measured sub-region | Inside a Frame, around the Flow |
| On every page the Flow produces, above the items | Flow scaffolding, before the Stream (e.g. a <thead>) |
| On every page the Flow produces, below the items | Flow scaffolding, after the Stream (e.g. a <tfoot>) |
| Around a repeating block inside another stream | A nested Flow's scaffolding (around its Stream) |