@@ -11,11 +11,13 @@ date: 2015-04-03 16:35:07
1111
12121 ) Add the pippo-groovy dependency to your pom.xml:
1313
14- <dependency >
15- <groupId>ro.pippo</groupId>
16- <artifactId>pippo-groovy</artifactId>
17- <version>${pippo.version}</version>
18- </dependency >
14+ ``` xml
15+ <dependency >
16+ <groupId >ro.pippo</groupId >
17+ <artifactId >pippo-groovy</artifactId >
18+ <version >${pippo.version}</version >
19+ </dependency >
20+ ```
1921
20222 ) Start writing [ Groovy MarkupTemplateEngine] [ groovy ] templates in the ` templates ` folder of your application.
2123** Note:** The default file extension of a Groovy template is ` .groovy ` and may be ommitted from your Pippo Java code but <u >not</u > your templates.
@@ -28,36 +30,46 @@ This engine includes some useful Pippo integration features and conveniences lik
2830
2931You can access your translation resources using the i18n helper.
3032
31- i18n("key.name")
33+ ```
34+ i18n("key.name")
35+ ```
3236
3337You can supply arguments to your * MessageFormat* translation resources too.
3438
35- i18n("key.name", "arg1", "arg2")
39+ ```
40+ i18n("key.name", "arg1", "arg2")
41+ ```
3642
3743##### prettytime (relative time)
3844
3945pippo-groovy supports automatically localized [ prettytime] [ prettytime ] out-of-the-box and it is very easy to use.
4046
4147Assuming you are providing a ` java.util.Date ` instance to prettyTime...
4248
43- prettyTime(myDate)
49+ ```
50+ prettyTime(myDate)
51+ ```
4452
4553Will produce something like...
4654
47- 3 days ago
55+ ```
56+ 3 days ago
57+ ```
4858
4959##### formatTime
5060
5161You can also automatically format localized dates using standard Java date format patterns.
5262
53- formatTime(now)}
54- formatTime(now, "short")
55- formatTime(now, "medium")
56- formatTime(now, "long")
57- formatTime(now, "full")
58- formatTime(now, "HH:mm")
59- formatTime(now, "dd-MM-yyyy HH:mm")
60- formatTime(now, "dd-MM-yyyy HH:mm")
63+ ```
64+ formatTime(now)}
65+ formatTime(now, "short")
66+ formatTime(now, "medium")
67+ formatTime(now, "long")
68+ formatTime(now, "full")
69+ formatTime(now, "HH:mm")
70+ formatTime(now, "dd-MM-yyyy HH:mm")
71+ formatTime(now, "dd-MM-yyyy HH:mm")
72+ ```
6173
6274##### webjarsAt & publicAt
6375
@@ -80,12 +92,13 @@ script(src: publicAt('js/main.js')) {}
8092``` java
8193public class MyApplication extends Application {
8294
83- @Override
95+ @Override
8496 protected void onInit () {
85- // add routes for static content
97+ // add routes for static content
8698 addPublicResourceRoute();
8799 addWebjarsResourceRoute();
88- ...
100+
101+ // add other routes
89102 }
90103
91104}
@@ -103,7 +116,7 @@ The string passed to '`ng` will produce `{% raw %}{{something | or | other}}{% e
103116
104117##### Error Templates
105118
106- pippo-groovy will render special templates for routing problems and excepions . You may override these templates
119+ pippo-groovy will render special templates for routing problems and exceptions . You may override these templates
107120within your own application.
108121
109122- ` templates/pippo/404notFound.groovy `
0 commit comments