dafky2000 / simplectemplate

Simple C Template library to expand placeholders in a template string, simple alternative to mustache.github.io that doesn't require JSON as data input.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support nested placeholders

dafky2000 opened this issue · comments

So we can do something like:

{{data.link1:<a href="{{data.link1}}">Test link</a>}}

And the link is only displayed if the variable is defined.

Requires #23

As per #23 (comment)

For example we should be able to replace:

data.key  = "has value"
data.key2 = "also has value"
data.key3 = "maybe"

  {{data.key text to use if the {{data.key2 inner key {{data.key3}}}} has content}}
= {{data.key text to use if the {{data.key2 inner key maybe}} has content}}
= {{data.key text to use if the inner key maybe has content}}
= text to use if the inner key maybe has content

Closed via #61