Module

roles.builtins.icons

Icon role handler.

STUB: This is a placeholder for icon role functionality. The full implementation requires an icon resolver from Bengal.

For full icon support, install patitas[bengal].

Classes

IconRole 3
Role for inline SVG icons. STUB: Icon rendering requires an icon resolver. Without patitas[bengal]…

Role for inline SVG icons.

STUB: Icon rendering requires an icon resolver. Without patitas[bengal], this role renders the icon name as text.

Usage (with patitas[bengal]): ... ...

Usage (without icon resolver): → [icon:github]

Attributes

Name Type Description
_resolver Callable[[str], str | None] | None

Methods

set_resolver 1
Set the icon resolver function.
classmethod
def set_resolver(cls, resolver: Callable[[str], str | None]) -> None
Parameters
Name Type Description
resolver

Function that takes icon name and returns SVG string or None

render 2 str
Render icon role to HTML.
def render(self, content: str, location: SourceLocation) -> str
Parameters
Name Type Description
content

Icon name (e.g., "github", "check")

location

Source location for error reporting

Returns
str HTML string (SVG if resolver available, placeholder otherwise)