Skip to content

Latest commit

 

History

History
82 lines (61 loc) · 2 KB

File metadata and controls

82 lines (61 loc) · 2 KB

How directives work

Directives extend Markdown with additional features:

:::{note}
This is a callout box that stands out from regular text.
:::

How directive syntax works:

  • ::: opens and closes the directive block
  • {note} is the directive type (always in curly braces)
  • Content inside is regular Markdown

Adding options

:::{image} screenshot.png
:alt: Dashboard overview <1>
:width: 600px
:::
  1. Options start with : and appear after the opening line.

Adding arguments

:::{include} shared-content.md
:::

The argument comes right after the directive name.

Nesting directives

To nest directives, add more colons to the outer directive:

::::{note}
Outer content

:::{hint}
Inner content
:::

More outer content
::::

Use four colons (::::) for the outer directive and three (:::) for the inner one. Need to nest deeper? Keep adding colons.

Exception: Literal blocks

Code blocks and applies_to blocks use backticks instead of colons to prevent content from being processed as Markdown:

```js
const x = 1;
```

Available directives

The following directives are available: