skip to content
 all entries

markdown kitchen sink

exhaustive feature test for the prose pipeline — headings, inline, code, math, tables, lists, footnotes, raw html

This page exists to stress every feature the markdown pipeline ships with — drop cap, headings down to h6, inline emphasis, three flavours of list, code blocks in three languages, tables with alignment, KaTeX math (inline + display + aligned + matrix + cases), footnotes, blockquotes, horizontal rules, raw HTML, sub/superscript, kbd, mark, abbr, definition lists, task lists. If anything looks ugly, this page is where to find it.

headings

h1 — page title (rare in body)

h2 — section

h3 — subsection

h4 — sub-subsection

h5 — minor heading
h6 — minimal heading

inline emphasis

This is italic, this is bold, this is bold italic, this is strikethrough, this is inline code, this is an unstyled link, this is a link with a title. A soft break
inside a paragraph (note the two trailing spaces above). Subscript: water is H2O. Superscript: the area of a circle is πr2. Highlighted text stays inside the run, and Cmd+K keys read as keys. The HTML standard ships with abbreviations.

blockquotes

A single-line quote. italic, bold, code, ζ(s)\zeta(s), all inline.

Multi-line: the second line of the same quote should hang neatly under the first without breaking the left rule.

Nested quotes:

inner quote

and one deeper

lists

unordered

  • alpha
  • beta — with a longer description that wraps onto a second line so we can see how the bullet aligns to the first line
  • gamma
    • nested gamma · 1
    • nested gamma · 2
      • and a deeper child
  • delta

ordered

  1. first item
  2. second item
  3. third item
    1. sub-first
    2. sub-second
    3. sub-third
  4. fourth item

mixed nesting

  1. ordered parent
    • unordered child
    • another unordered child
      1. ordered grandchild
      2. another ordered grandchild
  2. second ordered parent

task list (GFM)

  • write the kitchen-sink post
  • enable KaTeX, color-code variables, hook synthwave shiki
  • add per-page substrate fn
  • OG image
  • roll panel toolkit through flow / scry / lattice

definition list

math
the language of structure
code
the executable form of math
art
math made visible — sometimes audible, occasionally edible

horizontal rule

text above the rule


text below the rule

code blocks

Inline first: const φ = (1 + Math.sqrt(5)) / 2; and var(--accent).

A typescript block with a filename, line markers, and inline marks:

src/lab/palette.ts
// generate evenly-distributed hues by the golden angle
const phi = (1 + Math.sqrt(5)) / 2;
const goldenStep = 360 / phi; // ≈ 222.4922°
const palette = (n: number, h0: number, l = 76, c = 0.18) =>
Array.from({ length: n }, (_, i) =>
`oklch(${l}% ${c} ${(h0 + i * goldenStep) % 360})`
);
palette(8, 170);
// → ['oklch(76% 0.18 170)', 'oklch(76% 0.18 32.5)', ...]

A glsl fragment with a filename:

src/lab/fractal.frag.glsl
#version 300 es
precision highp float;
uniform vec2 u_res;
out vec4 fragColor;
void main() {
vec2 q = (gl_FragCoord.xy - 0.5 * u_res) / min(u_res.x, u_res.y);
float r = length(q);
vec3 col = 0.5 + 0.5 * cos(6.28 * (vec3(0.0, 0.33, 0.66) + r));
fragColor = vec4(col, 1.0);
}

A python block:

mandelbrot.py
# Mandelbrot escape time, smooth
import numpy as np
def escape(c, max_iter=256):
z = 0.0 + 0.0j
for n in range(max_iter):
z = z * z + c
if abs(z) > 2:
return n - np.log2(np.log2(abs(z) ** 2)) + 4
return max_iter

A terminal frame (no language → terminal-style chrome):

run
pnpm install
pnpm dev
# server up at http://127.0.0.1:4321/

A plain (no-language, no title) block:

+-------------------+
| ascii diagrams |
| also work fine |
+-------------------+

tables

simple

symbolmeaning
partial derivative
contour integral
ζRiemann zeta
∇²Laplacian

with alignment

leftcentreright
abc
100200300
longer textxxx · yyyright-bias
shortmiddleπ\pi

with inline content

keydescriptioncode
bolditalicinline()
mathinline πr2\pi r^2symbol E\nabla \cdot \mathbf{E}
linkastromixed: id + \sum
oldstrike text--var-l: 78%

math

Inline: Euler’s identity eiπ+1=0e^{i\pi} + 1 = 0 has every fundamental constant.

Display:

Cf(z)dz=2πikRes(f,zk)\oint_C f(z)\,\mathrm{d}z = 2\pi i \sum_{k} \mathrm{Res}(f, z_k)

Aligned (Maxwell’s equations):

E=ρε0,B=0,×E=Bt,×B=μ0J+μ0ε0Et\begin{aligned} \nabla \cdot \mathbf{E} &= \frac{\rho}{\varepsilon_0}, & \nabla \cdot \mathbf{B} &= 0, \\ \nabla \times \mathbf{E} &= -\frac{\partial \mathbf{B}}{\partial t}, & \nabla \times \mathbf{B} &= \mu_0 \mathbf{J} + \mu_0 \varepsilon_0 \frac{\partial \mathbf{E}}{\partial t} \end{aligned}

Matrix and inverse:

A=(abcd),A1=1adbc(dbca)A = \begin{pmatrix} a & b \\ c & d \end{pmatrix}, \quad A^{-1} = \frac{1}{ad - bc} \begin{pmatrix} d & -b \\ -c & a \end{pmatrix}

Piecewise:

f(x)={x2x0xx<0f(x) = \begin{cases} x^2 & x \ge 0 \\ -x & x < 0 \end{cases}

Continued fraction:

φ=1+11+11+11+\varphi = 1 + \cfrac{1}{1 + \cfrac{1}{1 + \cfrac{1}{1 + \cdots}}}

Sums and integrals with limits:

ζ(s)=n=11ns=pprime11ps,Γ(z)=0tz1etdt\zeta(s) = \sum_{n=1}^{\infty} \frac{1}{n^s} = \prod_{p \,\text{prime}} \frac{1}{1 - p^{-s}}, \qquad \Gamma(z) = \int_0^{\infty} t^{z-1} e^{-t}\,\mathrm{d}t

footnotes

The smoothing trick1 removes integer banding. The Riemann hypothesis2 is still open. A trailing reference to the same footnote1 should reuse the same number.

images

The site’s favicon (small svg) inline:

phunction.sh favicon

raw html that markdown wouldn’t otherwise reach

A <details> block:

Click to expand a folded note

Inside a <details> block, prose still works fine — italic, bold, code, even ζ(s)\zeta(s) inline math. Nested:

  • bullet inside details
  • another bullet

A <figure> with caption:

z[n+1] = z[n]² + c
fig 1 — the Mandelbrot recurrence in ASCII

diagrams (mermaid)

Flowchart:

flowchart LR
  A[markdown source] --> B{has math?}
  B -->|yes| C[remark-math + rehype-katex]
  B -->|no| D[plain prose]
  C --> E[per-variable colorize]
  D --> F[shiki / expressive-code]
  E --> G[rendered page]
  F --> G
  G --> H((reader))

Sequence:

sequenceDiagram
  autonumber
  participant U as user
  participant B as browser
  participant S as static site
  U->>B: open /blog/post
  B->>S: GET /blog/post/index.html
  S-->>B: pre-rendered HTML + KaTeX + Shiki
  B->>B: hydrate diagrams (lazy)
  B-->>U: paint
  Note over B: no FOUC, no client-side TeX

State diagram (a fractal pixel’s life):

stateDiagram-v2
  [*] --> Iterating
  Iterating --> Iterating: |z|² ≤ 256
  Iterating --> Escaped: |z|² > 256
  Iterating --> Bound: n ≥ maxIter
  Escaped --> Coloured: μ = n − log₂log₂|z|² + C
  Bound --> Black
  Coloured --> [*]
  Black --> [*]

Class diagram (the lab _shared module surface):

classDiagram
  class GL {
    +getGL(canvas) WebGL2RenderingContext
    +program(gl, vs, fs) WebGLProgram
    +quadVAO(gl) VAO
    +loop(step) stop
  }
  class Panel {
    +createPanel(opts) Panel
    +bind(target, key, opts)
    +folder(title, build)
    +button(label, onClick)
  }
  class Lab {
    +run(canvas) stop
  }
  Lab ..> GL : uses
  Lab ..> Panel : uses

Pie chart (Mermaid):

pie showData
  title where the bytes go
  "shaders + lab JS" : 38
  "katex (fonts + css)" : 22
  "fonts (redaction + krypton)" : 18
  "mermaid + chart + cyto" : 14
  "everything else" : 8

charts (chart.js)

A line chart of compute-over-time on the iteration loop:

A grouped bar chart of the lab inventory:

A radar chart (palette token coverage):

graphs (cytoscape)

A small force-directed dependency graph of the lab modules:

a final paragraph

If anything on this page looks broken — a bullet that doesn’t sit right, a table without padding, a footnote arrow that disappears, an <abbr> underline that’s invisible — the styles to fix it live in src/styles/global.css under the .prose selector.

Footnotes

  1. Renormalised iteration count: μ=nlog2log2zn2+C\mu = n - \log_2 \log_2 |z_n|^2 + C. Falls out of zn+1zn2|z_{n+1}| \approx |z_n|^2 near escape. 2

  2. Every non-trivial zero of ζ(s)\zeta(s) has (s)=12\Re(s) = \tfrac{1}{2} — conjectured 1859, unsolved.