Skip to content

Markdown Extensions

Starlight includes Expressive Code for syntax highlighting, filenames, highlighted lines, diffs, and copy controls. This sample adds math processing with remark-math, rehype-katex, and KaTeX.

profile.jsx
export function Profile({ user }) {
const displayName = user.name ?? 'Anonymous'
return (
<article className="profile-card">
<h2>{displayName}</h2>
<p>{user.role}</p>
</article>
)
}
export const theme = {
primary: 'blue',
primary: 'purple',
radius: '0.75rem',
}

Footnotes keep supporting detail near the source.1

Inline math such as a2+b2\sqrt{a^2+b^2} and display math render through KaTeX:

∑i=1ni=n(n+1)2\sum_{i=1}^{n} i = \frac{n(n+1)}{2}
  1. This is the rendered footnote definition. ↩