SUIT Framework

Scripting Using Integrated Templates

Docs - Attributes

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

What is an Attribute?

An attribute is used to modify the properties of a rule through the template. If a rule is configured to use attributes, any attributes in any order can be used, which will modify variables that the rule's functions use.

Attribute Config

A Double Sided rule using attributes (Such as if) needs two rules to operate. The first matches the unmodified open and close strings (Ex. "[rule]" and "[/rule]"), defines the default variables, and configures how to assign the attributes for it.

Static Variables
blacklist

Whether or not if a list has been provided, it should be treated as a blacklist. (Default: null. If a list has been provided, it will be treated like a whitelist.)

equal

The string to be used for assignment. (Default: "=")

list

A list of template names to either be blacklisted or whitelisted. (Default: null. All files could be grabbed from.)

log

Whether or not the execute call should be logged. (Default: false)

onesided

If true, the variables are defined through the rules contents. If null or false, the variables are defined from another rules contents. (Default: null.)

quote

The string to contain values. (Default: "\"")

var

The dict containing the variables to be used by the rule's functions which might be editable by attributes. (Default: Varies from rule to rule)

The second rule matches the open and close strings for the attribute statement (Ex. "[rule" and "]"), stores its contents, and treats the entire statement as a new opening string.

Config Notes
  • Has 'skip' enabled as true.

When both rules combined are successfully matched, a function will define variables on var using the contents of the second rule, have the new var overwrite all of the Static Variables, and continue as normal.

One Sided Attribute Config

One Sided rule using attributes (Such as return) only needs one rule. The Static Variables are the same, except for onesided being true. In addition, the following Config is applied:

Config Notes
  • Has 'skip' enabled as true.

When matched, a function will define variables on var using this rules contents, have the new var overwrite all of the Static Variables, and continue as normal.

BBCode Config

Similarly to the Template Ruleset's Attribute Config, each attribute rule requires two rules: one to use the default settings with (Ex. "[rule]" and "[/rule]"), and another one to create modified rules (Ex. "[rule=" and "]"). However, BBCode attributes can only modify one variable: equal. In addition, the attribute string isn't split up by quotes, and additional configuration isn't necessary necessary.