Skip to main content

AlertTitleConfigs

ClassDataClassSource

AlertTitleConfigs(
note: str = "quote",
tip: str = "quote",
important: str = "b",
warning: str = "u",
caution: str = "spoiler",
tag_b: str = "b",
tag_i: str = "i",
tag_u: str = "u",
tag_strike: str = "strike",
tag_spoiler: str = "spoiler"
)

The translation list of alert box titles.

Each field name will be interpreted as an allowed alert box title in Markdown. For example, users can write

> [!note]
> A example of note box.

which will be interpreted as

[quote]
A example of note box.
[/quote]

if AlertTitleConfigs.note == "quote".

Any alert box title that are not defined in this list will be interpreted as quote when rendering BBCode.

Fields​

NameTypeRequired
Description
notestrThe tag used to render the alert block with the type: note.
tipstrThe tag used to render the alert block with the type: tip.
importantstrThe tag used to render the alert block with the type: important.
warningstrThe tag used to render the alert block with the type: warning.
cautionstrThe tag used to render the alert block with the type: caution.
tag_bstrThe tag used to render the alert block with the type: tag_b.
tag_istrThe tag used to render the alert block with the type: tag_i.
tag_ustrThe tag used to render the alert block with the type: tag_u.
tag_strikestrThe tag used to render the alert block with the type: tag_strike.
tag_spoilerstrThe tag used to render the alert block with the type: tag_spoiler.

Methods​

render_title_as_tag​

v_1: str | None = self.render_title_as_tag(title: str)

Given a title specified in AlertNode, get the appropriate BBCode tag for it.

Requires​

NameTypeRequired
Description
titlestrGiven the title of an alert block, and use it to find the tag.

Returns​

NameType
Description
v_1str | None

The returned tag.

This method may return None. In this case, the AlertNode will fall back into a QuoteNode.