Collapsible sections

A spoiler hides its body behind a summary line until the reader expands it. The classic academic use: solutions and hints under a problem statement.

::::spoiler[Solution]
Substitute $u = x^2$; the integral becomes elementary:
 
$$
\int_0^1 2x e^{x^2} \, dx = e - 1
$$
::::
Solution

Substitute ; the integral becomes elementary:

  • The [label] is the always-visible summary line. Without one it reads "Details".
  • The body is full Markdown, including math, code, and nested directives (outer fence gets more colons – see nesting).
  • Spoilers render as the native HTML <details> element, so they work without any scripting and are keyboard-accessible. Writing raw <details><summary>...</summary></details> HTML produces the same result; the directive is the readable form.

Collapsed content is still on the page – it is part of the document for search and for anyone who expands it. Do not hide anything a reader must see to understand the text.