Classes
DirectiveValidator
Validates directive syntax and usage across the site.
Orchestrates validation by:
1. Analyzing dir…
DirectiveValidator
Validates directive syntax and usage across the site.
Orchestrates validation by:
- Analyzing directives across all pages (DirectiveAnalyzer)
- Checking syntax validity (check_directive_syntax)
- Checking completeness (check_directive_completeness)
- Checking performance (check_directive_performance)
- Checking rendering output (check_directive_rendering)
Checks:
- Directive blocks are well-formed (opening and closing)
- Required options are present
- Tab markers are properly formatted
- Nesting depth is reasonable
- Performance warnings for heavy directive usage
Inherits from
BaseValidatorAttributes
| Name | Type | Description |
|---|---|---|
last_stats |
ValidatorStats | None |
Methods 1
validate
Run directive validation checks.
Uses cached content from build_context when a…
validate
def validate(self, site: Site, build_context: Any = None) -> list[CheckResult]
Run directive validation checks.
Uses cached content from build_context when available to avoid redundant disk I/O (build-integrated validation).
Parameters 2
site |
Site |
Site instance to validate |
build_context |
Any |
Optional BuildContext with cached page contents. When provided, uses cached content instead of reading from disk (~4 seconds saved for large sites). |
Returns
List of CheckResult objectslist[CheckResult]
—