Skip to content

Container Blocks ​

Container blocks let you wrap Markdown content in fenced sections that a static site generator can render as custom HTML elements — callouts, tabs, cards, or anything your theme defines.

Syntax ​

::: section
Content inside the container.
:::

The opening fence uses three or more colons. The word after the colons is the type — passed as a data attribute to the rendered HTML. An optional parameter follows the type:

::: callout warning
Be careful with this setting.
:::

Nesting ​

Containers can be nested. The outer container needs the longer colon sequence: a line of colons closes the container that is open as soon as it has at least as many as that container's opening line, so an inner container with more colons would end the outer one early. The editor writes the fences this way by itself — one colon more than the deepest container inside, three for one without any:

:::: card
::: callout info
This is a note inside a card.
:::
Content after the callout.
::::

In the Editor ​

The container button in the toolbar (Ctrl+Shift+C, ⌘+Shift+C on a Mac) creates a container. With content selected, it wraps just that: a paragraph or heading the selection covers only in part is split at the selection's edge. With nothing selected, it adds an empty container at the cursor and moves the cursor into it, splitting the paragraph there if the cursor is in its middle. Inside a container, that makes a nested one.

To change a container's type or parameters, click the label at the top of its frame — the one with the pencil at its right end. Long parameters are cut short in the label; hovering it shows them in full.

The dialog also removes a container: its trash-can button unwraps it, keeping its content intact. An empty container goes without leaving anything behind.