handlebars-java-helpers

The Handlebars.java Helpers artifact

License

License

Categories

Categories

Java Languages
GroupId

GroupId

org.beryx
ArtifactId

ArtifactId

handlebars-java-helpers
Last Version

Last Version

0.4.1
Release Date

Release Date

Type

Type

jar
Description

Description

handlebars-java-helpers
The Handlebars.java Helpers artifact
Project URL

Project URL

https://github.com/beryx/handlebars-java-helpers
Source Code Management

Source Code Management

https://github.com/beryx/handlebars-java-helpers

Download handlebars-java-helpers

How to add to project

<!-- https://jarcasting.com/artifacts/org.beryx/handlebars-java-helpers/ -->
<dependency>
    <groupId>org.beryx</groupId>
    <artifactId>handlebars-java-helpers</artifactId>
    <version>0.4.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.beryx/handlebars-java-helpers/
implementation 'org.beryx:handlebars-java-helpers:0.4.1'
// https://jarcasting.com/artifacts/org.beryx/handlebars-java-helpers/
implementation ("org.beryx:handlebars-java-helpers:0.4.1")
'org.beryx:handlebars-java-helpers:jar:0.4.1'
<dependency org="org.beryx" name="handlebars-java-helpers" rev="0.4.1">
  <artifact name="handlebars-java-helpers" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.beryx', module='handlebars-java-helpers', version='0.4.1')
)
libraryDependencies += "org.beryx" % "handlebars-java-helpers" % "0.4.1"
[org.beryx/handlebars-java-helpers "0.4.1"]

Dependencies

compile (4)

Group / Artifact Type Version
org.codehaus.groovy : groovy-all jar 2.4.13
org.slf4j : slf4j-api jar 1.7.25
com.github.jknack : handlebars jar 4.1.0
org.apache.commons : commons-lang3 jar 3.7

Project Modules

There are no modules declared in this project.

License Build Status

Handlebars.java Helpers

This library provides various helpers for adding logic to Handlebars.java. Most of them are basic helpers that can be used as subexpressions in the built-in block helpers of Handlebars.java. This allows writing the template logic in a fluent way.

Example

Given the following YAML model:

birthYear: 1997

and the following template:

{{def 'fifteenYear' (math birthYear '+' 15)}}
{{#ifb (or
          (and
            (compare (math fifteenYear '%' 4) '==' 0)
            (compare (math fifteenYear '%' 100) '!=' 0)
          )
          (compare (math fifteenYear '%' 400) '==' 0)
       )
}}
Your fifteenth anniversary was in a leap year!
{{else}}
Your fifteenth anniversary was in a non-leap year!
{{/ifb}}

The resulting text will be:

Your fifteenth anniversary was in a leap year!

Please read the documentation before using the handlebars-java-helpers library.

org.beryx

Beryx

Versions

Version
0.4.1
0.3.0
0.2.2
0.2.1
0.2.0
0.1.1
0.1.0