Classes
RefRole
4
▼
Handler for {ref}`target` role.
Creates a cross-reference to a labeled target. The target
is resol…
RefRole
4
▼
Handler for target role.
Creates a cross-reference to a labeled target. The target is resolved during rendering based on the document structure.
Syntax:
{ref}`target` - Uses target as both ID and display text
{ref}`display text <target>` - Custom display text
Thread Safety:
Stateless handler. Safe for concurrent use.
Attributes
| Name | Type | Description |
|---|---|---|
names |
ClassVar[tuple[str, ...]]
|
— |
token_type |
ClassVar[str]
|
— |
Methods
parse
3
Role
▼
Parse ref role content.
Handles both `target` and `text ` syntaxes.
parse
3
Role
▼
def parse(self, name: str, content: str, location: SourceLocation) -> Role
Parameters
| Name | Type | Description |
|---|---|---|
name |
— |
|
content |
— |
|
location |
— |
Returns
Role
render
2
▼
Render ref as a link placeholder.
Actual link resolution happens at a higher l…
render
2
▼
def render(self, node: Role, sb: StringBuilder) -> None
Render ref as a link placeholder.
Actual link resolution happens at a higher level (Bengal). Here we output a marker that can be resolved later.
Parameters
| Name | Type | Description |
|---|---|---|
node |
— |
|
sb |
— |
DocRole
4
▼
Handler for {doc}`path` role.
Creates a link to another document. The path is resolved
relative to…
DocRole
4
▼
Handler for path role.
Creates a link to another document. The path is resolved relative to the current document.
Syntax:
{doc}`/path/to/doc` - Link to document
{doc}`display text </path/to/doc>` - Custom display text
Thread Safety:
Stateless handler. Safe for concurrent use.
Attributes
| Name | Type | Description |
|---|---|---|
names |
ClassVar[tuple[str, ...]]
|
— |
token_type |
ClassVar[str]
|
— |
Methods
parse
3
Role
▼
Parse doc role content.
parse
3
Role
▼
def parse(self, name: str, content: str, location: SourceLocation) -> Role
Parameters
| Name | Type | Description |
|---|---|---|
name |
— |
|
content |
— |
|
location |
— |
Returns
Role
render
2
▼
Render doc reference as a link placeholder.
render
2
▼
def render(self, node: Role, sb: StringBuilder) -> None
Parameters
| Name | Type | Description |
|---|---|---|
node |
— |
|
sb |
— |