Closed dunkelstern closed 5 years ago
Currently if a section is a function, the function will not be called.
Example:
template = '{{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{state}}} {{/first}}'
So i define first to be a function that does something to the content of the section
first
def first(content): return "not implemented" data = { "postcode": "1234", "city": "Mustache City", "state": "Nowhere", "first": first, } print(chevron.render(template, data))
What currently happens: 1234 || || || What I intend to happen: 1234 not implemented
1234 || || ||
1234 not implemented
Of course in reality when implementing the first function proper, i would like to have: 1234 Mustache City
1234 Mustache City
This is an example from https://github.com/OpenCageData/address-formatting, they use a yaml file for defining how to format an address for another country which contains mustache templates.
Thanks a lot to @klorenz for implementing this in PR #27!
Thanks a lot from me too :)
Currently if a section is a function, the function will not be called.
Example:
So i define
first
to be a function that does something to the content of the sectionWhat currently happens:
1234 || || ||
What I intend to happen:1234 not implemented
Of course in reality when implementing the
first
function proper, i would like to have:1234 Mustache City
This is an example from https://github.com/OpenCageData/address-formatting, they use a yaml file for defining how to format an address for another country which contains mustache templates.