Skip to content

The numbers come from the data

A report declares its sources under data: in its front matter: a CSV, JSON or YAML file next to the story, or rows written inline. The build reads them in Node, infers the type of each column, and renders four directives. The rows never reach the browser: only the numbers shown do.

YAMLYAML
data: sales: ./data/sales.csv regions: ./data/regions.json targets: ./data/targets.yaml

A number in a sentence

:value computes one number. agg has no default, so no number is ever chosen implicitly.

MarkdownMarkdown
Revenue reached :value{data=sales field=revenue agg=sum format=currency currency=EUR}, and moved by :value{data=sales field=revenue agg=growth by=month period=quarter} over the previous quarter.

Computed by this page, from the data of the quarterly report: revenue reached €70,743.00, and moved by 5.7% over the previous quarter.

growth compares the last complete period with the one before it. The result is a <data> element: its value holds the exact number, its text the number in the words of the story's language.

A chart

::chart names columns, never values. It is drawn as SVG during the build, with the accessible palette and colour roles of the theme, and a "Data" disclosure under it shows the table of the points it plots.

MarkdownMarkdown
::chart{data=sales type=line x=month y=revenue color=region title="Monthly revenue by region"}
Monthly revenue by region
Monthly revenue by regionLine chart of Lorem, Ipsum, Dolor by month, 24 points. Lorem: minimum 1,178 (2025-01), maximum 1,643 (2026-12), trend: up; Ipsum: minimum 748 (2025-01), maximum 1,073 (2026-07), trend: up; Dolor: minimum 460 (2025-03), maximum 763 (2026-12), trend: up.05001,0001,5002,0002025-012025-052025-092026-012026-052026-09
  • Lorem
  • Ipsum
  • Dolor
Data
monthLoremIpsumDolor
January 20251,178748488
February 20251,275851471
March 20251,178827460
April 20251,277864569
May 20251,276894580
June 20251,272803526
July 20251,298893572
August 20251,381849531
September 20251,383925553
October 20251,420957586
November 20251,363964563
December 20251,382884580
January 20261,3611,000615
February 20261,437946640
March 20261,511952675
April 20261,484928649
May 20261,537951614
June 20261,450946604
July 20261,5571,073640
August 20261,518969661
September 20261,5711,011636
October 20261,6341,011695
November 20261,6421,063716
December 20261,6431,019763

A table and key figures

MarkdownMarkdown
::table{data=regions columns="name,revenue,growth" sort=-revenue format="revenue=currency,growth=percent" currency=EUR rename="name=Region,growth=Growth" caption="Revenue by region"} :::kpi - :value{data=sales field=revenue agg=sum format=compact} Revenue - :value{data=sales field=orders agg=sum} Orders :::
Revenue by region
RegionrevenueGrowth
Lorem€18,345.0017%
Ipsum€11,869.0013.5%
Dolor€7,908.0022.1%
Revenue
70.7K
Orders
1,733

Markdown and its JSON twin

Every report has a typed JSON twin (kind: "story"), validated by report.json and convertible both ways with recit convert. The twin points to the same data files without copying their rows, and compiles to the same HTML:

--- title: Lorem Ipsum Quarterly format: report lang: en date: 2026-12-31 data: sales: ./data/sales.csv regions: src: ./data/regions.json columns: { name: string, revenue: number, growth: number } toc: true --- --- id=summary ## Summary Revenue reached :value{data=sales field=revenue agg=sum where="month=2026-12" format=currency currency=EUR}. ::chart{data=sales type=line x=month y=revenue color=region title="Monthly revenue by region"}

An error, with its line

A field, a source or an attribute that does not exist stops the build, with the line and the closest name:

Code
report.md:12 :value: field "revnue" not in sales (did you mean "revenue"?)

The whole report these fragments come from is in the gallery.