Alert Extension
The alert extension provides the "alert" command, which provides a mechanism for making alert boxes to highlight important items within the markdown text. The available configuration items for this extension are provided in Table 1.
Table 1: Configuration items for the alert extension.
Key | Default | Description |
---|---|---|
active | True | Toggle for disabling the extension. This only changes the initial active state, use setActive to control at runtime. |
use-title-prefix | True | Enable/disable including the brand (e.g., ERROR) as prefix for the alert title. |
Basic Alert
There are four versions of alerts—error, warning, note, and tip—all of which are demonstrated in Example 1. The available settings for the alert command are listed in Table 2.
Table 2: Available settings for the !alert
command.
Key | Default | Description |
---|---|---|
style | None | The style settings that are passed to rendered HTML tag. |
class | None | The class settings to be passed to rendered HTML tag. |
id | None | The class settings to be passed to the rendered tag. |
title | None | The optional alert title. |
center-title | False | Center the title. |
prefix | None | Enable/disable the title being prefixed with the alert brand. |
icon | True | Enable/disable the title icon. |
icon-name | None | Set the icon name, see material icon for available options. |
Alert Title
Example 2 demonstrates the use of title setting within the !alert
command, which can contain inline markdown (see Inline Content).
Block Alert
The previous examples show the inline version (see Inline Content) of the alert command. Since, this command was built using the Command Extension there also exists a block version, which is demonstrated in Example 3.
Alert without Title
It is also possible to create an alert without a title, which may be useful for simply highlighting regions of text, this is done by omitting the title as well as setting the 'prefix' setting to false, as shown in Example 4.