This guide shows how to use admonitions and directives in this blog’s markdown to improve content presentation.
Inline Directives :name[label]{attributes}
You can use inline directives to add special formatting or functionality to specific parts of your text. One common use case is to create styled buttons for keyboard shortcuts or UI elements:
:btn[cmd], :btn[shift], :btn[ctrl], :btn[opt], :btn[enter],
:btn[left], :btn[right], :btn[up], :btn[down], :btn[tab],
:btn[space], :btn[delete], :btn[esc], :btn[custom]Another example is embedding YouTube links directly in your text:
Watch this video on YouTube: :youtube[Click here]{#dQw4w9WgXcQ}.Block Directives ::name[label]{attributes}
You can also embed YouTube videos as standalone blocks using block directives:
::youtube[Watch this amazing video]{#dQw4w9WgXcQ}We also have a ::art directive for embedding decorative SVG patterns, which can be used to add visual interest to your posts:
::art{type="wave" color="blue"}Link card
Admonitions
Admonitions are specially formatted content blocks that help highlight important information.
Basic Syntax
:::type
Your content here
:::Available Types
:::note
This is a note admonition.
:::This is a note admonition.
This is an overview admonition.
This is a warning admonition.
This is an important admonition.
This is a tip admonition.
This is an example admonition.
This is a comment admonition.
This is a quote admonition.
This is a question admonition.
This is a simple admonition with a custom title.
This is a simple admonition without a title.
Custom Titles
:::note{title="Did you know?"}
You can customize the title of any admonition!
:::You can customize the title of any admonition!
Nested Admonitions
You can nest admonitions by using more colons in the opening and closing tags:
This is the outer admonition.
This is a nested important admonition.
Best Practices
- Use inline directives (
:) for elements that are part of your text flow - Use block directives (
::) for standalone elements like embeds - Choose appropriate admonition types based on your content
- Use clear, descriptive titles for your admonitions
- Don't overuse admonitions - use them to highlight truly important information