简介
该微件用于展示一条提示信息。
Markdown Blockquotes
类型
与 GitHub Alerts 兼容,支持五个类型 (Note, Tip, Important, Warning, Caution):
Markdown > [!NOTE] > Useful information that users should know, even when skimming content. > [!TIP] > Helpful advice for doing things better or more easily. > [!IMPORTANT] > Key information users need to know to achieve their goal. > [!WARNING] > Urgent info that needs immediate user attention to *avoid problems*. > [!CAUTION] > Advises about **risks** or negative outcomes of certain actions.
渲染效果 提醒 NoteUseful information that users should know, even when skimming content.
提示 TipHelpful advice for doing things better or more easily.
重要 ImportantKey information users need to know to achieve their goal.
警告 WarningUrgent info that needs immediate user attention to avoid problems.
注意 CautionAdvises about risks or negative outcomes of certain actions.
额外添加四个类型 (Info, Success, Error, Danger):
Markdown > [!INFO] > The quick brown ~~fox~~ jumps over the lazy dog. > [!SUCCESS] > The quick brown fox jumps over the lazy dog. > [!ERROR] > The quick brown fox jumps over the lazy dog. > [!DANGER] > The quick brown fox jumps over the lazy dog.
渲染效果 信息 InfoThe quick brown
foxjumps over the lazy dog.成功 SuccessThe quick brown fox jumps over the lazy dog.
错误 ErrorThe quick brown fox jumps over the lazy dog.
危险 DangerThe quick brown fox jumps over the lazy dog.
标题
可覆盖默认的标题:
| Markdown | > [!INFO] 这是一条提示信息 > The quick brown fox jumps over the lazy dog. |
|---|---|
| 渲染效果 | 这是一条提示信息 The quick brown fox jumps over the lazy dog. |
短代码
参数
| 名称 | 类型 | 必要 | 值 | 描述 |
|---|---|---|---|---|
type | 是 | (见上方,共 9 个类型) | 提示类型 | |
title | 否 | 提示的标题,默认与类型相关 | ||
icon | 否 | 提示的图标,默认与类型相关 设置为 false 禁用图标 | ||
small | 否 | true、false(默认) | 小号的提示 | |
simple | 否 | true、false(默认) | 简化的提示 |
示例
| Markdown | {{% notice type="info" %}}The quick brown fox jumps over the lazy dog.{{%/notice%}}
{{% notice type="info" icon=false %}}这是一个**没有图标**的提示{{%/notice%}}
{{% notice type="info" icon="bi-pen" %}}这是一个指定了**图标**的提示{{%/notice%}}
{{% notice type="info" icon="bi-pen" title="Pen" %}}这是一个指定了**图标**和**标题**的提示{{%/notice%}}
{{% notice type="tip" small=true %}}这是一个小号的提示{{%/notice%}}
{{% notice type="tip" simple=true %}}这是一个简化的提示{{%/notice%}}
{{% notice type="tip" simple=true small=true %}}这是一个简化的小号的的提示{{%/notice%}}
{{% notice type="tip" simple=true small=true icon=false %}}这是一个没有图标的简化的小号的的提示{{%/notice%}} |
|---|---|
| 渲染效果 | 信息 Info The quick brown fox jumps over the lazy dog. 信息 Info 这是一个没有图标的提示 信息 Info 这是一个指定了图标的提示 Pen 这是一个指定了图标和标题的提示 提示 Tip 这是一个小号的提示 这是一个简化的提示 这是一个简化的小号的的提示 这是一个没有图标的简化的小号的的提示 |
局部模板
widgets\notice.html
参数
| 名称 | 类型 | 必要 | 值 | 描述 |
|---|---|---|---|---|
page | 是 | |||
type | 是 | (见上方,共 9 个类型) | 提示类型 | |
content | 否 | 提示的内容 | ||
title | 否 | 提示的标题,默认与类型相关 | ||
icon | 否 | 提示的图标,默认与类型相关 设置为 false 禁用图标 | ||
small | 否 | true、false(默认) | 小号的提示 | |
simple | 否 | true、false(默认) | 简化的提示 |