Admonition Reference

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:

  1. Remove all API keys and secrets
  2. Enable HTTPS
  3. Update dependencies
    • Check for vulnerabilities
    • Run npm audit fix
  4. 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

  1. Update _config.yml
  2. Set site title and description
  3. 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

OSRangeCount
Linux32768-6099928232
Windows49152-6553516384
macOS49152-6553516384

Nested Formatting

โŒCommon Pitfalls

Avoid these mistakes:

  1. Hardcoded paths

    // โŒ Bad
    const path = 'C:\\Users\\neo\\file.txt';
    // โœ… Good
    const path = require('path').join(__dirname, 'file.txt');
  2. Missing error handling

    • Always use try-catch blocks
    • Validate user input
    • Log errors properly
  3. 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: