This post doubles as a template. Copy the bits you need into a new .mdx file.
Rust you can run
Edit the code and hit run (or Ctrl/Cmd+Enter). It compiles on the official Rust Playground, so the standard library and the playground’s popular crates are available.
WGSL on WebGPU
Write mainImage, return a color. The uniform u carries resolution, time, mouse, and the
current site theme’s colors, so the shader follows the theme switcher. Try pressing T.
GLSL on WebGL2
Shadertoy conventions, so most single-pass Shadertoy shaders paste straight in.
iBg, iAccent, and iAccent2 are the theme’s colors.
LaTeX
Inline math goes between single dollars, like . Display math goes between double dollars:
Plain code blocks
Fenced blocks get syntax highlighting that follows the theme, too.
#[repr(C)]
#[derive(Clone, Copy, bytemuck::Pod, bytemuck::Zeroable)]
struct Uniforms { view_proj: [[f32; 4]; 4], time: f32, _pad: [f32; 3] }