Introduction

Carrot is a modern, designer-friendly template engine for Java. It is based on Jinja2, and while originally a fork of Jangod, has since been completely rewritten.

Fast and customizable, you can register custom tags for highly specialized rendering, you can register Java objects and methods for custom formatting, and you can use template inheritance for maintain common layout and styles.

Originally designed for HTML rendering, Carrot can be used for any for textual rendering, including CSS, Javascript, or any other text files.

Sample

  {% extends "skeleton.html" %}
  {% block "content" %}
  <ul>
    {% for account in accounts %}
      <li>
        <a href="/accounts/{{ account.id }}">
          {{ empires[account.empire_id].name }}
        </a>
      </li>
    {% endfor %}
  </ul>
  {% end %}

Features