<json path=person> { "firstName": "James", "lastName": "Smith", "email": "james.smith@example.com|Salesman email address", "age": 30, "motorcycles": false, "cars": [ { "name":"Ford", "url": "https://ford.com", "models": [ "Fiesta", "Focus", "Mustang" ] }, { "name":"BMW", "url": "https://bmw.com", "models": [ "320", "X3", "X5" ] }, { "name":"Fiat", "url": "https://fiat.com", "models": [ "500", "Panda" ] } ] }</json>
Basic extractor syntax: %$ ... %
%$person.firstName% %$person.lastName% sells cars.
James Smith sells cars.
person.middleName: **%$person.middleName%**. person.cars: **%$person.cars%**. person.cars.1.models: **%$person.cars.1.models%**.
person.middleName: (null). person.cars: (array). person.cars.1.models: 320, X3, X5.
Basic syntax: %$ ... ( ... )%
Variable will be displayed, if filter evaluates to true.
This person is older than 40: %$person.firstName(person.age>40)%. This person is younger than 40: %$person.firstName(person.age<=40)%.
This person is older than 40: . This person is younger than 40: James.
Basic syntax: %$ ... # ... #%
Variable may be rendered in one of the following formats: code, header, link, email, media, rss or ejs.
%$person.cars.1.models #code#%
[
"320",
"X3",
"X5"
]
%$person.email #email#%
Email: Salesman email address
To use Embedded JavaScript templating first enable it in the configuration settings.
%$person.firstName #ejs?<$=d.toUpperCase()$>#%
In upper case: "James"<%=d.toUpperCase()%>
Syntax: %$ ... {}%
Empty curly brackets lists all properties of the variable.
%$person{}%
| firstName | James |
|---|---|
| lastName | Smith |
| james.smith@example.com|Salesman email address | |
| age | 30 |
| motorcycles | ☐ |
| cars | (array) |
Syntax: %$ ... { ... }%
Curly brackets may contain pairs with header description linked to path.
%$person{"First name":firstName, "Age":age, "Main car":cars.0.name, "Not existing":middleName}%
| First name | James |
|---|---|
| Age | 30 |
| Main car | Ford |
| Not existing | (null) |
Syntax: %$ ... { ... } # ... #%
Format must contain pairs with header description linked to format.
%$person{"First name":firstName, "Email address":email, "Main car":cars.0.name} #"Email address":email#%
| First name | James |
|---|---|
| Email address | Salesman email address |
| Main car | Ford |
Syntax: %$ ... []%
If variable is simple double array, it can be displayed, if square brackets are added after the variable. Table has no header. If variable is not well formed, table may show unpredictable results.
%$person.cars[]%
| Ford | https://ford.com | Fiesta, Focus, Mustang |
| BMW | https://bmw.com | 320, X3, X5 |
| Fiat | https://fiat.com | 500, Panda |
To generate table header automatically add empty curly brackets.
%$person.cars[]{}%
| name | url | models |
|---|---|---|
| Ford | https://ford.com | Fiesta, Focus, Mustang |
| BMW | https://bmw.com | 320, X3, X5 |
| Fiat | https://fiat.com | 500, Panda |
Syntax: %$ ... []{ ... }%
Curly brackets contain pairs with header name and path for each column.
%$person.cars[]{"Name":name, "Model 1":models.0, "Model 2":models.1, "Model 3":models.2}%
| Name | Model 1 | Model 2 | Model 3 |
|---|---|---|---|
| Ford | Fiesta | Focus | Mustang |
| BMW | 320 | X3 | X5 |
| Fiat | 500 | Panda | (null) |
Syntax: %$ ... [( ... )]{ ... }%
Filter rules may be added inside brackets inside square brackets. Each row will be checked against filter.
%$person.cars[(name > b and name <= fiat)]{"Name":name, "Model 1":models.0, "Model 2":models.1, "Model 3":models.2}%
| Name | Model 1 | Model 2 | Model 3 |
|---|---|---|---|
| BMW | 320 | X3 | X5 |
| Fiat | 500 | Panda | (null) |
Syntax: %$ ... []{ ... } # ... #%
Format must contain pairs with header description linked to format.
%$person.cars[]{"Name":name, "Webpage":url, "Models":models, "Number of models":models} #Webpage:link, "Number of models":ejs?<$=d.length$>#%
| Name | Webpage | Models | Number of models |
|---|---|---|---|
| Ford | https://ford.com | Fiesta, Focus, Mustang | ["Fiesta","Focus","Mustang"]<%=d.length%> |
| BMW | https://bmw.com | 320, X3, X5 | ["320","X3","X5"]<%=d.length%> |
| Fiat | https://fiat.com | 500, Panda | ["500","Panda"]<%=d.length%> |
Show contents only, if it matches filter inside brackets. Syntax: %$-start ( ... )% ... %$end%
%$-start (person.cars)% ==== Section about Cars ==== This section should **be visible**. %$end%
This section should be visible.
%$-start (person.motorcycles)% ==== Section about Motorcycles ==== This section should not be visible. Not even in TOC. %$end%
Mind extra i in %$-starti ( … )% … %$end% for inline text.
He sells %$-starti (person.cars)%**Cars**%$end% %$-starti (person.cars and person.motorcycles)% and %$end% %$-starti (person.motorcycles)%**Motorcycles**%$end%.
He sells Cars .