Home

Awesome

Chunk Templates for Java

<img align="right" src= "http://www.x5software.com/chunk/docs/img/chunk_logo_500x500.png" width="250" /> Full documentation at http://www.x5software.com/chunk/

Chunk is a Java Template Engine for applications that serve HTML or XML. It's the little engine that can handle any templating job, plain text, markup, markdown, whatever, wherever.

Chunk is compact and speedy, easy to learn yet very powerful.

Chunk templates provide a rich featureset: in-tag filters, in-tag default values, includes, looping and branching, defining multiple snippets per template file, layered themes, macros, and much much more.

Free to use, copyright waived. MIT License.

Quick Start

Browse the fabulous documentation chock full of examples and recipes.

Download the latest chunk-template jar. Works with Java 1.5 and up.

Available from Maven Central:

    <dependency>
      <groupId>com.x5dev</groupId>
      <artifactId>chunk-templates</artifactId>
      <version>3.6.2</version>
    </dependency>

Features

An Eclipse plugin provides syntax highlighting, outline navigation pane for snippets in .chtml files, and auto-hyperlinks of snippet references. Requires Eclipse Helios (3.6) or better. Get the plugin.


Dependencies

Most features work fully with the standalone jar. A couple advanced features can be unlocked by adding these libraries to the classpath:

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.12.2</version>
    </dependency>
    <dependency>
      <groupId>org.cheffo</groupId>
      <artifactId>jeplite</artifactId>
      <version>0.8.7a</version>
    </dependency>

Android: Binding Beans to Template

Note: on Android (optional) - to make use of chunk.setToBean("tag",bean) binding, just make sure to include this additional dependency in your project:

    <dependency>
      <groupId>com.madrobot</groupId>
      <artifactId>madrobotbeans</artifactId>
      <version>0.1</version>
    </dependency>

Or download madrobotbeans-0.1.jar directly. Thanks to Elton Kent and the Mad Robot project.

Analytics