Skip to main content

BBCodeConfig

ClassDataClassSource

BBCodeConfig(
hr: str = "hr",
inline_code: str = "noparse",
code_block: str = "code",
bold: str = "b",
italic: str = "i",
underline: str = "u",
strike: str = "strike",
spoiler: str = "spoiler",
link: str = "url",
h1: str = "h1",
h2: str = "h2",
h3: str = "h3",
h4: str = "h3",
h5: str = "h3",
h6: str = "h3",
h_default: str = "h3",
paragraph: str = "p",
quote: str = "quote",
list: str = "list",
olist: str = "olist",
list_item: str = "*",
table: str = "table",
table_row: str = "tr",
table_head: str = "th",
table_data: str = "td",
alert: AlertTitleConfigs = AlertTitleConfigs(note="quote", tip="quote", important="b", warning="u", caution="spoiler", tag_b="b", tag_i="i", tag_u="u", tag_strike="strike", tag_spoiler="spoiler")
)

Configurations of BBCode renderer.

Different forums may have different BBCode formats. For example, in some cases, the deleted text may be formated as [s]...[/s], not [strike]...[/strike].

This configuration type allows users to customize the BBCode tags for other usages.

The default format (i.e. BBCodeConfig()) is consistent with Steam's BBCode rules.

Fields​

NameTypeRequired
Description
hrstrThe tag used to render: hr.
inline_codestrThe tag used to render: inline code.
code_blockstrThe tag used to render: multi-line code.
boldstrThe tag used to render: bold text.
italicstrThe tag used to render: italic text.
underlinestrThe tag used to render: underlined text.
strikestrThe tag used to render: deleted text.
spoilerstrThe tag used to render: spoiler text.
linkstrThe tag used to render: url (link).
h1strThe tag used to render: title with level 1.
h2strThe tag used to render: title with level 2.
h3strThe tag used to render: title with level 3.
h4strThe tag used to render: title with level 4.
h5strThe tag used to render: title with level 5.
h6strThe tag used to render: title with level 6.
h_defaultstrThe tag used to render: title with the default level.
paragraphstrThe tag used to render: paragraph.
quotestrThe tag used to render: quote block.
liststrThe tag used to render: unordered list.
oliststrThe tag used to render: ordered list.
list_itemstrThe tag used to render: list item.
tablestrThe tag used to render: table.
table_rowstrThe tag used to render: table row.
table_headstrThe tag used to render: table header cell.
table_datastrThe tag used to render: table plain cell.
alertAlertTitleConfigsThe configurations of the tags related to the alert block.

Methods​

get_h_tag_by_level​

v_1: str = self.get_h_tag_by_level(level: int)

Get the heading tag by specifying the heading level.

Requires​

NameTypeRequired
Description
levelintThe heading (title) level. Can be 1~6.

Returns​

NameType
Description
v_1strThe heading tag. For example, get_h_tag_by_level(2) yields self.h2.