-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8033112
commit a166ca3
Showing
12 changed files
with
230 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/make | ||
|
||
.PHONY: test clean | ||
|
||
test: | ||
../../mustpl -f ./give.data.json ./give.template.txt 2> ./stderr.out 1> ./stdout.out; \ | ||
exitCode=$$?; if [ $$exitCode -ne 0 ]; then echo "wrong exit code: $$exitCode"; exit 1; fi | ||
diff -u ./want.stderr.txt ./stderr.out | ||
diff -u ./want.stdout.txt ./stdout.out | ||
|
||
clean: | ||
-rm -v ./*.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"person": { | ||
"name": "Harry", | ||
"age": 37 | ||
}, | ||
"lang": "fr", | ||
"l10n": { | ||
"en": "Hello", | ||
"fr": "Salut" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{#person.name=Harry}} | ||
Hello Harry! | ||
{{/person.name=Harry}} | ||
|
||
{{^person.name=John}} | ||
The person's name is not John. | ||
{{/person.name=John}} | ||
|
||
{{#person.age>40}} | ||
He's over 40 years old. | ||
{{/person.age>40}}{{^person.age>40}} | ||
He's definitely not more than 40 years old. | ||
{{/person.age>40}} | ||
|
||
{{#lang=fr}}{{ l10n.fr }}{{/lang=fr}}{{#lang=!fr}}{{ l10n.en }}{{/lang=!fr}} {{ person.name }}! | ||
|
||
Render only if equals: | ||
- {{ person.age=36 }} | ||
- {{ person.age=37 }} | ||
- {{ person.age=38 }} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Hello Harry! | ||
|
||
The person's name is not John. | ||
|
||
|
||
He's definitely not more than 40 years old. | ||
|
||
Salut Harry! | ||
|
||
Render only if equals: | ||
- | ||
- 37 | ||
- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/make | ||
|
||
.PHONY: test clean | ||
|
||
test: | ||
../../mustpl -f ./give.data.json ./give.template.txt 2> ./stderr.out 1> ./stdout.out; \ | ||
exitCode=$$?; if [ $$exitCode -ne 0 ]; then echo "wrong exit code: $$exitCode"; exit 1; fi | ||
diff -u ./want.stderr.txt ./stderr.out | ||
diff -u ./want.stdout.txt ./stdout.out | ||
|
||
clean: | ||
-rm -v ./*.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"servers": [ | ||
{ | ||
"listen": 8080, | ||
"names": [ | ||
"example.com" | ||
], | ||
"is_default": true, | ||
"home": "/www/example.com" | ||
}, | ||
{ | ||
"listen": 1088, | ||
"names": [ | ||
"127-0-0-1.nip.io", | ||
"127-0-0-2.nip.io" | ||
], | ||
"home": "/www/local" | ||
} | ||
], | ||
|
||
"people": { | ||
"John": 27, | ||
"Mark": "32" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{{#servers}} | ||
server { {{! just a comment, will not be rendered }} | ||
listen {{ listen }}; | ||
server_name{{#names}} {{ . }}{{/names}}{{#is_default}} default_server{{/is_default}}; | ||
|
||
location / { | ||
root {{ home }}; | ||
index index.html index.htm; | ||
} | ||
} | ||
{{/servers}} | ||
|
||
{{#people.*}} | ||
- {{ * }} is {{ . }} years old | ||
{{/people.*}} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
server { | ||
listen 8080; | ||
server_name example.com default_server; | ||
|
||
location / { | ||
root /www/example.com; | ||
index index.html index.htm; | ||
} | ||
} | ||
server { | ||
listen 1088; | ||
server_name 127-0-0-1.nip.io 127-0-0-2.nip.io; | ||
|
||
location / { | ||
root /www/local; | ||
index index.html index.htm; | ||
} | ||
} | ||
|
||
- John is 27 years old | ||
- Mark is 32 years old |