Over a million developers have joined DZone.

Hello Handlebars.java!

·

Handlebars provides the power necessary to let you build semantic templates effectively with no frustration.

Mustache templates are compatible with Handlebars, so you can take a Mustache template, import it into Handlebars, and start taking advantage of the extra Handlebars features.

Getting Started 

In general, the syntax of Handlebars templates is a superset of Mustache templates. For basic syntax, check out the Mustache manpage.

Maven

Current version: 0.2.0

 

  <dependency>
    <groupId>com.github.edgarespina</groupId>
    <artifactId>handlebars</artifactId>
    <version>${handlebars-version}</version>
  </dependency>

 

Hello Handlebars.java

Handlebars handlebars = new Handlebars();

Template template = handlebars.compile("Hello {{.}}!");

System.out.println(template.apply("Handlebars.java"));

 

Output:

 

Hello Handlebars.java!

 

 Want to learn more? Have a look to the project at https://github.com/edgarespina/handlebars.java 

Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}