On this page
Pages and manifests
A page is an .mdx file under docs/src/content/docs/; its address is its path. Front matter needs a title and a one-sentence description; navLabel, order, toc: false and draft: true are optional.
A page documents a project when the project’s project.yaml names it in docs. The site then adds the domain, the facts panel, the explorer or demo, the build, run and test commands (Run it yourself) and the knowledge graph. Edit the manifest, not the page.
id: lorenz-attractor
domain: dynamical-systems
concepts: [lorenz-system, runge-kutta-methods, strange-attractors]
related: [theories-visuals]
docs: math-chaos/lorenz-attractorConcepts come from knowledge/concepts.yaml; each gets a page under /concepts/.
Shape of a project page. A lead of one or two sentences; The mathematics (key formulas, each with a sentence or two); How it works (a short numbered list); optionally Results (one figure or table). Keep paragraphs to three sentences, and do not restate an explorer’s controls or the generated commands.
Mathematics
Write TeX between dollar signs: $x_{n+1} = r x_n (1 - x_n)$ renders as . Displayed equations use double dollars on their own lines:
KaTeX renders at build time; a formula it cannot parse stops the build. These macros are available everywhere:
| Macro | Result | Macro | Result |
|---|---|---|---|
\R, \N, \Z, \Q, \C | \norm{v} | ||
\abs{x} | \floor{x}, \ceil{x} | ||
\set{x \mid x > 0} | \deriv{f}{x}, \pderiv{f}{x} | ||
\bigO{n \log n} | \argmin, \argmax |
Theorems, proofs and algorithms
Definitions, theorems, lemmas, propositions, corollaries, examples and remarks share one counter per page. An id lets <Ref to="..." /> link to a block. <Theorem> takes an optional name, <Definition> takes term, and <Proof> takes collapsible.
Definition 1(Greatest common divisor).
For integers and , not both zero, is the largest integer that divides both.
Theorem 2(Euclid).
Repeatedly replacing by reaches after finitely many steps, and then of the original pair.
Proof of Theorem 2.
The second component strictly decreases, so the process stops. Common divisors of and and of and coincide, so by Definition 1 the gcd never changes.
∎Example 3.
: , so the answer is .
<Definition term="Greatest common divisor" id="def-gcd">…</Definition>
<Theorem name="Euclid" id="thm-euclid">…</Theorem>
<Proof of="of Theorem 2" collapsible>… by <Ref to="def-gcd" /> …</Proof>Write an algorithm’s steps as a numbered list; nest a list for a loop body.
- Input
- integers , not both zero
- Output
- while do
- return
Complexity: iterations
Figures and diagrams
<Figure> numbers and captions an image (src) or whatever it wraps. <Album> shows screenshots in a keyboard-friendly viewer.

<Figure src="/imgs/fractal_gh/fractal-3.jpg" alt="…" caption="…" id="fig-mandelbrot" />
<Album title="Screenshots" columns={2} images={[{ src: '/imgs/fractal_gh/fractal-0.jpg', alt: '…' }]} />A fenced mermaid block becomes an SVG diagram; start it with accTitle and accDescr for a text alternative.
```mermaid
flowchart LR
accTitle: Docs build pipeline
accDescr: Manifests and MDX pages feed the content collections, which produce the pages.
M[project.yaml manifests] --> C[(Content collections)]
P[MDX pages] --> C --> D[Project pages]
```Charts
<Chart type="line | scatter | phase"> is interactive (hover, toggle series, data table). Data comes from a JSON file in src/data/charts/ or from series={[{ name, points }]}.
Show data table
| iteration n | r = 2.8 | r = 3.5 | r = 3.9 |
|---|---|---|---|
| 0 | 0.2 | 0.2 | 0.2 |
| 2 | 0.6924 | 0.8624 | 0.915 |
| 3 | 0.5963 | 0.4153 | 0.3032 |
| 5 | 0.6152 | 0.4465 | 0.5657 |
| 6 | 0.6628 | 0.865 | 0.9582 |
| 8 | 0.6557 | 0.8459 | 0.5142 |
| 9 | 0.6321 | 0.4563 | 0.9742 |
| 11 | 0.636 | 0.4002 | 0.3446 |
| 12 | 0.6482 | 0.8401 | 0.8809 |
| 14 | 0.6463 | 0.8719 | 0.9429 |
| 15 | 0.6401 | 0.391 | 0.21 |
| 17 | 0.6411 | 0.4859 | 0.8908 |
| 18 | 0.6443 | 0.8743 | 0.3794 |
| 20 | 0.6438 | 0.8284 | 0.2925 |
| 22 | 0.6434 | 0.875 | 0.607 |
| 23 | 0.6424 | 0.3829 | 0.9303 |
| 25 | 0.6426 | 0.5008 | 0.7367 |
| 26 | 0.6431 | 0.875 | 0.7565 |
| 28 | 0.643 | 0.8269 | 0.7888 |
| 29 | 0.6427 | 0.5009 | 0.6497 |
| 31 | 0.6428 | 0.3828 | 0.389 |
| 32 | 0.6429 | 0.8269 | 0.927 |
| 34 | 0.6429 | 0.875 | 0.7578 |
| 35 | 0.6428 | 0.3828 | 0.7158 |
| 37 | 0.6428 | 0.5009 | 0.6394 |
| 38 | 0.6429 | 0.875 | 0.8992 |
| 40 | 0.6429 | 0.8269 | 0.8912 |
| 42 | 0.6429 | 0.875 | 0.917 |
| 43 | 0.6429 | 0.3828 | 0.2969 |
| 45 | 0.6429 | 0.5009 | 0.5902 |
| 46 | 0.6429 | 0.875 | 0.9433 |
| 48 | 0.6429 | 0.8269 | 0.6438 |
| 49 | 0.6429 | 0.5009 | 0.8943 |
| 51 | 0.6429 | 0.3828 | 0.9077 |
| 52 | 0.6429 | 0.8269 | 0.3268 |
| 54 | 0.6429 | 0.875 | 0.4753 |
| 55 | 0.6429 | 0.3828 | 0.9726 |
| 57 | 0.6429 | 0.5009 | 0.3631 |
| 58 | 0.6429 | 0.875 | 0.9019 |
| 60 | 0.6429 | 0.8269 | 0.8814 |
<Chart type="line" title="Orbits of the logistic map" src="logistic-orbits.json"
x="n" y={['r = 2.8', 'r = 3.5', 'r = 3.9']} xLabel="iteration n" yLabel="x(n)" />Notes, steps, tabs and badges
<Callout> (older name <Aside>) takes type (note, tip, caution, danger) and an optional title. <Steps> wraps a numbered list, <Tabs> with <TabItem label="..."> offers alternatives, and <Badge text="C++17" variant="note" /> marks a fact inline: C++17. Project pages also use <GroupName> (domain label above the title), <TextBlock> (styled prose), <ControlsTable controls={[{ key, description }]} /> (keys of a desktop program), <CommandChecklist commands={[{ label, code }]} />, <Card> and <CardGrid>.
- Add or update the project’s
project.yaml(domain, concepts,docspath). - Write the page under
docs/src/content/docs/. - Run
npm run buildindocs/: it type-checks, builds every page and indexes them for search.npm run previewserves the result.
Explorers and live demos
Interactivity is a React island with a static fallback. If the folder src/islands/explorers/<project-id>/ exists, the page gets an Explore section automatically, and a manifest demo adds a live demo. To place either inside the MDX, use <Explorer id="..." /> or <Demo id="..." /> from src/islands/.
An explorer is a folder with an index.tsx exporting a default component, a meta (title, summary, stage aspect) and optionally a Fallback. It uses the kit in src/islands/kit, with the mathematics in plain TypeScript modules. src/islands/README.md holds the rules (no window at module top level, colours from tokens, labelled controls with keyboard alternatives) and the test checklist; /kit-gallery/ shows every kit component.
Design tokens
Colours, type, spacing, radii, shadows and motion are CSS custom properties in docs/src/styles/tokens.css, defined for both themes with light-dark(). Every text and background pair must reach WCAG AA (4.5:1) in light and dark, or the build fails.
| Text token | Background token | Light | Dark |
|---|---|---|---|
--color-fg | --color-bg | Aa 16.5:1 | Aa 15.5:1 |
--color-heading | --color-bg | Aa 18.5:1 | Aa 17.4:1 |
--color-fg-muted | --color-bg | Aa 7.0:1 | Aa 8.9:1 |
--color-fg-subtle | --color-bg | Aa 5.0:1 | Aa 6.9:1 |
--color-fg-muted | --color-surface-2 | Aa 6.6:1 | Aa 7.8:1 |
--color-accent | --color-bg | Aa 17.2:1 | Aa 17.1:1 |
--color-accent | --color-surface | Aa 17.8:1 | Aa 16.1:1 |
--color-accent-strong | --color-accent-soft | Aa 18.1:1 | Aa 14.9:1 |
--color-on-accent | --color-accent | Aa 17.8:1 | Aa 17.3:1 |
--color-code-fg | --color-code-bg | Aa 14.2:1 | Aa 13.8:1 |
--color-note | --color-note-bg | Aa 4.7:1 | Aa 6.9:1 |
--color-tip | --color-tip-bg | Aa 4.7:1 | Aa 7.4:1 |
--color-caution | --color-caution-bg | Aa 5.3:1 | Aa 7.7:1 |
--color-danger | --color-danger-bg | Aa 4.5:1 | Aa 6.6:1 |
--env-theorem | --env-theorem-bg | Aa 4.7:1 | Aa 7.1:1 |
--env-definition | --env-definition-bg | Aa 4.6:1 | Aa 7.2:1 |
--env-example | --env-example-bg | Aa 4.8:1 | Aa 6.9:1 |
--env-algorithm | --env-algorithm-bg | Aa 4.6:1 | Aa 7.0:1 |
Domain colours follow a fixed order:
- Dynamical systems
- Fractals
- Complex systems
- Numerical methods
- Number theory
- Cryptography
- Optimisation
- Discrete maths
- Calculus
- Geometry
- Signals and coding