This page is the canonical catalog of every admonition variant supported by the markdown pipeline.
Admonition Blocks
anote - General Notes
Quick Note
This is a general note block for observations and additional context.
info - Additional Information
Pro Tip
Use absolute paths when referencing assets in localized content.
todo - Task Reminders
Action Items
- Add excerpt to all blog posts
- Verify tag capitalization
- Test mermaid diagrams
warning - Important Warnings
Breaking Change
Hexo 8.x requires Node.js 14.0.0 or higher. Update your environment before upgrading.
error - Critical Issues
Common Mistake
Do not use note type - it conflicts with CSS. Always use anote instead.
success - Positive Outcomes
Build Successful
Your site has been generated successfully and is ready for deployment.
tip - Best Practices
Performance Optimization
Enable lazy loading for images to improve page load times.
question - Considerations
Design Decision
Should we use Git Flow or GitHub Flow for this project?
quote - Citations
Linus Torvalds
Talk is cheap. Show me the code.
Additional Admonition Types
The following types share the same syntax but ship with different default titles and icons:
danger - Critical Hazards
Hazardous Operation
This action is irreversible. Proceed with extreme caution.
attention - Heads Up
Please Read
Verify the recipient address before sending the request.
caution - Be Careful
Slow Path
This branch performs a full table scan on large datasets.
failure - Operation Failed
Test Suite
5 of 47 tests failed. See the report for details.
missing - Missing Required Input
Required Field
The apiKey field must be provided in the configuration object.
fail - Concise Failure
Build Failed
Compilation error in src/utils/parser.ts.
bug - Known Defect
Issue #142
Inline math fails to render when the expression starts with \(.
Collapsible Admonitions
Set collapsible="+" to render open by default, or collapsible="-" to render closed.
Code:
:::warning{title="Click to expand" collapsible="-"}
Hidden details revealed only when expanded.
:::
:::info{title="Open by default" collapsible="+"}
This section starts expanded. Click the summary to collapse it.
:::
Result:
Click to expandโผ
Hidden details revealed only when expanded.
Open by defaultโผ
This section starts expanded. Click the summary to collapse it.
Directive Label Title Syntax
Instead of title="...", you can set the title with the first child as a [label]:
Code:
:::warning[Breaking Change in v3]
The default export was removed. Use named exports instead.
:::
Result:
Breaking Change in v3
The default export was removed. Use named exports instead.
Advanced Formatting Inside Blocks
Lists Inside Admonition
Security Checklist
Before deploying:
- Remove all API keys and secrets
- Enable HTTPS
- Update dependencies
- Check for vulnerabilities
- Run
npm audit fix
- Test in staging environment
Blockquote Inside Admonition
Design Philosophy
Simplicity is the ultimate sophistication. โ Leonardo da Vinci This principle applies to code architecture and user interface design.
Mixed Content
Complete Setup Guide
Step 1: Install dependencies
npm install hexo-cli -g
Step 2: Create new project
- Initialize:
hexo init blog - Navigate:
cd blog - Install:
npm install
Step 3: Configuration checklist
- Update
_config.yml - Set site title and description
- Configure deployment settings
Note: Always backup your configuration before major changes.
Code Block Inside Admonition
Git Configuration
Set up your Git identity:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"Table Inside Admonition
Port Ranges
| OS | Range | Count |
|---|---|---|
| Linux | 32768-60999 | 28232 |
| Windows | 49152-65535 | 16384 |
| macOS | 49152-65535 | 16384 |
Nested Formatting
Common Pitfalls
Avoid these mistakes:
-
Hardcoded paths
// โ Bad const path = 'C:\\Users\\neo\\file.txt'; // โ Good const path = require('path').join(__dirname, 'file.txt'); -
Missing error handling
- Always use try-catch blocks
- Validate user input
- Log errors properly
-
Ignoring async/await
Callbacks lead to โcallback hellโ. Use modern async patterns.
LaTeX in Admonitions
LaTeX expressions render inside admonition bodies too. This exercises both the admonition plugin and the KaTeX pipeline in a single block.
Code:
:::info{title="LaTeX in Admonitions"}
Inline math: the quadratic formula is $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$.
Block math:
$$
\sum_{i=1}^{n} i^2 = \frac{n(n+1)(2n+1)}{6}
$$
:::
Result:
LaTeX in Admonitions
Inline math: the quadratic formula is .
Block math: