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.

KeyDefaultDescription
activeTrueToggle for disabling the extension. This only changes the initial active state, use setActive to control at runtime.
use-title-prefixTrueEnable/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.

KeyDefaultDescription
styleNoneThe style settings that are passed to rendered HTML tag.
classNoneThe class settings to be passed to rendered HTML tag.
idNoneThe class settings to be passed to the rendered tag.
titleNoneThe optional alert title.
center-titleFalseCenter the title.
prefixNoneEnable/disable the title being prefixed with the alert brand.
iconTrueEnable/disable the title icon.
icon-nameNoneSet the icon name, see material icon for available options.

Example 1: Example of the three types of alerts: error, warning, and note.

!alert error
This is an error alert.

!alert warning
This is a warning alert.

!alert note
This is a note alert.

!alert tip
This is a tip alert.
reporterror

This is an error alert.

warningwarning

This is a warning alert.

commentnote

This is a note alert.

schooltip

This is a tip alert.

Alert Title

Example 2 demonstrates the use of title setting within the !alert command, which can contain inline markdown (see Inline Content).

Example 2: Example use of the title setting within the !alert command.

!alert warning title=This +is+ an =error=.
Do not do this, *it is bad*, umk.
warningwarning:This is an error.

Do not do this, it is bad, umk.

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.

Example 3: Example showing the block version of the !alert command.

!alert! note
> This is a block version
> that allows the use of
> block markdown syntax
> to be used.
!alert-end!
commentnote

This is a block version that allows the use of block markdown syntax to be used.

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.

Example 4: Example use of the title setting within the !alert command.

!alert note prefix=False
This is an alert without a title,
which might be useful for highlighting text.
comment

This is an alert without a title, which might be useful for highlighting text.