Skip to content

Commit 948e92b

Browse files
fix(docs): escape MDX JSX openers in generated reference tables (#40)
gen:reference emitted description prose like `currency:<CODE>` verbatim into table cells; MDX parsed `<CODE>` as an unclosed JSX tag and failed the build. cell() now escapes `<` and `{` alongside the pipe, matching the header contract. Regenerated manifest.mdx (also picks up stale schema sync).
1 parent d0a555d commit 948e92b

2 files changed

Lines changed: 20 additions & 33 deletions

File tree

apps/docs/content/docs/reference/manifest.mdx

Lines changed: 14 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,11 @@ A **group** is `{ id, title?, islands }`: a string `id`, an optional `title`, an
100100
A page's optional `filters` declare shared controls in the page header. Each filter's `bind`
101101
maps each affected dataset to the column the filter applies to; islands whose `dataset` appears
102102
in `bind` re-query when the filter changes, and the rest ignore it. Two kinds are supported: a
103-
`daterange` over a date column, and a `select` that narrows a categorical column. A `daterange`
104-
may set a `default` initial period (resolved live against today) applied when the URL sets no
105-
range; without it the page opens to all-time.
103+
`daterange` over a date column, and a `select` that narrows a categorical column.
106104

107105
```jsonc title="manifest.json"
108106
"filters": [
109-
{ "id": "period", "type": "daterange", "label": "Period", "default": "last-90-days",
107+
{ "id": "period", "type": "daterange", "label": "Period",
110108
"bind": { "net_worth": "month", "transactions": "ts" } },
111109
{ "id": "team", "type": "select", "label": "Team", "multiple": true,
112110
"bind": { "services": "owner" } }
@@ -119,7 +117,6 @@ range; without it the page opens to all-time.
119117
| `type` | `string` | yes | The filter kind: `daterange` or `select`. |
120118
| `label` | `string` | no | Label shown on the control. |
121119
| `bind` | `object` | yes | A map of dataset name to the column the filter applies to. Each column is validated against the live data. |
122-
| `default` | `string` | no | `daterange` only: initial period when the URL sets no range, resolved live against today. One of `today`, `last-7-days`, `last-30-days`, `last-90-days`, `this-month`, `last-month`. Omitted means all-time. |
123120
| `multiple` | `boolean` | no | `select` only: allow several values (`IN`); default single (`=`). |
124121
| `options` | `array of string` | no | `select` only: explicit choices; when omitted, the bound column's live distinct values are used. |
125122

@@ -190,7 +187,6 @@ points at.
190187
| `groupBy` | `array of string` | no | Columns to group by, for aggregate `select` entries. |
191188
| `orderBy` | `array of object` | no | Sort keys, each `{ field, dir? }` where `dir` is `asc` / `desc` (default `asc`). |
192189
| `limit` | `number` | no | Max rows returned. |
193-
| `search` | `object` | no | Make the query a relevance-ranked full-text search over text columns (see query search). |
194190
| `params` | `object` | no | A map of parameter name to a parameter declaration (see query params). |
195191
| `description` | `string` | no | Free-form note describing the query. |
196192

@@ -213,19 +209,6 @@ declared param) or `value` (a literal). The ops are `eq`, `ne`, `lt`, `lte`, `gt
213209
date), and `in` (a literal `value` array). A filter bound to an **optional** param the
214210
caller omits is dropped, so the query runs without it.
215211

216-
A **query search** (`search`) turns the query into a relevance-ranked full-text (BM25)
217-
search over text columns, distinct from a `contains` filter's unranked substring match.
218-
It requires a `source` dataset (not a `sql` transform). An omitted `orderBy` ranks by
219-
relevance; an explicit `orderBy` overrides it.
220-
221-
| Field | Type | Required | Description |
222-
| --- | --- | --- | --- |
223-
| `fields` | `array of string` | yes | Text columns to index and search across; each must be a real column of the dataset. |
224-
| `param` | `string` | yes | Name of a declared `string` param holding the search term. |
225-
| `stemmer` | `"porter" \| "none"` | no | Token stemmer. `porter` (default) folds plurals / tenses; `none` matches exact tokens. |
226-
| `stopwords` | `"english" \| "none"` | no | Drop common words from the index and term. `english` (default) drops them; `none` keeps them. |
227-
| `scoreField` | `string` | no | Name a column to expose the BM25 score under; omit to keep the score internal. |
228-
229212
## Connectors
230213

231214
A **connector** is a vendored integration that syncs a provider's data into `source`
@@ -287,7 +270,7 @@ A single headline number, optionally with a delta vs the previous row or a targe
287270
| `compareTo` | `string` | no | 'prev', 'none', or a field name |
288271
| `target` | `string` | no | field holding a target to compare against |
289272
| `unit` | `string` | no | |
290-
| `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. See the Value formats reference (/reference/value-formats). |
273+
| `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. For any other ISO 4217 currency use 'currency:\<CODE>' (e.g. currency:RSD). See the Value formats reference (/reference/value-formats). |
291274
| `color` | `string` | no | 6-digit hex color (e.g. "#22C55E") for the sparkline, overriding the default palette |
292275

293276
### `metric.scorecard`
@@ -359,7 +342,7 @@ A dual-axis chart: bars on the primary axis, lines on a secondary axis — use t
359342
| `stacked` | `boolean` | no | stack the bar series into one bar per category |
360343
| `colors` | `array of string` | no | CSS colors per series (bars first, then lines), overriding the default palette |
361344
| `format` | [`value format`](/reference/value-formats) | no | format for the primary (bar) y-axis |
362-
| `lineFormat` | `"usd" \| "eur" \| "gbp" \| "jpy" \| "int" \| "decimal" \| "pct" \| "compact" \| "kg" \| "bytes" \| "duration" \| "date" \| "datetime" \| "time" \| "month"` | no | format for the secondary (line) y-axis |
345+
| `lineFormat` | `"usd" \| "eur" \| "gbp" \| "jpy" \| "int" \| "decimal" \| "pct" \| "compact" \| "kg" \| "bytes" \| "duration" \| "date" \| "datetime" \| "time" \| "month" \| string` | no | format for the secondary (line) y-axis |
363346

364347
### `waterfall.bars`
365348

@@ -377,7 +360,7 @@ A waterfall / bridge chart — use for a P&L walk or variance: an opening anchor
377360
| `value` | `string` | yes | signed delta per step; for a total/anchor row, its absolute level |
378361
| `kind` | `string` | no | field marking anchor rows: a row whose value here is "total" draws as an absolute bar from zero (opening/closing/subtotal). Omit to make every row a delta. |
379362
| `colors` | `object` | no | CSS colors per tone, overriding the defaults (increase green, decrease red, total neutral) |
380-
| `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. See the Value formats reference (/reference/value-formats). |
363+
| `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. For any other ISO 4217 currency use 'currency:\<CODE>' (e.g. currency:RSD). See the Value formats reference (/reference/value-formats). |
381364

382365
### `breakdown.treemap`
383366

@@ -412,7 +395,7 @@ A matrix heatmap — use to show one value across two categorical dimensions (x
412395
| `y` | `string` | yes | row-category field (y axis) |
413396
| `value` | `string` | yes | numeric field mapped to each cell's color |
414397
| `colors` | `array of string` | no | gradient color stops for the scale, overriding the default |
415-
| `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. See the Value formats reference (/reference/value-formats). |
398+
| `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. For any other ISO 4217 currency use 'currency:\<CODE>' (e.g. currency:RSD). See the Value formats reference (/reference/value-formats). |
416399

417400
### `activity.calendar`
418401

@@ -429,7 +412,7 @@ A calendar heatmap — use to show a daily value over weeks and months, GitHub-c
429412
| `date` | `string` | yes | date field — any parseable date or timestamp |
430413
| `value` | `string` | yes | numeric field mapped to the day's color intensity |
431414
| `colors` | `array of string` | no | gradient color stops, overriding the default |
432-
| `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. See the Value formats reference (/reference/value-formats). |
415+
| `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. For any other ISO 4217 currency use 'currency:\<CODE>' (e.g. currency:RSD). See the Value formats reference (/reference/value-formats). |
433416

434417
### `funnel.steps`
435418

@@ -447,7 +430,7 @@ A funnel of sequential stages — use for conversion or drop-off; each stage's w
447430
| `value` | `string` | yes | numeric field — the count at each stage |
448431
| `sort` | `"none" \| "ascending" \| "descending"` | no | funnel ordering; 'none' keeps the declared row order |
449432
| `colors` | `array of string` | no | CSS colors per stage, overriding the default palette |
450-
| `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. See the Value formats reference (/reference/value-formats). |
433+
| `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. For any other ISO 4217 currency use 'currency:\<CODE>' (e.g. currency:RSD). See the Value formats reference (/reference/value-formats). |
451434

452435
### `rank.list`
453436

@@ -467,7 +450,7 @@ A ranked Top-N list with proportional bars — use for leaderboards: top product
467450
| `sort` | `"descending" \| "ascending"` | no | rank order by value |
468451
| `secondary` | `string` | no | optional field shown beside each row's value |
469452
| `color` | `string` | no | CSS color for the bars, overriding the default accent |
470-
| `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. See the Value formats reference (/reference/value-formats). |
453+
| `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. For any other ISO 4217 currency use 'currency:\<CODE>' (e.g. currency:RSD). See the Value formats reference (/reference/value-formats). |
471454

472455
### `compare.radar`
473456

@@ -485,7 +468,7 @@ A radar (spider) chart — use to compare entities across several metrics at onc
485468
| `series` | `string` | no | field naming each polygon (one per row); omitted numbers them Series 1, 2, … |
486469
| `max` | `number` | no | fixed max for every axis; omitted maxes each axis at its metric's peak |
487470
| `colors` | `array of string` | no | CSS colors per polygon, overriding the default palette |
488-
| `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. See the Value formats reference (/reference/value-formats). |
471+
| `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. For any other ISO 4217 currency use 'currency:\<CODE>' (e.g. currency:RSD). See the Value formats reference (/reference/value-formats). |
489472

490473
### `map.choropleth`
491474

@@ -503,7 +486,7 @@ A geographic choropleth — use to shade regions (world countries) by a value; r
503486
| `value` | `string` | yes | numeric field mapped to each region's color |
504487
| `map` | `string` | no | the registered map name |
505488
| `colors` | `array of string` | no | gradient color stops, overriding the default |
506-
| `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. See the Value formats reference (/reference/value-formats). |
489+
| `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. For any other ISO 4217 currency use 'currency:\<CODE>' (e.g. currency:RSD). See the Value formats reference (/reference/value-formats). |
507490

508491
### `correlation.scatter`
509492

@@ -542,7 +525,7 @@ A pie or donut chart of part-to-whole composition — use for one series' share
542525
| `value` | `string` | yes | numeric field sizing each slice |
543526
| `donut` | `boolean` | no | render with an inner radius (a donut hole) |
544527
| `colors` | `array of string` | no | CSS colors per slice (in descending-value order), overriding the default palette |
545-
| `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. See the Value formats reference (/reference/value-formats). |
528+
| `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. For any other ISO 4217 currency use 'currency:\<CODE>' (e.g. currency:RSD). See the Value formats reference (/reference/value-formats). |
546529

547530
### `table.grid`
548531

@@ -645,7 +628,7 @@ A responsive grid of state tiles — use for service/check health on ops & statu
645628
| `label` | `string` | yes | field naming each entity (service, check, host) |
646629
| `state` | `string` | yes | field holding each entity's status value |
647630
| `value` | `string` | no | optional metric shown under the label |
648-
| `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. See the Value formats reference (/reference/value-formats). |
631+
| `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. For any other ISO 4217 currency use 'currency:\<CODE>' (e.g. currency:RSD). See the Value formats reference (/reference/value-formats). |
649632
| `tones` | `object` | no | map a state value to a tone; unmapped values fall back to a keyword convention (up/ok/healthy/online → success, warn/degraded/pending → warning, down/error/critical/fail → danger, else neutral) |
650633

651634
### `search.box`
@@ -717,7 +700,7 @@ A full-page content workspace — browse and edit a directory of markdown files
717700

718701
### `form.entry`
719702

720-
A data-entry form card bound to a manifest `action` — renders one typed input per action field, with a submit button in the bottom-right that inserts a row; the bound dataset's islands then refresh live. The human-facing mirror of the agent's run_action: it reuses the action's typing and so binds no dataset of its own.
703+
A data-entry form card bound to a manifest `action` — renders one typed input per action field, with a submit button in the bottom-right that inserts a row; the bound dataset's islands then refresh live. The human-facing mirror of the agent's runActions insert: it reuses the action's typing and so binds no dataset of its own.
721704

722705
**Span:** min 3, recommended 5, max 8 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error.
723706

apps/docs/scripts/gen-reference.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,13 @@ function fieldRows(schema: JsonSchemaNode): FieldRow[] {
111111

112112
// --- MDX assembly ---------------------------------------------------------------
113113

114-
/** Escape a pipe so it can't break a Markdown table cell. */
114+
/**
115+
* Escape a pipe (breaks the Markdown table) and MDX's JSX/expression openers
116+
* `<` `{` (which would parse description prose like `currency:<CODE>` as a tag).
117+
* Type cells pass through too, but `renderType` never emits these characters.
118+
*/
115119
function cell(text: string): string {
116-
return text.replace(/\|/g, "\\|");
120+
return text.replace(/[|<{]/g, "\\$&");
117121
}
118122

119123
function fieldTable(rows: FieldRow[]): string {

0 commit comments

Comments
 (0)