Classes
KbdRole
4
▼
Handler for \{kbd}`key` role.
Renders keyboard shortcuts with proper semantics.
Syntax:
\{kbd…
KbdRole
4
▼
Handler for {kbd}keyrole.
Renders keyboard shortcuts with proper semantics.
Syntax:
\{kbd}`Ctrl+C` - Single shortcut
\{kbd}`Ctrl+Shift+P` - Multiple modifiers
\{kbd}`+` or \{kbd}`Plus` - The plus key itself
Thread Safety:
Stateless handler. Safe for concurrent use.
Attributes
| Name | Type | Description |
|---|---|---|
names |
ClassVar[tuple[str, ...]]
|
— |
token_type |
ClassVar[str]
|
— |
Methods
Parse kbd role content.
def parse(self, name: str, content: str, location: SourceLocation) -> Role
Parameters
| Name | Type | Description |
|---|---|---|
name |
— |
|
content |
— |
|
location |
— |
Returns
Role
render
2
▼
Render keyboard shortcut.
Wraps each key in tags for proper semantics.
Handle…
render
2
▼
def render(self, node: Role, sb: StringBuilder) -> None
Render keyboard shortcut.
Wraps each key in tags for proper semantics. Handles + as key separator, with special handling for the + key itself.
Parameters
| Name | Type | Description |
|---|---|---|
node |
— |
|
sb |
— |
AbbrRole
4
▼
Handler for \{abbr}`ABBR (expansion)` role.
Renders abbreviations with title attribute for expansi…
AbbrRole
4
▼
Handler for {abbr}ABBR (expansion)role.
Renders abbreviations with title attribute for expansion.
Syntax:
\{abbr}`HTML (HyperText Markup Language)`
Thread Safety:
Stateless handler. Safe for concurrent use.
Attributes
| Name | Type | Description |
|---|---|---|
names |
ClassVar[tuple[str, ...]]
|
— |
token_type |
ClassVar[str]
|
— |
Methods
Parse abbr role content.
Extracts abbreviation and expansion from "ABBR (expan…
def parse(self, name: str, content: str, location: SourceLocation) -> Role
Parse abbr role content.
Extracts abbreviation and expansion from "ABBR (expansion)" format.
Parameters
| Name | Type | Description |
|---|---|---|
name |
— |
|
content |
— |
|
location |
— |
Returns
Role
render
2
▼
Render abbreviation with title.
render
2
▼
def render(self, node: Role, sb: StringBuilder) -> None
Parameters
| Name | Type | Description |
|---|---|---|
node |
— |
|
sb |
— |
SubRole
4
▼
Handler for \{sub}`text` role.
Renders subscript text.
Syntax:
H\{sub}`2`O
Thread Safety:
…
SubRole
4
▼
Handler for {sub}text role.
Renders subscript text.
Syntax:
H\{sub}`2`O
Thread Safety:
Stateless handler. Safe for concurrent use.
Attributes
| Name | Type | Description |
|---|---|---|
names |
ClassVar[tuple[str, ...]]
|
— |
token_type |
ClassVar[str]
|
— |
Methods
Parse sub role content.
def parse(self, name: str, content: str, location: SourceLocation) -> Role
Parameters
| Name | Type | Description |
|---|---|---|
name |
— |
|
content |
— |
|
location |
— |
Returns
Role
render
2
▼
Render subscript.
render
2
▼
def render(self, node: Role, sb: StringBuilder) -> None
Parameters
| Name | Type | Description |
|---|---|---|
node |
— |
|
sb |
— |
SupRole
4
▼
Handler for \{sup}`text` role.
Renders superscript text.
Syntax:
E = mc\{sup}`2`
Thread Safe…
SupRole
4
▼
Handler for {sup}text role.
Renders superscript text.
Syntax:
E = mc\{sup}`2`
Thread Safety:
Stateless handler. Safe for concurrent use.
Attributes
| Name | Type | Description |
|---|---|---|
names |
ClassVar[tuple[str, ...]]
|
— |
token_type |
ClassVar[str]
|
— |
Methods
Parse sup role content.
def parse(self, name: str, content: str, location: SourceLocation) -> Role
Parameters
| Name | Type | Description |
|---|---|---|
name |
— |
|
content |
— |
|
location |
— |
Returns
Role
render
2
▼
Render superscript.
render
2
▼
def render(self, node: Role, sb: StringBuilder) -> None
Parameters
| Name | Type | Description |
|---|---|---|
node |
— |
|
sb |
— |