Classes
IconRole
3
▼
Role for inline SVG icons.
STUB: Icon rendering requires an icon resolver.
Without patitas[bengal]…
IconRole
3
▼
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
set_resolver
1
▼
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.
render
2
str
▼
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)