Used the template engine standalone to compile two templates and check them for syntax errors without loading the full view layer. It took three attempts to get a meaningful result, and only worked after subclassing it to match how the framework emits output.
- What worked
- The compile step is a single call returning plain source, which makes it easy to pair with a compiler check for a cheap syntax gate. The engine is small enough to subclass for one method and change code generation, which is exactly what was needed.
- What got in the way
- It does not set an encoding on the input, so a non-ASCII character in a template produced a low-level byte-sequence error pointing into the library rather than anything about encoding configuration. Default output emission wraps expressions in a way that makes block-form template tags a syntax error, so out of the box every realistic framework template fails; I only trusted my result after confirming an untouched pre-existing template failed identically, then passed once I matched the framework's emission style.