Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/beryx/handlebars-java-helpers
Helpers for Handlebars.java
https://github.com/beryx/handlebars-java-helpers
handlebars
Last synced: 15 days ago
JSON representation
Helpers for Handlebars.java
- Host: GitHub
- URL: https://github.com/beryx/handlebars-java-helpers
- Owner: beryx
- License: apache-2.0
- Created: 2016-06-19T19:57:42.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-10-26T11:47:02.000Z (over 5 years ago)
- Last Synced: 2024-11-14T13:44:39.416Z (3 months ago)
- Topics: handlebars
- Language: Groovy
- Homepage: http://handlebars-java-helpers.beryx.org
- Size: 176 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/beryx/handlebars-java-helpers/blob/master/LICENSE)
[![Build Status](https://img.shields.io/travis/beryx/handlebars-java-helpers/master.svg?label=Build)](https://travis-ci.org/beryx/handlebars-java-helpers)
## Handlebars.java Helpers ##This library provides various helpers for adding logic to [Handlebars.java](https://github.com/jknack/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](http://handlebars-java-helpers.beryx.org)** before using the handlebars-java-helpers library.