Module

rendering.validator

Template validation before rendering.

Classes

TemplateValidator
Validates templates for syntax errors and missing dependencies.
4

Validates templates for syntax errors and missing dependencies.

Methods 1

validate_all
Validate all templates in the theme.
0 list[Any]
def validate_all(self) -> list[Any]

Validate all templates in the theme.

Returns

list[Any]

List of errors found

Internal Methods 3
__init__
Initialize validator.
1 None
def __init__(self, template_engine: Any)

Initialize validator.

Parameters 1
template_engine Any

TemplateEngine instance

_validate_syntax
Validate template syntax.
2 list[Any]
def _validate_syntax(self, template_name: str, template_path: Path) -> list[Any]

Validate template syntax.

Parameters 2
template_name str
template_path Path
Returns

list[Any]

_validate_includes
Check if all included templates exist.
2 list[Any]
def _validate_includes(self, template_name: str, template_path: Path) -> list[Any]

Check if all included templates exist.

Parameters 2
template_name str
template_path Path
Returns

list[Any]

Functions

validate_templates
Validate all templates and display results.
1 int
def validate_templates(template_engine: Any) -> int

Validate all templates and display results.

Parameters 1

Name Type Default Description
template_engine Any

TemplateEngine instance

Returns

int

Number of errors found