An OCaml template engine with near-complete compatibility with Jinja2 syntax and features.
Jingoo is an OCaml template engine that closely mimics Jinja2, the popular Python templating language. It enables OCaml developers to use Jinja2-like syntax for rendering dynamic content in web applications, documentation generators, or other text-heavy projects. The project solves the need for a familiar, expressive templating system within the OCaml ecosystem.
OCaml developers building web applications, static site generators, or any project requiring dynamic text generation with Jinja2-style templates.
Developers choose Jingoo for its high compatibility with Jinja2, reducing the learning curve for those familiar with Python templating, while leveraging OCaml's type safety and performance. Its support for custom filters and flexible data models makes it adaptable to complex use cases.
OCaml template engine almost compatible with jinja2
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements most Jinja2 syntax, including variables, loops, and conditionals, reducing the learning curve for developers experienced with Python templating, as highlighted in the README's compatibility focus.
Supports data from lists, objects, and functional closures via the Jg_template2 module, enabling dynamic and complex model definitions, demonstrated in the usage examples with Tlist and Tobj types.
Allows creation of custom filters using OCaml functions or dynlink extensions, as shown in the examples where to_mail and to_md5 filters are added to the environment.
Can render templates from both files and inline strings with a consistent API, providing flexibility in template management, as seen in the Jg_template.from_file and from_string methods.
Internationalization is not supported, as explicitly stated in the README, limiting its use for multilingual applications without manual workarounds.
Some built-in filters have different argument orders or optional arguments, and single-line comments are unsupported due to OCaml constraints, requiring adjustments for strict Jinja2 templates.
Adding dynlink filters involves compiling separate modules to .cmxs and manually configuring the environment, adding overhead and complexity compared to simpler filter implementations.