Command Palette
Search for a command to run...

Markdoc tags

A reference for the custom blocks layered on top of Markdown, plus the enhanced Markdown elements. For usage with examples, see Authoring.

Custom tags

callout

{% callout type="info" title="Optional title" %}
Body Markdown.
{% /callout %}
AttributeValuesDefault
typeinfo, warn, danger, successinfo
titlestring(none)

tabs / tab

{% tabs labels="One, Two" initial="One" %}
  {% tab label="One" %} … {% /tab %}
  {% tab label="Two" %} … {% /tab %}
{% /tabs %}
TagAttributeNotes
tabslabelsComma-separated list of every tab, in order. Required.
tabsinitialTab open on load. Defaults to the first.
tablabelMust match a name in the parent's labels. Required.

screenshot

{% screenshot src="ui.png" alt="The UI" caption="…" dark="ui-dark.png"
   variant="frame" width="720px" /%}
AttributeRequiredNotes
srcyesFile under static/screenshots/.
altyesAccessible description.
captionnoCaption text.
darknoAlternate image for dark mode.
variantnoframe (default) or flat.
widthnoMax width, e.g. 720px.

steps / step

{% steps %}
  {% step title="First" %} … {% /step %}
  {% step title="Second" %} … {% /step %}
{% /steps %}

step takes an optional title. Numbering is automatic.

cards / card

{% cards %}
  {% card title="…" href="/path" icon="🚀" %} description {% /card %}
{% /cards %}
TagAttributeNotes
cardtitleCard heading.
cardhrefOptional link (internal path or external URL).
cardiconEmoji, inline <svg>, or a path under static/.

accordions / accordion

{% accordions %}
  {% accordion title="Question?" %} answer {% /accordion %}
{% /accordions %}
TagAttributeNotes
accordiontitleThe summary text. Native <details>.
accordionsexclusiveGroup wrapper; true (default) opens one at a time, false allows several. Optional — accordion also works standalone.

badge

{% badge variant="warning" %}Beta{% /badge %}

Inline pill. variant: default, info, success, warning, danger.

filetree

{% filetree %}
- folder/
  - file.md
{% /filetree %}

Styles a nested Markdown list as a directory tree (folders vs files are auto-detected).

embed

{% embed src="https://youtu.be/ID" title="…" /%}

Responsive video iframe. YouTube/Vimeo URLs are normalised, and the CSP iframe allow-list is derived from your embeds automatically.

code

{% code title="app.ts" %}
```ts
const x = 1;
```
{% /code %}

Adds a filename header to a fenced code block (Markdoc drops fence meta, so the filename rides on this wrapper).

boost

{% boost weight=8 %}
This passage is pushed harder in the search index.
{% /boost %}

Invisible search-ranking hint — renders the content unchanged but weights it in Pagefind. Body text is weight 1 and headings are 10/5/3, so weight (default 5) lifts a key passage above ordinary prose. Use it only when the built-in heading weights aren't enough to surface something.

Enhanced Markdown

These need no special syntax — plain Markdown gets the behavior automatically:

ElementBehavior
Headings (##+)Get anchor ids, feed the table of contents, and show a copy-link icon on hover.
LinksExternal links open in a new tab with safe rel attributes.
Code fencesSyntax-highlighted (Shiki) with a copy button; // [!code highlight] / ++ / -- comments add line-highlighting and diffs.
mermaid fencesRendered as themed diagrams.