Badgeinterfaceno test imports itinterface BadgeA small label beside a title: a kind, a status, a mechanism.
| Member | Type | What it is |
|---|---|---|
text | string | What it says. |
tone | Tone | Its colour. |
The page model (commons 0011-documentation FR-016): every page of the site is a value of these types before it is HTML. Readers (the Markdown of TSDoc and of specifications, the API reader, the lenses) make blocks and inlines; the HTML emitter is the one writer, and matches every case with a switch that ends in absurd, so that a case added here and left out there does not compile.
Badgeinterfaceno test imports itinterface BadgeA small label beside a title: a kind, a status, a mechanism.
| Member | Type | What it is |
|---|---|---|
text | string | What it says. |
tone | Tone | Its colour. |
Blocktypetype Block =
| { readonly kind: "heading"; readonly level: 2 | 3 | 4; readonly id: string; readonly text: readonly Inl… (1476 characters)type Block =
| { readonly kind: "heading"; readonly level: 2 | 3 | 4; readonly id: string; readonly text: readonly Inline[] }
| { readonly kind: "paragraph"; readonly inlines: readonly Inline[] }
| { readonly kind: "meta"; readonly inlines: readonly Inline[] }
| { readonly kind: "list"; readonly ordered: boolean; readonly items: readonly (readonly Block[])[] }
| { readonly kind: "code"; readonly lang: Lang; readonly text: string; readonly title?: string }
| { readonly kind: "table"; readonly head: readonly (readonly Inline[])[]; readonly rows: readonly (readonly (readonly Inline[])[])[]; readonly filter?: string; readonly compact?: boolean }
| { readonly kind: "callout"; readonly tone: "note" | "limit" | "warn"; readonly title: string; readonly blocks: readonly Block[] }
| {
readonly kind: "entry";
readonly id: string;
readonly name: string;
readonly badges: readonly Badge[];
readonly signature?: string;
readonly blocks: readonly Block[];
}
| { readonly kind: "tabs"; readonly id: string; readonly tabs: readonly Tab[] }
| { readonly kind: "diagram"; readonly source: string; readonly caption: string }
| { readonly kind: "cards"; readonly cards: readonly Card[] }
| { readonly kind: "badges"; readonly badges: readonly Badge[] }
| { readonly kind: "trend"; readonly label: string; readonly values: readonly number[]; readonly unit?: string }
| { readonly kind: "tree"; readonly nodes: readonly TreeNode[] };A part of a page.
Cardinterfaceno test imports itinterface CardA card: a title that links somewhere, with a line under it.
| Member | Type | What it is |
|---|---|---|
title | string | The title. |
href | Href | Where it goes. |
text | readonly Inline[] | The line under the title. |
badges? | readonly Badge[] | Badges beside the title. |
children? | readonly Card[] | Cards shown under this one, a level in. |
Hreftypeno test imports ittype Href =
| { readonly kind: "page"; readonly path: string; readonly anchor?: string }
| { readonly kind: "external"; readonly url: string };Where a link goes: a page of the site (by its path from the site's root), or an address outside it.
Inlinetypeno test imports ittype Inline =
| { readonly kind: "text"; readonly text: string }
| { readonly kind: "code"; readonly text: string }
| { readonly kind: "emphasis"; readonly children: readonly Inline[] }
| { readonly kind: "strong"; readonly children: readonly Inline[] }
| { readonly kind: "link"; readonly href: Href; readonly children: readonly Inline[] };A run of text inside a block.
Pageinterfaceinterface PageA page: where it is, what it is called, which section and group of the navigation it is in, and its blocks.
| Member | Type | What it is |
|---|---|---|
path | string | Its path from the site's root, ending in .html. |
title | string | Its title. |
description | string | A sentence that says what it is, for the search and the page's description. |
section | Section | Its section. |
group | string | Its group in the section's navigation. |
order | number | Its place in the group: lower first, then by title. |
navTitle? | string | What the navigation calls it, where that is not its title. |
parent? | string | The page it is under in the navigation (its path): it is listed beneath that page, and only while that page or a page beneath it is the one being read. |
navKind? | string | What kind of page it is, for the small heading that groups the pages beneath one page in the navigation (Concepts, Code lists). |
badges? | readonly Badge[] | Its badges, beside the title. |
blocks | readonly Block[] | What it holds. |
Sectiontypeno test imports ittype Section = "start" | "concepts" | "overview" | "howto" | "specs" | "api" | "models" | "programs" | "quality" | "repoops";The sections of the site (commons 0011-documentation FR-009 and FR-032): the guides, the concepts, the libraries, the how-to pages, and the reference (specifications, API and models).
Tabinterfaceno test imports itinterface TabA tab of a set of tabs.
| Member | Type | What it is |
|---|---|---|
label | string | Its label. |
blocks | readonly Block[] | What it shows. |
TreeNodeinterfaceno test imports itinterface TreeNodeA node of a tree diagram: a label, a note, and what is under it.
| Member | Type | What it is |
|---|---|---|
label | string | What the node is called, as code. |
note? | readonly Inline[] | A short note beside it. |
children | readonly TreeNode[] | The nodes under it. |
plainfunctionfunction plain(inlines: readonly Inline[]): stringThe text of inlines, with no markup: for a heading's anchor, the search and a page's description.
possessiveconstno test imports itconst possessive: (name: string) => stringA name as a possessive: commons', Stolos', Erga's.
slugOffunctionno test imports itfunction slugOf(t: string): stringAn anchor made from a text: lower-case letters, digits and hyphens.