Search the documentation

Type to search. Use ↑ and ↓ to move, Enter to open.

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.

Math_Chaos/Lorenz-Attractor/project.yaml
id: lorenz-attractor
domain: dynamical-systems
concepts: [lorenz-system, runge-kutta-methods, strange-attractors]
related: [theories-visuals]
docs: math-chaos/lorenz-attractor

Concepts 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 xn+1=rxn(1−xn)x_{n+1} = r x_n (1 - x_n). Displayed equations use double dollars on their own lines:

dxdt=σ(y−x),dydt=x(ρ−z)−y,dzdt=xy−βz.\frac{\mathrm{d}x}{\mathrm{d}t} = \sigma (y - x), \qquad \frac{\mathrm{d}y}{\mathrm{d}t} = x (\rho - z) - y, \qquad \frac{\mathrm{d}z}{\mathrm{d}t} = x y - \beta z .

KaTeX renders at build time; a formula it cannot parse stops the build. These macros are available everywhere:

MacroResultMacroResult
\R, \N, \Z, \Q, \CR,N,Z,Q,C\R, \N, \Z, \Q, \C\norm{v}∥v∥\norm{v}
\abs{x}∣x∣\abs{x}\floor{x}, \ceil{x}⌊x⌋,⌈x⌉\floor{x}, \ceil{x}
\set{x \mid x > 0}{x∣x>0}\set{x \mid x > 0}\deriv{f}{x}, \pderiv{f}{x}dfdx,∂f∂x\deriv{f}{x}, \pderiv{f}{x}
\bigO{n \log n}O(nlog⁡n)\bigO{n \log n}\argmin, \argmaxarg min⁡xf(x)\argmin_x f(x)

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 aa and bb, not both zero, gcd⁡(a,b)\gcd(a, b) is the largest integer that divides both.

Theorem 2(Euclid).

Repeatedly replacing (a,b)(a, b) by (b,a mod b)(b, a \bmod b) reaches b=0b = 0 after finitely many steps, and then a=gcd⁡a = \gcd of the original pair.

Proof of Theorem 2.

The second component strictly decreases, so the process stops. Common divisors of aa and bb and of bb and a mod ba \bmod b coincide, so by Definition 1 the gcd never changes.

∎

Example 3.

gcd⁡(252,105)\gcd(252, 105): (252,105)→(105,42)→(42,21)→(21,0)(252, 105) \to (105, 42) \to (42, 21) \to (21, 0), so the answer is 2121.

MDX
<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.

Algorithm 1Euclid's algorithm
Input
integers a,b≥0a, b \ge 0, not both zero
Output
gcd⁡(a,b)\gcd(a, b)
  1. while b≠0b \neq 0 do
    1. (a,b)←(b, a mod b)(a, b) \gets (b,\ a \bmod b)
  2. return aa

Complexity: O(log⁡min⁡(a,b))\bigO{\log \min(a, b)} iterations

Figures and diagrams

<Figure> numbers and captions an image (src) or whatever it wraps. <Album> shows screenshots in a keyboard-friendly viewer.

A zoom into the boundary of the Mandelbrot set, coloured by escape time
Figure 1.Escape-time colouring near the boundary of the Mandelbrot set, drawn by the Fractal-gh project.
MDX
<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.

MARKDOWN
```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 }]}.

Orbits of the logistic mapx(n+1) = r x(n) (1 − x(n)) from x(0) = 0.2: a fixed point, a 4-cycle and chaos.
x(n)
010203040506000.20.40.60.81
iteration n
Show data table
iteration nr = 2.8r = 3.5r = 3.9
00.20.20.2
20.69240.86240.915
30.59630.41530.3032
50.61520.44650.5657
60.66280.8650.9582
80.65570.84590.5142
90.63210.45630.9742
110.6360.40020.3446
120.64820.84010.8809
140.64630.87190.9429
150.64010.3910.21
170.64110.48590.8908
180.64430.87430.3794
200.64380.82840.2925
220.64340.8750.607
230.64240.38290.9303
250.64260.50080.7367
260.64310.8750.7565
280.6430.82690.7888
290.64270.50090.6497
310.64280.38280.389
320.64290.82690.927
340.64290.8750.7578
350.64280.38280.7158
370.64280.50090.6394
380.64290.8750.8992
400.64290.82690.8912
420.64290.8750.917
430.64290.38280.2969
450.64290.50090.5902
460.64290.8750.9433
480.64290.82690.6438
490.64290.50090.8943
510.64290.38280.9077
520.64290.82690.3268
540.64290.8750.4753
550.64290.38280.9726
570.64290.50090.3631
580.64290.8750.9019
600.64290.82690.8814
MDX
<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>.

  1. Add or update the project’s project.yaml (domain, concepts, docs path).
  2. Write the page under docs/src/content/docs/.
  3. Run npm run build in docs/: it type-checks, builds every page and indexes them for search. npm run preview serves 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 tokenBackground tokenLightDark
--color-fg--color-bgAa 16.5:1Aa 15.5:1
--color-heading--color-bgAa 18.5:1Aa 17.4:1
--color-fg-muted--color-bgAa 7.0:1Aa 8.9:1
--color-fg-subtle--color-bgAa 5.0:1Aa 6.9:1
--color-fg-muted--color-surface-2Aa 6.6:1Aa 7.8:1
--color-accent--color-bgAa 17.2:1Aa 17.1:1
--color-accent--color-surfaceAa 17.8:1Aa 16.1:1
--color-accent-strong--color-accent-softAa 18.1:1Aa 14.9:1
--color-on-accent--color-accentAa 17.8:1Aa 17.3:1
--color-code-fg--color-code-bgAa 14.2:1Aa 13.8:1
--color-note--color-note-bgAa 4.7:1Aa 6.9:1
--color-tip--color-tip-bgAa 4.7:1Aa 7.4:1
--color-caution--color-caution-bgAa 5.3:1Aa 7.7:1
--color-danger--color-danger-bgAa 4.5:1Aa 6.6:1
--env-theorem--env-theorem-bgAa 4.7:1Aa 7.1:1
--env-definition--env-definition-bgAa 4.6:1Aa 7.2:1
--env-example--env-example-bgAa 4.8:1Aa 6.9:1
--env-algorithm--env-algorithm-bgAa 4.6:1Aa 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