# admonition

URL: /patitas/api/directives/builtins/admonition/
Section: builtins
Description: Admonition directive for callout boxes.

Supports standard admonition types:
- note: General information
- warning: Potential issues
- tip: Helpful suggestions
- danger: Serious risk
- error: Error conditions
- info: Informational callout
- example: Example content
- success: Success messages
- caution: Proceed carefully (maps to warning CSS)
- seealso: Related information

Example:
:::{note} Optional Title
:class: custom-class

This is the note content.
:::

Thread Safety:
Stateless handler. Safe for concurrent use across threads.

---

> For a complete page index, fetch /patitas/llms.txt.

Open LLM text
(/patitas/api/directives/builtins/admonition/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Fdirectives%2Fbuiltins%2Fadmonition%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Fdirectives%2Fbuiltins%2Fadmonition%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Fdirectives%2Fbuiltins%2Fadmonition%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Fdirectives%2Fbuiltins%2Fadmonition%2Findex.txt)

Module

#
`directives.builtins.admonition`

Admonition directive for callout boxes.

Supports standard admonition types:

- note: General information

- warning: Potential issues

- tip: Helpful suggestions

- danger: Serious risk

- error: Error conditions

- info: Informational callout

- example: Example content

- success: Success messages

- caution: Proceed carefully (maps to warning CSS)

- seealso: Related information

Example:

Optional Title

This is the note content.

Thread Safety:

Stateless handler. Safe for concurrent use across threads.

1Class1Function

## Classes

`AdmonitionDirective`

7

▼

Handler for admonition directives.

Renders callout boxes for notes, warnings, tips, etc.

Thread S…

Handler for admonition directives.

Renders callout boxes for notes, warnings, tips, etc.

Thread Safety:

```
Stateless handler. Safe for concurrent use.
```

#### Attributes

Name
Type
Description

`names`

`ClassVar[tuple[str, ...]]`

—

`token_type`

`ClassVar[str]`

—

`contract`

`ClassVar[DirectiveContract (/patitas/api/directives/contracts/#DirectiveContract) | None]`

—

`options_class`

`ClassVar[type[AdmonitionOptions (/patitas/api/directives/options/#AdmonitionOptions)]]`

—

`preserves_raw_content`

`ClassVar[bool]`

—

#### Methods

`parse`

6

`Directive (/patitas/api/nodes/#Directive)[AdmonitionOpti…`

▼

Build admonition AST node.

`def parse(self, name: str, title: str | None, options: AdmonitionOptions, content: str, children: Sequence[Block], location: SourceLocation) -> Directive[AdmonitionOptions]`

##### Parameters

Name
Type
Description

`name`
`—`

Admonition type (note, warning, etc.)

`title`
`—`

Custom title (uses type name if None)

`options`
`—`

Typed admonition options

`content`
`—`

Raw content (unused, prefer children)

`children`
`—`

Parsed child blocks

`location`
`—`

Source location

##### Returns

`Directive (/patitas/api/nodes/#Directive)[AdmonitionOptions (/patitas/api/directives/options/#AdmonitionOptions)]`

Directive node for AST

`render`

3

▼

Render admonition to HTML.

`def render(self, node: Directive[AdmonitionOptions], rendered_children: str, sb: StringBuilder) -> None`

##### Parameters

Name
Type
Description

`node`
`—`

Directive AST node

`rendered_children`
`—`

Pre-rendered child content

`sb`
`—`

StringBuilder for output

## Functions

`_render_admonition_icon`

1

`str`

▼

Render admonition icon using icon resolver.

`def _render_admonition_icon(icon_name: str) -> str`

##### Parameters

Name
Type
Description

`icon_name`
`str`

Name of the icon to render

##### Returns

`str`
