zen0wu / topcoder-greed

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

Move Contest Category from StringUtil to own renderer. #95

Closed vexorian closed 10 years ago

vexorian commented 10 years ago

In #85 we talked about moving the contest category renderer out of String Util.

This refactor also makes the Contest Category renderer render a Contest object. It makes the syntax easier. Also, the default now makes SRMs render as "SRM" and hen doing "srm=1" it will use a single name for each SRM (Although SRM 599 test practice room renders as "SRM 599").

// ${Contest;category}
// ${Contest;category("srm=1")}
// ${Contest;category("srm=2")}
// ${Contest;category("srm=10")}
// ${Contest;category("srm=100")}
// ${Contest;category("srm=25")}

Renders to :

// SRM
// SRM 599
// SRM 598-599
// SRM 590-599
// SRM 500-599
// SRM 575-599

In the future, we can add more options, like ability to split TCOs by year.

zen0wu commented 10 years ago

Please update the doc too, thanks!