SUIT Framework

Scripting Using Integrated Templates

Docs - Rules Vs. Functions

12/27/2015: SUIT Framework is no longer actively maintained.

If you've read the documentation for call or transform, you might be wondering why anyone would want to construct their own Rules when they could just use these function rules. Both methods have their pros and cons.

Feature Applies to Rules? Applies to the function rules?
Uses a function or functions to generate or transform a string. Yes Yes
Accesses user defined parameters No Yes
Easiest to set up No Yes
Can be built on without modifying the rules dict No Yes
Shortest syntax Yes No
Can access the parse tree Yes No
Can modify the parser Yes No

Even if you choose to only use call and transform, they are powered by rules, so they are a necessary feature. We at SUIT tend to create rulesets with rules that will undoubtably be used a lot in the context, and use functions for cases unique to our projects. For instance, this site uses a function called "pygments" to highlight the code in our examples. Considering that most sites wouldn't need this, we created a function instead of adding it as a rule for the Templating Ruleset.