../

Demo

This page doubles as a tour of everything a cheatsheet can use. Every construct below is plain Markdown, GitHub-flavored Markdown, or a small piece of JSX, and it all renders in the house style with no extra client JavaScript.

Text

Paragraphs wrap at the column width. Inline styles: bold, italic, struck, inline code, and a link to another sheet, an external link (opens in a new tab), and an autolink: https://nextjs.org (opens in a new tab). Footnotes work too.1

Keys render as chips: ⌘ K opens search.

Third-level heading

Headings get ids, so #third-level-heading links straight here: jump.

Lists

  • Unordered lists get the * marker from the original site
  • Nested items
    • indent by two spaces
    • and keep the marker
  • Done
  1. Ordered lists
  2. keep their numbers
  3. and align
  • Task lists render as brackets
  • not native checkboxes

Tabs, steps, callouts and cards

Four more components are available without an import. <Tabs> switches panels; give several groups the same persist key and they change together and remember the choice.

bun add katex

Runs on the Bun runtime in development.

<Steps> numbers a procedure like the site's lists:

  1. Write the sheet

    Add a file under content/<topic>/ with a title and a date.
  2. Check it

    Run bun run dev and open the page.
  3. Ship it

    Run bun run build; every sheet is prerendered.

<Callout> takes a type of info, warn or error and an optional title:

<Cards> lists links with a description each:

Including files

Partials are MDX files whose names start with _. Import one and use it as a component:

import Shared from "./_shared-snippet.mdx";
 
<Shared />

This paragraph lives in _shared-snippet.mdx. Files whose names start with an underscore are partials: they never become pages, and any sheet can pull them in with an import.

The table of contents in the right margin is generated automatically from the ## and ### headings.

Quotes and notes

Blockquotes carry a dotted rule on the left. Good for a definition or a quoted rule of thumb.

Code

Fenced blocks are highlighted at build time. Name the language after the fence.

def spacing(step: int, base: int = 4) -> int:
    """Return a value on a 4pt spacing scale."""
    return base * step
:root {
  --space-1: 4px;
  --space-2: 8px;
}
bun run dev   # dev server on the Bun runtime
- padding: 13px;
+ padding: var(--space-3);
Blocks without a real language stay plain, still boxed.

Titles, highlighted lines, line numbers

Add a title, a line range and showLineNumbers after the language: ```python title="spacing.py" {2,4-5} showLineNumbers

spacing.py
BASE = 4
 
def spacing(step: int) -> int:
    """Return a value on the spacing scale."""
    return BASE * step
 
print(spacing(3))

File trees

A tree fence draws a directory layout from an indented outline: two spaces per level, a trailing / for directories, # text for a comment. Fence meta takes a title.

monorepo
repo/apps/web/              # Next.js apppackage.jsonpackages/ui/src/package.json  # "name": "@acme/ui"pnpm-workspace.yamlpackage.json

Color, demos and diagrams

<Swatches> draws color chips (hex, rgb(), hsl() or oklch()); weights adds a proportion bar. <Scale> builds a 50–950 tonal scale from one OKLCH hue, and <Contrast> grades a pair against WCAG. All three are computed at build time.

60-30-10
  • base#f4f1ea60%
  • primary#23395b30%
  • accent#e4572e10%
Blue, hue 250
  • 50#eef6fe
  • 100#d7eafe
  • 200#b4d8ff
  • 300#83c0ff
  • 400#53a3f2
  • 500#3587d3
  • 600#116bb5
  • 700#015493
  • 800#013e6f
  • 900#002a4e
  • 950#001932
The quick brown fox jumps over the lazy dog
#767676 on #ffffff · 4.54:1 · text AA · large AAA

An html fence with demo in its meta also renders live, in a sandboxed frame that follows the site theme. height= sets the frame height.

flex.html
<style>
  .row { display: flex; gap: 8px; }
  .row div { flex: 1; padding: 12px; border-radius: 4px;
    background: var(--graph-0); color: white; }
  .row div:nth-child(2) {
    flex: 2; background: var(--graph-2); }
</style>
<div class="row">
  <div>flex: 1</div><div>flex: 2</div><div>flex: 1</div>
</div>
Result

<Diagram> inlines an SVG from public/images/diagrams/, so it follows the theme.

margin padding content width × height border
The CSS box model

Tables

TokenValueUse for
--space-14pxhairline gaps
--space-28pxinside compact controls
--space-416pxbetween related blocks
--space-624pxbetween sections of a card

Columns can be left- or right-aligned. Wide tables scroll sideways inside the column.

Images

Spacing scale swatch

Files under public/images/ get real dimensions at build time and load through next/image.

Details

Collapsed by default

Anything inside <details> is hidden until the summary is clicked. Markdown works inside.

  • including lists
  • and code

Math

LaTeX between single dollars is inline, E=mc2E = mc^2, and between double dollars is a display block:

∇⋅E=ρε0\nabla \cdot \mathbf{E} = \frac{\rho}{\varepsilon_0}

Rendered at build time by KaTeX; Math fundamentals has more.

Expressions and exports

MDX can evaluate JavaScript at build time. This page exports meta at the top and reads it here: last updated 2026-09-04 by Zach. Arithmetic works too: 4 × 6 = 24.


A horizontal rule above. Footnotes collect at the bottom of the page.

Footnotes

  1. Footnotes are numbered automatically and link back to where they were used. ↩