https://github.com/febit/wit
This is a template engine, all written in Java
https://github.com/febit/wit
java script template
Last synced: 10 months ago
JSON representation
This is a template engine, all written in Java
- Host: GitHub
- URL: https://github.com/febit/wit
- Owner: febit
- License: bsd-3-clause
- Created: 2013-08-09T03:36:35.000Z (over 12 years ago)
- Default Branch: main
- Last Pushed: 2023-12-18T15:07:18.000Z (about 2 years ago)
- Last Synced: 2024-11-30T09:38:44.316Z (about 1 year ago)
- Topics: java, script, template
- Language: Java
- Homepage:
- Size: 4.88 MB
- Stars: 46
- Watchers: 11
- Forks: 19
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Febit Wit
====
[](https://github.com/febit/wit/blob/master/LICENSE)
[](https://travis-ci.org/febit/wit)
[](http://shang.qq.com/wpa/qunwpa?idkey=7be9d8a59a8533b7c2837bdc22295b4b47c65384eda323971cf5f3b9943ad9db)
This is a template engine, all written in Java, **support Java 8+**.
## How to use
+ Maven:
```xml
org.febit.wit
wit-core
2.6.0
```
+ or Gradle
```
compile 'org.febit.wit:wit-core:2.6.0'
```
+ demo:
```java
Engine engine = Engine.create();
Template template = engine.getTemplate("/demo.wit");
template.merge(params, out);
```
## Hello Wit
```js
Hello Wit!
<%
var books
{
for(book : books){
%>
${for.iter.index}.《${book.name}》 ¥${book.price}
<%
}
}
{
var func = function(a, b){
return a + b + arguments[3]
}
echo func("a", "b", "c")
}
{
var map = {
books,
1: 1,
"key2": "value2",
3: 2 + 1
}
map[5] = 2 + 3
map.~put("6", 2*3)
for(key, value : map){
echo key + ":" +value + "\n"
}
}
%>
```
> [More examples][tests]
## Official Support
+ Jodd Madvoc
+ Spring MVC
+ Servlet & Filter
> [Demo][mvc-demo]
## License
**Febit Wit** is released under the BSD License. See the bundled [LICENSE file][license] for
details.
## Third-party Licenses
+ **ASM** under the BSD License.[License file][asm_license]
## Bug report
> [github-issue][new_issue_github]
[mvc-demo]: https://github.com/febit/wit-mvc-demo
[tests]: https://github.com/febit/wit/tree/master/wit-core/src/test/resources/org/febit/wit/test/tmpls
[new_issue_github]: https://github.com/febit/wit/issues/new
[license]: https://github.com/febit/wit/blob/master/LICENSE
[jodd_license]: http://jodd.org/license.html
[asm_license]: http://asm.ow2.org/license.html