see:
- https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts
- https://github.blog/changelog/2023-12-14-new-markdown-extension-alerts-provide-distinctive-styling-for-significant-content/
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.
- Changelog: New Markdown extension: Alerts provide distinctive styling for significant ontent
- Updated documentation
- 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.
- Fix bug where alerts aren't rendered in Markdown file previews
- Add support for Wikis
- Fix various issues with nested blockquotes
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
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.
We've made several improvements in response to your feedback:
- The output will now render as a
div
instead of ablockquote
. - 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!
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.
🐳