Catalog

Packable golden examples for authoring: one ex_*.json file per construct. They live under skills/k2f/catalog/ in the repo (with the starter package and agent scripts). Copy child nodes into your package — do not ship the catalog folder as a deliverable.

How to use

  1. Create or open a package (Getting started).
  2. Edit content/root.json. Keep id: "root" and document flow (omit layout or use a vertical stack only on root).
  3. Paste catalog node(s) into children. Do not replace root.json with a grid, overlay, columns, or horizontal-stack fragment — compile fails (root is not document flow).
  4. Match Allowed keys and schema/; relock with k2f pack.

Topic walkthroughs: Text · Images · Tables · Layout · Theme and fonts.

The catalog tree’s own content/root.json shows { "include": "content/…" } stubs for a multi-file document. When you paste a single example, only that child node matters.

Theme and fonts

The current package styles/theme.json must define every role, modifier type, and font the copied nodes use.

LabelMeaning
starterWorks with starter/styles/theme.json as shipped.
catalogAlso needs roles, variants, or primitives from catalog/styles/theme.json (for example ex_glass.json).

Extra setup:

  • ex_math.json — add NotoSansMath-Regular.ttf from catalog/assets/fonts/, register font_aliases, set the math role’s font_family.
  • Serif headings or body — --add-font catalog/assets/fonts/NotoSerif-Regular.ttf, alias the stem, retarget roles (Theme and fonts). Starter stays Roboto-only.

Fixed-height page shells

These examples pin the page content box with layout.height. They ship 240000 millipt as a demo only — set height to your real content box (page height minus margins) before export.

Page setupContent-box height (millipt)
A4, default 56pt margins730000
A4, margin 0842000
Letter, default margins680000
Letter, margin 0792000
Widescreen, margin 0540000
Square (--page square)600000
Card (--page card)144000

Page dimensions and margins: package.md (595000×842000 for A4, not ISO 595280×841890).

Applies to: ex_poster_shell, ex_poster_growers, ex_filled_page, ex_banner_header, ex_cover.

Pick a starting example

DeliverableStart withNotes
Invoice, CV, letter, memo (no trim-edge bar)ex_filled_page.jsonpage_shell; {fr:1} table in grower; fix height
Letterhead, CV, or form with full-bleed top/side bandex_banner_header.json--margin 0, flush outer shell; fix height
Title + logo or amount on one lineex_split_bar.json2-col grid, not flex space-between
To/From/Date, bill-to blocksex_split_bar.jsonReverse column weights {auto:true} + {fr:1}
Letter sender / right-flush addressex_end_block.jsonHorizontal stack justify_content: end
One-page poster, slide, or social squareex_poster_shell.json± ex_poster_growers, ex_card_bands, ex_overlay, ex_glass
Thesis or book coverex_cover.jsonSame shell pattern; fix height
Long report (flowing pages)ex_heading + stack + ex_list + ex_tableOptional ex_on_dark bands
Two-column article (flowing)ex_columns.jsonOne columns container; figures use column_span: "all"
Magazine figure + copyex_media_row.json{pt:N} + {fr:1} grid
KPI or metric stripex_card_bands.jsonOr vertical stack justify_content: center when sparse
Fillable blanks or checkboxesex_form.jsonform_field — never ____ or in body text
Running header/footer (title + page #)catalog/manifest.jsonrunning_blocks; placeholders page_current / page_total only
Duplex cardTwo page_shell children--page card; back page break_before: page; --expect-pages 2

Examples by topic

Paths are under skills/k2f/catalog/.

Layout and shells

ExampleWhat it shows
ex_stack.jsonVertical / horizontal stack, gap, align_items, justify_contentstarter
ex_grid.jsoncolumns / rows, fr tracks, cell_align, gaps — starter
ex_split_bar.jsonTitle left, image or amount right (body/h2 variant: end) — starter
ex_media_row.jsonFixed-width image column + flowing copy — starter
ex_end_block.jsonTrailing-edge block with left-aligned lines — starter
ex_poster_shell.jsonPage-height grid, page_shell, header/footer {auto} + body {fr:1}starter
ex_banner_header.jsonBleed band + inset body — starter
ex_filled_page.jsonFilled sheet with table grower + totals footer — starter
ex_poster_growers.jsonStacked {fr:1} rows for leftover space — starter
ex_card_bands.jsonEqual-height card interiors — starter
ex_cover.jsonLogo + title groups + year footer — starter
ex_overlay.jsonlayout.type: overlay, break_inside: avoidstarter
ex_glass.jsoncard variant glass (blur + translucent surface) — catalog theme
ex_columns.jsonFlowing multi-column article — starter

Tables

ExampleWhat it shows
ex_table.jsonInline content.type: table, numeric cells variant: endstarter
ex_table_dense.jsonWeighted columns + compact cells — starter
ex_table_edges.jsonRuled table + cell edge variants — starter
ex_table_colspan.jsonSame-row colspan (no rowspan) — starter
ex_table_composite.jsonTitle + list or icon row inside a cell — starter

Text, lists, and code

ExampleWhat it shows
ex_heading.jsonh1 + keep_with_nextstarter
ex_list.jsonlist_id, depth, bullet/number markers — starter
ex_modifiers.jsonemphasis, link, math, underline, strikethrough, sub/sup, syntax — starter
ex_code.jsonrole: code, content.type: text (not code_block) — starter
ex_math.jsonDisplay math content.type: math — Noto Sans Math
ex_math_numbered.jsonNumbered display math via grid (not \tag) — same fonts as ex_math
ex_form.jsonform_field kinds (text, multiline, checkbox, signature) — starter

Images and chrome

ExampleWhat it shows
ex_image.jsonEmbedded PNG, millipt size — starter (copy asset to assets/images/)
ex_on_dark.jsonvariant: on_dark on existing roles — starter
ex_badge.jsonPill label; copy the stack wrapper into grid cells — starter
ex_rule.jsonHorizontal rule in a vertical stack/grid — starter

Document structure

FileWhat it shows
content/root.json{ "include": "content/…" } pattern for split content
manifest.jsonrunning_blocks grid for header/footer

Verify

From skills/k2f/ with k2f on PATH (pip install k2f or K2F_CLI):

python scripts/pack_verify.py catalog -o /tmp/catalog.K2F

The script packs the catalog folder as-is; it does not search your document workspace.

See also