Admonitions
Admonition Title
Indent admonition text with 4 spaces. Admonitions are specially marked topics that can appear anywhere an ordinary body element can. They contain arbitrary body elements. Typically, an admonition is rendered as an offset block in a document, sometimes outlined or shaded, with a title matching the admonition type.
Markdown for the admonition above:
!!! abstract "Admonition Title"
**Indent**{! style="color: teal;"} admonition text with 4 spaces. Admonitions are specially marked "topics" that can appear anywhere an ordinary body element can. They contain arbitrary body elements.
Typically, an admonition is rendered as an offset block in a document, sometimes outlined or shaded, with a title matching the admonition type.
Collapsible Admonitions
Collapsible admonitions show a right-caret icon on the callout box so that the text area can be opened and closed by the user. To make an admonition callout collapsibile, substitute three question marks for the leading exclamation marks: $$$ instead of !!!.
The pymdownx.details extension adds the collapsible option. Enable it under markdown_extensions in the mkdocs.yml configuration file:
This Collapsible Admonition defaults to the closed state.
Indent admonition text with 4 spaces. Admonitions are specially marked topics that can appear anywhere an ordinary body element can. They contain arbitrary body elements. Typically, an admonition is rendered as an offset block in a document, sometimes outlined or shaded, with a title matching the admonition type.
Markdown for the collapsible admonition above:
??? abstract "This Collapsible Admonition defaults to the closed state."
**Indent**{! style="color: teal;"} admonition text with 4 spaces. Admonitions are specially marked "topics" that can appear anywhere an ordinary body element can. They contain arbitrary body elements.
Typically, an admonition is rendered as an offset block in a document, sometimes outlined or shaded, with a title matching the admonition type.
This Collapsible Admonition defaults to the expanded state.
Indent admonition text with 4 spaces. Admonitions are specially marked topics that can appear anywhere an ordinary body element can. They contain arbitrary body elements. Typically, an admonition is rendered as an offset block in a document, sometimes outlined or shaded, with a title matching the admonition type.
Right-side Inline Callout
Right Inline Callout Block
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
Sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis.
Admonitions can be rendered as inline blocks (e.g., for sidebars), placing them to the right using the ‘inline end’ modifiers:
Important: Admonitions that use the inline modifiers must be declared prior to the content block you want to place them beside. If there’s insufficient space to render the admonition next to the block, the admonition will stretch to the full width of the viewport, e.g., on mobile viewports.
Sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa.
Left-side Inline Callout
Left Inline Callout Block
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
Sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis.
Admonitions can be rendered as inline blocks (e.g., for sidebars), placing them to the left using the ‘inline’ modifier:
Important: Admonitions that use the inline modifiers must be declared prior to the content block you want to place them beside. If there’s insufficient space to render the admonition next to the block, the admonition will stretch to the full width of the viewport, e.g., on mobile viewports.
Sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa.
Other Admonition Types
Note
note
Abstract
abstract, summary, tldr
Info
info, todo
Tip
tip, hint, important
Success
success, check, done
Question
question, help, faq
Warning
warning, caution, attention
Failure
failure, fail, missing
Danger
danger, error
Bug
bug
Example
example, snippet
Quote
quote, cite
Advanced examples
Example
“foldable admonition”
foldable admonition thanks to the extension ‘pymdownx.details’. Instead of ‘!’ use ‘?’. Use a ‘+’ character right after the questionmarks to have it expanded by default.
??? example "foldable admonition"
foldable admonition thanks to the extension 'pymdownx.details'. Instead of '!' use '?'.
Use a '+' character right after the questionmarks to have it expanded by default.
foldable and tabbed
```yaml tab=”Wrong way”
apache:
startservers: 2
maxclients: 2
yaml tab=”Preferred way”
apache_startservers: 2
apache_maxclients: 250
```
??? example "foldable and tabbed"
```yaml tab="Wrong way"
apache:
startservers: 2
maxclients: 2
```
```yaml tab="Preferred way"
apache_startservers: 2
apache_maxclients: 250
```