Skip to content

Instantly share code, notes, and snippets.

@jaeyson
Created May 25, 2025 06:04
Show Gist options
  • Save jaeyson/1480fbb2876264a190ce7000dbc1326a to your computer and use it in GitHub Desktop.
Save jaeyson/1480fbb2876264a190ce7000dbc1326a to your computer and use it in GitHub Desktop.
Github markdown admonition blocks

see:

Below are quoted from this discussion:

Alerts are an extension of Markdown used to emphasize critical information. On GitHub, they are displayed ith distinctive colors and icons to indicate the importance of the content.

An example of all five types:

> [!NOTE]  
> Highlights information that users should take into account, even when skimming.

> [!TIP]
> Optional information to help a user be more successful.

> [!IMPORTANT]  
> Crucial information necessary for users to succeed.

> [!WARNING]  
> Critical content demanding immediate user attention due to potential risks.

> [!CAUTION]
> Negative potential consequences of an action.

Here is how they are displayed:

Note

Highlights information that users should take into account, even when skimming.

Tip

Optional information to help a user be more successful.

Important

Crucial information necessary for users to succeed.

Warning

Critical content demanding immediate user attention due to potential risks.

Caution

Negative potential consequences of an action.

Update - 14 December 2023

Update - 14 November 2023

  • Add support for [!TIP] and [!CAUTION].
  • Add support for alerts in Markdown files on GitHub Mobile apps. (pending a obile app update)
  • Add support for various Markdown extensions such as Math rendering, relative links, task lists, animated mage player and footnotes.
  • Prevent alerts from being nested within other elements.
  • The initial syntax using e.g. **Note** isn't supported any longer.

Update - 12 October 2023

  • Fix bug where alerts aren't rendered in Markdown file previews
  • Add support for Wikis
  • Fix various issues with nested blockquotes

Update - 28 July 2023

Thank you all once again for providing a ton of feedback. Few more changes based on that:

  • Support for soft line break in Markdown files.
  • Visual improvements to stand out better in content and render appropriately with different font-sizes (omments vs. docs)
  • Minor bug fixes

Update - 26 July 2023

Thanks for all the comments, we are working on a handful of fixes. One of them is to support soft line reaks in Markdown documents, so it will work the same in comments versus docs.

Update - 21 July 2023

We've made several improvements in response to your feedback:

  • The output will now render as a div instead of a blockquote.
  • The text color has been changed to primary from the previous muted version.
  • We've tightened our parsing rules to prevent conflicts with other Markdown or HTML on the allowed list.
  • Consequently, a line break following the title is now required.
  • We've introduced a new alert type IMPORTANT.
  • A new syntax, [!NOTE], has been added, which will gradually replace the old one. However, the old syntax ill continue to work for some time.

Thanks to all for your valuable input on this topic!

Initial - 10 May 2022

To better highlight and separate certain information from the rest in your documentation on GitHub, we now ender a special and accessible note or warning blockquote in Markdown documents. We are using the xisting syntax for blockquote and bold text.

Note The first line must be exactly as shown below. The first letter is case sensitive. The second line can ontain your content.

This input:

> **Note**
> This is a note

> **Warning**
> This is a warning

Becomes:

Note This is a note

Warning This is a warning

Let us know what you think and how this helps you provide better documentation. Please note that this is a eta feature that might be subject to change.

:octocat: 🐳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment