Skip to content
CAI
Software that uses CAICheck a score

zotonic/template_compiler

76.6

Strong · 17 September 2026

5.1k

lines of production code

Erlang

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is a template compiler for a Zotonic-based application, designed to process and render template source files into HTML. It provides advanced development features such as syntax highlighting, debug tracing, and structured rendering APIs to help visualize and trace template execution. The core functionality includes handling template inheritance, fragments, and various control flow constructs, supported by comprehensive test coverage and modernized Erlang dependencies.

Features

Add template compiler record definition

Added the \template\_compiler.hrl\ header file which defines the \template\_file\ record. This record structures template data with a binary \template\ field and a \filename\ field, providing the necessary type definitions for the template compiler module.

include · high confidence

Template compiler gains syntax highlighting, debug points, and structured rendering APIs

The template compiler now provides syntax-highlighted HTML output for template source files and compiled modules, enabling developers to visualize template structure and navigate includes or extends. It introduces compile-time debug points that can be enabled to trace template execution, along with new APIs to render specific named blocks independently of the full template. The compiler's internal state and module generation have been expanded to track block ownership, fragment definitions, and content checksums, while the application manifest now explicitly lists dependencies on crypto, compiler, syntax\_tools, and zotonic\_stdlib.

src · high confidence

Behavioural changes

Upgrade to OTP 22+ and replace lager with qdate\_localtime

The project now requires Erlang/OTP 22 or later, dropping support for older versions. The logging dependency has been removed in favor of the standard Erlang logger, and the custom \z\_stdlib\ dependency has been replaced with \qdate\_localtime\ (v1.2) and \zotonic\_stdlib\ (v1.6+). Additionally, the build system now includes targets for dialyzer, xref, and ex\_doc documentation generation.

(repo-wide) · high confidence

Test coverage

Added template compiler test fixtures; Expanded test coverage for template compiler features.

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 77.

Lenses

  • Code Health 90
  • Architecture 100
  • Maturity 84
  • Readiness 64
  • Security 90

Changes since last survey

  • 152 commits — 120 feature/other, 32 fixes

By area

  • (root) — 48 commits
  • src/template_compiler.erl — 26 commits
  • test/test-data — 12 commits
  • priv/templates — 9 commits
  • src/template_compiler_admin.erl — 8 commits
  • src/template_compiler_expr.erl — 8 commits
  • .github/workflows — 7 commits
  • (repo) — 6 commits
  • src/template_compiler_element.erl — 5 commits
  • src/template_compiler_runtime.erl — 5 commits
  • src/template_compiler_runtime_internal.erl — 4 commits
  • src/template_compiler_highlight.erl — 3 commits
  • src/template_compiler_operators.erl — 3 commits
  • src/template_compiler_parser.yrl — 2 commits
  • include/template_compiler.hrl — 1 commit
  • src/filter_template_compiler_test.erl — 1 commit
  • src/template_compiler.app.src — 1 commit
  • src/template_compiler_scanner.erl — 1 commit
  • test/template_compiler_expr_SUITE.erl — 1 commit
  • test/template_compiler_trans_SUITE.erl — 1 commit

Notable commits

  • fix: Cleanup and small fixes (#49)
  • fix: Correct docs, add syntax hightlighting. Fixes #22 (#24)
  • fix: Fix id for catinclude
  • fix: Fix 'if ... as ...', add test.
  • fix: Fix a problem where having duplicated blocks could result in endless recursion (#55)
  • fix: Fix a problem with compiling expressions where the runtime returns a list starting with an {ast, ...} term.
  • fix: Fix a problem with looking up an atom in a list with binary keys.
  • fix: Fix a problem with loops where the list var is 'undefined'
  • fix: Fix a problem with translatable texts.
  • fix: Fix an issue where in translit tokens the line count was not incremented (#66)
  • fix: Fix an issue with {% elseif %} expressions inside fragments (#69)
  • fix: Fix branch for Travis-CI build status
  • fix: Fix compatibility with zotonic's mod_translation:generate (#7)
  • fix: Fix compose block inherit (#51)
  • fix: Fix debug trace callback
  • fix: Fix edoc (#21)
  • fix: Fix error message and builtin tag merl arg
  • fix: Fix escaped quotes (#48)
  • fix: Fix h4 in readme
  • fix: Fix maintainer info for hex package
  • …and 132 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

zotonic/template_compiler was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 17 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 7dffacb1bee8bcb070d5faee0345f824cb24fd13 — the exact code this score is about.
  • Scored under rubric-2026.09.12 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-f94092f054c1.