Skip to main content

ProtocolComponent

TypeSource

ProtocolComponent(*args: Any, **kwargs: Any)

A protocol providing components. This protocol will be implemented in renderer.components.

Arguments

Initialization function is not specified.

Protocol methods

icon_obj

v_1: str = self.icon_obj(
type: Literal[
"method", "op", "param", "package", "module", "class", "func", "type"
],
text: str = "",
)

The protocol of the subtitle icon.

Requires

NameTypeRequired
Description
typeLiteral["method", "op", "param", "package", "module", "class", "func", "type"]The name determining the icon.
textstrAn optional text after the icon. If it is empty, will only display the icon.

Returns

NameType
Description
v_1strThe MDX code of the icon-text.

inline_icon

v_1: str = self.inline_icon(icon: Literal["check"])

The protocol of special single icon.

Requires

NameTypeRequired
Description
iconLiteral["check"]The name determining the icon.

Returns

NameType
Description
v_1strThe MDX code of the icon.

Protocol properties

apibar

apibar: type[ComponentAPIBar] = self.apibar

The protocol of the top API bar. The returned value is a PyDantic model class.