Skip to main content

Alerts and callouts

Twain supports GitHub-style alerts: coloured callout boxes written as a blockquote whose first line is a marker.

Syntax

> [!NOTE]
> Useful information that users should know, even when skimming.

The marker on the first line sets the kind, and it must sit on a line of its own. Writing > [!NOTE] Careful here is not recognised: the blockquote stays an ordinary blockquote and the marker shows up as literal text. With the marker on its own line it is removed from the output, and you see a coloured box with a label and your text.

The five kinds

MarkerLabelColour
[!NOTE]NoteBlue
[!TIP]TipGreen
[!IMPORTANT]ImportantPurple
[!WARNING]WarningAmber
[!CAUTION]CautionRed

Markers are case-insensitive, so [!note] works the same as [!NOTE].

A blockquote without a marker on its first line stays an ordinary blockquote.

Relationship to MDX callouts

These alerts reuse the same markup as the MDX callout components (such as a Note or Warning component), so a document can mix both styles. One kind differs: [!CAUTION] renders red with the label Caution, whereas the MDX Caution component is treated as a warning, so it renders amber with the label Warning. The other four kinds match. See MDX components.