Functions
check_accessibility
2
list[ContractIssue]
▼
Warn about htmx URL attrs on non-interactive elements without role/tabindex.
check_accessibility
2
list[ContractIssue]
▼
def check_accessibility(source: str, template_name: str) -> list[ContractIssue]
Parameters
| Name | Type | Description |
|---|---|---|
source |
str |
|
template_name |
str |
Returns
list[ContractIssue]
_normalize_for_matching
1
str
▼
Replace Kida expressions with a wildcard sentinel for matching.
_normalize_for_matching
1
str
▼
def _normalize_for_matching(value: str) -> str
Parameters
| Name | Type | Description |
|---|---|---|
value |
str |
Returns
str
check_label_association
2
list[ContractIssue]
▼
Warn when form fields lack an associated label.
Valid associations (any one is…
check_label_association
2
list[ContractIssue]
▼
def check_label_association(source: str, template_name: str) -> list[ContractIssue]
Warn when form fields lack an associated label.
Valid associations (any one is sufficient):
<label for="id">matching the element'sid- The element is wrapped inside a
<label>tag - The element has
aria-labeloraria-labelledby
Exempt elements:
<input type="hidden|submit|button|image|reset">
Parameters
| Name | Type | Description |
|---|---|---|
source |
str |
|
template_name |
str |
Returns
list[ContractIssue]
check_image_alt
2
list[ContractIssue]
▼
Warn when tags lack an alt attribute.
check_image_alt
2
list[ContractIssue]
▼
def check_image_alt(source: str, template_name: str) -> list[ContractIssue]
Parameters
| Name | Type | Description |
|---|---|---|
source |
str |
|
template_name |
str |
Returns
list[ContractIssue]
check_heading_order
2
list[ContractIssue]
▼
Warn when heading levels skip (e.g. h1 → h3 with no h2).
check_heading_order
2
list[ContractIssue]
▼
def check_heading_order(source: str, template_name: str) -> list[ContractIssue]
Parameters
| Name | Type | Description |
|---|---|---|
source |
str |
|
template_name |
str |
Returns
list[ContractIssue]
check_landmarks
1
list[ContractIssue]
▼
Warn when layout templates have no or role="main" landmark.
check_landmarks
1
list[ContractIssue]
▼
def check_landmarks(layout_sources: dict[str, str]) -> list[ContractIssue]
Parameters
| Name | Type | Description |
|---|---|---|
layout_sources |
dict[str, str] |
Mapping of layout template name → source for templates that serve as layouts (contain |
Returns
list[ContractIssue]