zen0wu / topcoder-greed

greedy editor for topcoder arena
Apache License 2.0
229 stars 48 forks source link

Add template options. #96

Closed vexorian closed 10 years ago

vexorian commented 10 years ago

As decided in #93.

This adds an optional "options" field to a template's section in config file.

Then we can do:

options {
     key = value
}

After that, when the template is rendered, we can call ${Options.key} to render it and also do ${if Options.key} which will return false if the key is null or evaluates to "false" and true otherwise.

zen0wu commented 10 years ago

If you think it's necessary, we can upgrade the version of the config library.

vexorian commented 10 years ago

@shivawu it seems to work fine with the workaround.

@wookayin: I used HashMap because that's what the language section used. Why would Map be better?