Skip to content

Commit 00c40a9

Browse files
committed
Formatting
1 parent 19e40e8 commit 00c40a9

File tree

5 files changed

+181
-113
lines changed

5 files changed

+181
-113
lines changed

_posts/2015-04-03-freemarker.md

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ date: 2015-04-03 15:39:09
1111

1212
1) Add the pippo-freemarker dependency to your pom.xml:
1313

14-
<dependency>
15-
<groupId>ro.pippo</groupId>
16-
<artifactId>pippo-freemarker</artifactId>
17-
<version>${pippo.version}</version>
18-
</dependency>
14+
```xml
15+
<dependency>
16+
<groupId>ro.pippo</groupId>
17+
<artifactId>pippo-freemarker</artifactId>
18+
<version>${pippo.version}</version>
19+
</dependency>
20+
```
1921

2022
2) Start writing [Freemarker][freemarker] templates in the `templates` folder of your application.
2123

@@ -29,36 +31,46 @@ This engine includes some useful Pippo integration features and conveniences lik
2931

3032
You can access your translation resources using the i18n method.
3133

32-
${i18n("key.name")}
34+
```
35+
${i18n("key.name")}
36+
```
3337

3438
You can supply arguments to your *MessageFormat* translation resources too.
3539

36-
${i18n("key.name", "arg1", "arg2")}
40+
```
41+
${i18n("key.name", "arg1", "arg2")}
42+
```
3743

3844
##### prettytime (relative time)
3945

4046
pippo-freemarker supports automatically localized [prettytime][prettytime] out-of-the-box and it is very easy to use.
4147

4248
Assuming you are providing a `java.util.Date` instance to prettyTime...
4349

44-
${prettyTime(myDate)}
50+
```
51+
${prettyTime(myDate)}
52+
```
4553

4654
Will produce something like...
4755

48-
3 days ago
56+
```
57+
3 days ago
58+
```
4959

5060
##### formatTime
5161

5262
You can also automatically format localized dates using standard Java date format patterns.
5363

54-
${formatTime(now)}
55-
${formatTime(now, "short")}
56-
${formatTime(now, "medium")}
57-
${formatTime(now, "long")}
58-
${formatTime(now, "full")}
59-
${formatTime(now, "HH:mm")}
60-
${formatTime(now, "dd-MM-yyyy HH:mm")}
61-
${formatTime(now, "dd-MM-yyyy HH:mm")}
64+
```
65+
${formatTime(now)}
66+
${formatTime(now, "short")}
67+
${formatTime(now, "medium")}
68+
${formatTime(now, "long")}
69+
${formatTime(now, "full")}
70+
${formatTime(now, "HH:mm")}
71+
${formatTime(now, "dd-MM-yyyy HH:mm")}
72+
${formatTime(now, "dd-MM-yyyy HH:mm")}
73+
```
6274

6375
##### webjarsAt & publicAt
6476

@@ -81,12 +93,13 @@ pippo-freemarker supports context-aware url generation for your classpath resour
8193
```java
8294
public class MyApplication extends Application {
8395

84-
@Override
96+
@Override
8597
protected void onInit() {
86-
// add routes for static content
98+
// add routes for static content
8799
addPublicResourceRoute();
88100
addWebjarsResourceRoute();
89-
...
101+
102+
// add other routes
90103
}
91104

92105
}

_posts/2015-04-03-groovy.md

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ date: 2015-04-03 16:35:07
1111

1212
1) 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

2022
2) 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

2931
You can access your translation resources using the i18n helper.
3032

31-
i18n("key.name")
33+
```
34+
i18n("key.name")
35+
```
3236

3337
You 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

3945
pippo-groovy supports automatically localized [prettytime][prettytime] out-of-the-box and it is very easy to use.
4046

4147
Assuming you are providing a `java.util.Date` instance to prettyTime...
4248

43-
prettyTime(myDate)
49+
```
50+
prettyTime(myDate)
51+
```
4452

4553
Will produce something like...
4654

47-
3 days ago
55+
```
56+
3 days ago
57+
```
4858

4959
##### formatTime
5060

5161
You 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
8193
public 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
107120
within your own application.
108121

109122
- `templates/pippo/404notFound.groovy`

_posts/2015-04-03-jade.md

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ date: 2015-04-03 15:56:02
1111

1212
1) Add the pippo-jade dependency to your pom.xml:
1313

14-
<dependency>
15-
<groupId>ro.pippo</groupId>
16-
<artifactId>pippo-jade</artifactId>
17-
<version>${pippo.version}</version>
18-
</dependency>
14+
```xml
15+
<dependency>
16+
<groupId>ro.pippo</groupId>
17+
<artifactId>pippo-jade</artifactId>
18+
<version>${pippo.version}</version>
19+
</dependency>
20+
```
1921

2022
2) Start writing [Jade][jade] templates in the `templates` folder of your application.
2123

@@ -29,36 +31,46 @@ This engine includes some useful Pippo integration features and conveniences lik
2931

3032
You can access your translation resources using the i18n method.
3133

32-
pippo.i18n("key.name")
34+
```
35+
pippo.i18n("key.name")
36+
```
3337

3438
You can supply arguments to your *MessageFormat* translation resources too.
3539

36-
pippo.i18n("key.name", "arg1", "arg2")
40+
```
41+
pippo.i18n("key.name", "arg1", "arg2")
42+
```
3743

3844
##### prettytime (relative time)
3945

4046
pippo-jade supports automatically localized [prettytime][prettytime] out-of-the-box and it is very easy to use.
4147

4248
Assuming you are providing a `java.util.Date` instance to prettyTime...
4349

44-
pippo.prettyTime(myDate)
50+
```
51+
pippo.prettyTime(myDate)
52+
```
4553

4654
Will produce something like...
4755

48-
3 days ago
56+
```
57+
3 days ago
58+
```
4959

5060
##### formatTime
5161

5262
You can also automatically format localized dates using standard Java date format patterns.
5363

54-
pippo.formatTime(now)}
55-
pippo.formatTime(now, "short")
56-
pippo.formatTime(now, "medium")
57-
pippo.formatTime(now, "long")
58-
pippo.formatTime(now, "full")
59-
pippo.formatTime(now, "HH:mm")
60-
pippo.formatTime(now, "dd-MM-yyyy HH:mm")
61-
pippo.formatTime(now, "dd-MM-yyyy HH:mm")
64+
```
65+
pippo.formatTime(now)}
66+
pippo.formatTime(now, "short")
67+
pippo.formatTime(now, "medium")
68+
pippo.formatTime(now, "long")
69+
pippo.formatTime(now, "full")
70+
pippo.formatTime(now, "HH:mm")
71+
pippo.formatTime(now, "dd-MM-yyyy HH:mm")
72+
pippo.formatTime(now, "dd-MM-yyyy HH:mm")
73+
```
6274

6375
##### webjarsAt & publicAt
6476

@@ -81,9 +93,9 @@ script(src=pippo.publicAt('js/main.js'))
8193
```java
8294
public class MyApplication extends Application {
8395

84-
@Override
96+
@Override
8597
protected void onInit() {
86-
// add routes for static content
98+
// add routes for static content
8799
addPublicResourceRoute();
88100
addWebjarsResourceRoute();
89101
...

0 commit comments

Comments
 (0)