DavidAlphaFox/aihtml
62.0
Adequate · 17 September 2026
13.1k
lines of production code
Erlang
with Python
1
measurement over time
What this system is
This system is an Erlang library and Rebar3 plugin that compiles Mustache and Jinja2 templates into efficient Erlang modules at build time. It provides a shared, engine-agnostic core for parsing and rendering, supporting features like template inheritance, macros, and autoescaping while ensuring strict compliance with specification standards through comprehensive testing.
Features
Add end-to-end examples for Mustache and Jinja template rendering
The examples directory now provides a complete, buildable project demonstrating the aihtml library's rebar3 plugin. It includes configuration to compile both Mustache (.mustache) and Jinja (.j2) templates into Erlang modules at build time, showcasing features like template inheritance, macros, filters, and context stacks. Users can run the example to see generated modules and rendered output, serving as a practical guide for integrating aihtml into their own Erlang/OTP applications.
examples · high confidence
Added Jinja fixture generation tooling
A new Python script (tools/gen\_jinja\_fixtures.py) and its case definitions (tools/jinja\_cases.py) have been added to the tools directory. This tool generates JSON test fixtures for the Jinja specification by rendering templates using the CPython jinja2 library, ensuring that test data is derived from the reference implementation rather than manually written.
tools · high confidence
Added automated build and quality check script
A new \scripts/check.sh\ script has been added to automate the project's build and quality assurance pipeline. This script sequentially runs compilation for both the main and test profiles, executes eunit and common test suites, performs cross-reference analysis, and runs Dialyzer (noting that the first run builds the PLT). It also conditionally verifies that committed Jinja fixtures match the output of the generator script, ensuring consistency without requiring Python in environments where it is unavailable.
scripts · high confidence
Introduce Jinja2 template engine support alongside existing Mustache engine
This change adds a new Jinja2 template engine to the aihtml library, allowing users to compile Jinja2 templates to Erlang at build time in addition to the existing Mustache support. The diff introduces new header files defining the data contracts for both engines: \ai\_html.hrl\ contains shared types and configuration keys, \ai\_jinja.hrl\ defines the Jinja2-specific syntax, AST nodes, and compiler options, and \ai\_mustache.hrl\ defines the Mustache-specific types. This enables the use of Jinja2-style templating (e.g., \{% %}\, \{{ }}\) with features like blocks, inheritance, and filters, compiled into efficient Erlang modules.
include · high confidence
Introduce engine-agnostic aihtml architecture with Jinja2 support
The template rendering system has been refactored to support multiple template engines through a shared, engine-neutral core. A new \ai\_html\_engine\ behaviour defines the interface for parsing, compiling, and rendering, allowing the build tooling and development reloaders to remain engine-agnostic. This change introduces a full Jinja2 engine (\ai\_jinja\) alongside the existing Mustache implementation, sharing common utilities for HTML escaping (\ai\_html\_escape\), path resolution (\ai\_html\_path\), and text normalization (\ai\_html\_text\). Development-time hot reloading is now unified via \ai\_html\_dev\, which coordinates stale-checking and reloading for both engines simultaneously.
src · high confidence
Introduce rebar3\_aihtml plugin with Jinja2 support and build-time compilation
The rebar3\_aihtml plugin now compiles Mustache and Jinja2 templates into Erlang modules at build time, replacing previous runtime approaches. This release adds a new \rebar3 jinja\ provider for Jinja2 templates, a \rebar3 mustache migrate\ command to update legacy flat-context templates, and robust build-stamp-based caching to ensure incremental builds are fast and deterministic. The plugin includes built-in checks for module name collisions and orphaned generated files, and it operates with zero third-party dependencies.
_rebar3\aihtml · high confidence
Jinja2 template engine added alongside Mustache
aihtml now ships a second template engine, Jinja2, alongside the existing Mustache implementation. Users can compile \.j2\ templates using the new \rebar3 jinja\ provider and \ai\_jinja\_transform\, which supports full expression languages, template inheritance, macros, and autoescaping. Both engines can coexist in the same project, sharing a \views\ directory and build output, with each generated module clearly identifying its engine. The underlying shared layer (\ai\html\\*\) and build stamping logic have been updated to support this dual-engine architecture.
(repo-wide) · high confidence
Test coverage
Added Mustache spec compliance tests and end-to-end fixtures; Added benchmark harnesses to compare rendering performance; Added comprehensive test suites for AI HTML and Jinja2 template engines; Added test fixtures for Jinja2 and dual-engine rendering; Added test fixtures for rebar3\_aihtml plugin scenarios; Added test fixtures for template transform validation.
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 62.
Lenses
- Code Health 88
- Architecture 100
- Maturity 67
- Readiness 43
- Security 93
Changes since last survey
- 137 commits — 128 feature/other, 9 fixes
By area
- (root) — 52 commits
- src/ai_mustache.erl — 8 commits
- examples/complex.erl — 6 commits
- (repo) — 5 commits
- src/ai_dom_node.erl — 5 commits
- src/ai_mustache_loader.erl — 4 commits
- src/ai_mustache_runner.erl — 4 commits
- examples/complex.mustache — 3 commits
- examples/shared — 3 commits
- rebar3_aihtml/src — 3 commits
- src/ai_markdown_lex.erl — 3 commits
- src/ai_markdown_parser.erl — 3 commits
- src/ai_mustache_parser.erl — 3 commits
- test/fixtures — 3 commits
- examples/_item.mustache — 2 commits
- examples/views — 2 commits
- bench/jinja — 1 commit
- bench/new — 1 commit
- designs/08-jinja-architecture.md — 1 commit
- docs/README.md — 1 commit
Notable commits
- fix: Fix bug of merge
- fix: Fix parser error
- fix: fix bug of remove empty section bump version to 0.2.5
- fix: fix bug: when render ai_dom_node the id of the element does not render in atrributes
- fix: fix get_value bug and upgrade ailib dependence to fix unicode bug
- fix: fix loader loading sequence
- fix: fix node attributes merge bug
- fix: fix some bugs and merge binary when need
- fix: update readme fix error on engine loading and bump version to 0.1.7
- change: Add dom tools
- change: Add lamda optimize
- change: Add reload function and bump version 0.2.6
- change: Add self-defined command lamda
- change: Bump Version
- change: Bump Version 0.2.7
- change: Bump version 0.2.9
- change: Bump version 0.3.4
- change: Bump version to 0.3.5
- change: Change the rule
- change: Create LICENSE
- …and 117 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
DavidAlphaFox/aihtml 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 a09c91d54ae58c47c0d24480993b964c6c9720b7 — 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.