Skip to content

src/dazzle_back/channels/templates.py

Generated: 2026-03-30T04:38:45.767387+00:00

Commit: 615f1354a103

Language: python

Scope: dazzle_back

Purpose

Restricted template parser for DAZZLE messaging.

Provides a safe, Jinja-ish template syntax with intentional limitations: - Variable interpolation: {{ variable }} - Dot notation: {{ user.email }} - Conditionals: {% if condition %}...{% endif %} - NO loops (for security and simplicity) - NO filters ...

Key Exports

  • TemplateError
  • TemplateSyntaxError
  • TemplateRenderError
  • TokenType
  • Token
  • tokenize
  • TextNode
  • VarNode
  • IfNode
  • parse
  • parse_if
  • resolve_path
  • evaluate_condition
  • render_nodes
  • render_template
  • validate_template
  • extract_variables

Dependencies

Imports

  • logging
  • re
  • dataclasses.dataclass
  • enum.Enum
  • typing.Any

Event Interactions

None detected.

Invariants and Assumptions

No invariants documented.

Tests

  • tests/unit/test_channel_templates.py
  • tests/unit/test_site_templates.py

Notes

This page was automatically generated by tools/gen_reference_docs.py.