diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml
new file mode 100644
index 0000000..4ab1d18
--- /dev/null
+++ b/.github/workflows/pages.yml
@@ -0,0 +1,49 @@
+name: Deploy docs to GitHub Pages
+
+on:
+ push:
+ branches: [master]
+ paths:
+ - 'docs/**'
+ - '.github/workflows/pages.yml'
+ release:
+ types: [published]
+ workflow_dispatch:
+
+permissions:
+ contents: read
+ pages: write
+ id-token: write
+
+concurrency:
+ group: pages
+ cancel-in-progress: false
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ env:
+ GH_TOKEN: ${{ github.token }}
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Assemble site
+ env:
+ REPO: ${{ github.repository }}
+ run: ./docs/build.sh
+
+ - uses: actions/configure-pages@v5
+
+ - uses: actions/upload-pages-artifact@v3
+ with:
+ path: build/html
+
+ deploy:
+ needs: build
+ runs-on: ubuntu-latest
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+ steps:
+ - id: deployment
+ uses: actions/deploy-pages@v4
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 39e7839..ff8c688 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -31,12 +31,11 @@ jobs:
- name: Upload assets to the release
env:
TAG: ${{ github.event.release.tag_name }}
- VERSION: ${{ steps.version.outputs.value }}
run: |
gh release upload "$TAG" \
- "dist/xkcd-script-${VERSION}.otf" \
- "dist/xkcd-script-${VERSION}.ttf" \
- "dist/xkcd-script-${VERSION}.woff" \
- "dist/xkcd-script-${VERSION}.woff2" \
- "dist/xkcd-mathjax3-${VERSION}.js" \
+ "dist/xkcd-script.otf" \
+ "dist/xkcd-script.ttf" \
+ "dist/xkcd-script.woff" \
+ "dist/xkcd-script.woff2" \
+ "dist/xkcd-mathjax3.js" \
--clobber
diff --git a/.gitignore b/.gitignore
index cebfb27..613cf23 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
.DS_store
.font-cache
xkcd-script/generated
+/build
*.afm
fonts.conf
diff --git a/docs/_config.yml b/docs/_config.yml
new file mode 100644
index 0000000..e69de29
diff --git a/docs/build.sh b/docs/build.sh
new file mode 100755
index 0000000..bd5e8a8
--- /dev/null
+++ b/docs/build.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+# Assemble the Pages site: docs/ + release assets → $OUT
+#
+# Env vars:
+# OUT output directory, relative to repo root (default: _site)
+# TAG release tag to pull assets from (default: latest)
+# REPO GitHub repo (default: ipython/xkcd-font)
+set -euo pipefail
+
+OUT="${OUT:-build/html}"
+TAG="${TAG:-}"
+REPO="${REPO:-ipython/xkcd-font}"
+
+DOCS="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+ROOT="$(cd "$DOCS/.." && pwd)"
+DEST="$ROOT/$OUT"
+
+rm -rf "$DEST"
+mkdir -p "$DEST/assets"
+# Copy every doc source except this build script itself.
+rsync -a --exclude='build.sh' "$DOCS/" "$DEST/"
+
+download=(gh release download
+ --repo "$REPO"
+ --dir "$DEST/assets"
+ --pattern xkcd-script.otf
+ --pattern xkcd-script.ttf
+ --pattern xkcd-script.woff
+ --pattern xkcd-script.woff2
+ --pattern xkcd-mathjax3.js)
+[ -n "$TAG" ] && download+=("$TAG")
+
+"${download[@]}"
+
+echo "Site assembled at $DEST"
diff --git a/docs/mathjax/index.html b/docs/mathjax/index.html
new file mode 100644
index 0000000..1842224
--- /dev/null
+++ b/docs/mathjax/index.html
@@ -0,0 +1,218 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
Large operators: inline vs display
+
+
Inline: $\sum_{k=1}^{n} k$ and $\int_0^1 x^2\,dx$ and $\prod_{k=1}^{n} k$
+
+
Display:
+$$\sum_{k=1}^{n} k = \frac{n(n+1)}{2}$$
+$$\int_0^\infty e^{-x}\,dx = 1 \qquad \int_{-\infty}^{\infty} e^{-x^2}\,dx = \sqrt{\pi}$$
+$$\prod_{p\;\text{prime}} \frac{1}{1-p^{-s}} = \sum_{n=1}^{\infty} \frac{1}{n^s}$$
+
+
+
Algebra
+
+
Quadratic formula:
+$$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$
+
+
Pythagorean theorem: $a^2 + b^2 = c^2$
+
+
Binomial theorem:
+$$\sum_{k=0}^{n} \binom{n}{k} x^k y^{n-k} = (x + y)^n$$
+
+
Calculus
+
+
Definition of derivative:
+$$f'(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}$$
+
+
Gaussian integral:
+$$\int_{-\infty}^{\infty} e^{-x^2}\,dx = \sqrt{\pi}$$
+
+
Product rule: $\dfrac{d}{dx}\bigl[f(x)\,g(x)\bigr] = f'(x)\,g(x) + f(x)\,g'(x)$
+
+
Greek letters
+
+
Euler's identity: $e^{i\pi} + 1 = 0$
+
+
$\alpha,\ \beta,\ \gamma,\ \delta,\ \varepsilon,\ \zeta,\ \eta,\
+ \theta,\ \iota,\ \kappa,\ \lambda,\ \mu,\ \nu,\ \xi,\ \pi,\
+ \rho,\ \sigma,\ \tau,\ \upsilon,\ \phi,\ \chi,\ \psi,\ \omega$
+
+
Fourier transform:
+$$\hat{f}(\xi) = \int_{-\infty}^{\infty} f(x)\,e^{-2\pi i x \xi}\,dx$$
+
+
Physics
+
+
Einstein: $E = mc^2$
+
+
Schrödinger equation:
+$$i\hbar\frac{\partial\psi}{\partial t} = \hat{H}\psi$$
+
+
Maxwell in free space:
+$$\nabla \cdot \mathbf{E} = 0 \qquad \nabla \times \mathbf{E} = -\frac{\partial \mathbf{B}}{\partial t}$$
+
+
Piecewise definitions (stretchy {)
+
+
Two rows (short brace):
+$$|x| = \begin{cases} x, & \text{if } x \geq 0 \\ -x, & \text{if } x < 0 \end{cases}$$
+
+
Four rows (tall brace):
+$$f(x) = \begin{cases}
+ \dfrac{\sin x}{x}, & \text{if } x > 0 \\[6pt]
+ \displaystyle\sum_{k=0}^{\infty} \frac{(-1)^k x^{2k}}{(2k+1)!}, & \text{if } x = 0 \\[6pt]
+ -\sqrt{|x|}, & \text{if } -1 \leq x < 0 \\[4pt]
+ \infty, & \text{otherwise}
+\end{cases}$$
+
+
Stretchy delimiters
+
+
Two-high (\binom):
+$$\binom{n}{k}$$
+
+
Around a fraction:
+$$\left( \dfrac{\frac{a}{b}}{\frac{c}{d}} \right)^{n} \qquad
+ \left[ \dfrac{\frac{a}{b}}{\frac{c}{d}} \right]^{n}$$
+
+
3×3 matrix:
+$$\begin{pmatrix}
+ a_{11} & a_{12} & a_{13} \\
+ a_{21} & a_{22} & a_{23} \\
+ a_{31} & a_{32} & a_{33}
+\end{pmatrix} \qquad
+\begin{bmatrix}
+ a_{11} & a_{12} & a_{13} \\
+ a_{21} & a_{22} & a_{23} \\
+ a_{31} & a_{32} & a_{33}
+\end{bmatrix}$$
+
+
Stretchy arrows
+
+
Vector accents: $\vec{v},\ \vec{F},\ \vec{p},\ \vec{\mathbf{0}},\ \vec{\mathbf{B}},\ \vec{ABC},\ \overrightarrow{ABC},\ \overleftarrow{ABC}$
+
+
Stretchy operators with labels:
+$A \xrightarrow{f} B \xrightarrow{n+\mu-1} C \qquad X \xleftarrow{g} Y$
+
+
AMScd commutative diagram:
+$$\begin{CD} A @>f>> B \\ @VgVV @VVhV \\ C @>>k> D \end{CD}$$
+
+
+
+
diff --git a/docs/preview.html b/docs/preview.html
new file mode 100644
index 0000000..f5600f7
--- /dev/null
+++ b/docs/preview.html
@@ -0,0 +1,11 @@
+
+
+
+