Classes
LiteralAttribute
6
▼
Literal HTML attribute found in static template text.
LiteralAttribute
6
▼
Literal HTML attribute found in static template text.
Attributes
| Name | Type | Description |
|---|---|---|
name |
str
|
— |
value |
str | None
|
— |
tag |
str
|
— |
template_name |
str | None
|
— |
lineno |
int | None
|
— |
col_offset |
int | None
|
— |
Functions
_line_col
4
tuple[int, int]
▼
Return 1-based line and 0-based column for an offset in a data node.
_line_col
4
tuple[int, int]
▼
def _line_col(base_line: int, base_col: int, text: str, offset: int) -> tuple[int, int]
Parameters
| Name | Type | Description |
|---|---|---|
base_line |
int |
|
base_col |
int |
|
text |
str |
|
offset |
int |
Returns
tuple[int, int]
extract_literal_attributes
3
list[LiteralAttribute]
▼
Extract literal HTML attributes from static template text.
Dynamic attributes …
extract_literal_attributes
3
list[LiteralAttribute]
▼
def extract_literal_attributes(template_or_ast: Any, *, names: Iterable[str] | None = None, prefixes: Iterable[str] | None = None) -> list[LiteralAttribute]
Extract literal HTML attributes from static template text.
Dynamic attributes built through expressions, filters, or helpers are not inferred. This helper intentionally reports only facts visible in raw template text so framework adapters can layer their own semantics on top.
Parameters
| Name | Type | Description |
|---|---|---|
template_or_ast |
Any |
|
names |
Iterable[str] | None |
Default:None
|
prefixes |
Iterable[str] | None |
Default:None
|
Returns
list[LiteralAttribute]