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 three versions of alerts—error, warning, and note—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
styleThe style settings that are passed to rendered HTML tag.
titleNoneThe optional alert title.
idThe class settings to be passed to the rendered tag.
prefixNoneEnable/disable the title being prefixed with the alert brand.
classThe class settings to be passed to rendered HTML tag.
iconTrueEnable/disable the icon.

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.
error

This is an error alert.

warning

This is a warning alert.

note

This is a note 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 wihtin the !alert command.

!alert warning title=This +is+ an =error=.
Do not do this, *it is bad*, umk.
warning: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!
note

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 ommitting the title as well as setting the 'prefix' setting to false, as shown in Example 4.

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

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

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