Repository navigation
Description
Found by porting a real-world template end to end (#292; epic #261, phase 4). The template matched the original in pages, words and fonts through a Stirling-PDF (LibreOffice) PDF path.
F2 — Cell and table geometry: per-side borders, per-side padding · significant
Missing today: a border on one cell or on one side of a cell; a rule only above or only below a table; different
padding per side for a cell, a table style or a box.
Where the port needed it:
- a status cell whose frame has its own colour inside a strip of neutral cells — not possible;
- "a record that belongs to the one above": stepped in, with a rule down its left edge — done with a 0.75 pt column
that has a background, plus an empty spacer column; - a list table that opens with a rule on top — done with a
Ruleblock before the table; - padding of 8 / 9 pt and 6 / 7 pt, and a box with less padding at the bottom than on top — only symmetric values.
cell.Border(Sides.Left, 0.75.Pt(), theme.Line); // one side of one cell
cell.Border(Sides.All, 1.Pt(), tone.Line); // a frame of its own
cell.Padding(top: 8.Pt(), right: 6.Pt(), bottom: 9.Pt(), left: 6.Pt());
s.Table(Marked, g => g.TopRule(0.75.Pt(), line).RowRule(0.5.Pt(), hairline));
s.Box(Panel, b => b.Padding(top: 12.Pt(), right: 12.Pt(), bottom: 6.Pt(), left: 12.Pt()));
table.Indent(6.Mm()); // a stepped-in tableVertical merge, text direction and row height belong to the same group; this template did not need them.
F3 — No paragraph-level formatting and no spacer block · significant
Every deviation from a style is a style of its own. In the port 17 of 37 paragraph styles exist only for that: five
gap styles (a gap is an empty paragraph), "kept with next" copies of two styles, copies with 3 / 5 / 7 pt above or
below, two styles for lines that hold an image. A user who opens the template sees a style list almost twice as long
as the design has.
c.Spacer(14.Pt()); // no style needed
c.Paragraph(Styles.TableValue, x => …, p => p.KeepWithNext());
c.Paragraph(Styles.TableLabel, text, p => p.SpaceBefore(7.Pt()));
table.SpaceBefore(17.Pt()); // today only SpaceAfterIf "named styles only" stays the policy, Spacer(height) and KeepWithNext on a paragraph alone would remove most of
the variants.
F8 — A rule is always as wide as the frame; styles have no borders · cosmetic
A short rule (12 mm under a title) is a table with one filled cell in the port. The rules of the running head and foot
are Rule blocks, which works well.
c.Rule(1.5.Pt(), ink).Width(12.Mm()).SpaceBelow(14.Pt());
s.Paragraph(RunHead, p => p.BorderBottom(0.75.Pt(), line, space: 3.Pt()));F13 — Spacer paragraphs stack · cosmetic
After filling, a box that ends with conditionals ends with two or three "Template Spacer" paragraphs in a row, one per
reason (after a table, at the end of the inner cell, at the end of the outer cell). Each is 1 pt, so a box grows by
2–4 pt. One per position would do.
Activity
docs(builder): design and plan for the formatting gaps (#296)
feat(builder): paragraph layout options (#296)
feat(builder): spacer block (#296)
feat(builder): short rule and paragraph-style bottom border (#296)
feat(builder): per-side padding for cells, tables and boxes (#296)
feat(builder): per-side borders for cells and table styles (#296)
feat(builder): table indent and space before (#296)
fix(builder): one spacer paragraph per position (#296)
feat(builder): sample uses a cell's own border and paragraph options (#…
docs(builder): formatting options (#296)
fix(builder): final review of the formatting gaps (#296)
vaceslav commentedon Dec 1, 2026
Done on
feature/builder(e4e4036..e32e67d). Design:docs/superpowers/specs/2026-12-01-builder-formatting-gaps-design.md.Built
Paragraph(style, text | value | content, p => p.SpaceBefore(…).SpaceAfter(…).KeepWithNext().KeepLinesTogether()). They are written as the paragraph's own properties on top of its named style; text formatting, alignment and indents stay style-only. The builder design's rule 2.3 is amended.Spacer(height): an empty paragraph of exact height, up to 72 pt. JSON form:{"spacer": "14pt"}.Rule(…, width): a short rule; a rule wider than its container is TB7002.BorderBottom(width, color, space)on a paragraph style, with space from 0 to 31 pt.CellPadding(top, right, bottom, left), boxPadding(…)and a cell's ownPadding(…). JSON padding takes one to four values.Sides,OuterBorder(Sides.Top, …)on a table style, and a cell's ownBorder(sides, …). In JSON, a line or{top, right, bottom, left}.table.Indent(…)andtable.SpaceBefore(…).Notes
tblInd= indent + the left cell margin. The builder writes no compatibility mode, and in that layout LibreOffice and Word measuretblIndto the first cell's text. A LibreOffice round trip shows the same 17 pt shift in both formats.Deferred minors (from the final review)
tblInduses the table style's left padding, not a first cell's own padding.pStyle.Open edge: a cell whose only content is a table inside a conditional gets two spacers (1 pt extra) when the branch is kept.
vaceslav commentedon Dec 2, 2026
Done on feature/builder, merged to main in #316 and released in builder 0.1.0.