diff --git a/accessibility-checker-engine/README-RULES.md b/accessibility-checker-engine/README-RULES.md index d5842685a..0682a1fa8 100644 --- a/accessibility-checker-engine/README-RULES.md +++ b/accessibility-checker-engine/README-RULES.md @@ -14,28 +14,28 @@ Multiple objects are needed for a rule to fire and show up in the tool results: ### Rule object The basic rule format is defined by the Rule type in [src/v4/api/IRule.ts](src/v4/api/IRule.ts). Rule implementation is located in [src/v4/rules](src/v4/rules). The rule context, including DOM object hierarchies, attributes, explicit/implicit CSS and ARIA attributes, that may trigger a rule, are defined in [src/v2/common/Context.ts](src/v2/common/Context.ts). The rule results can be one of: -* RulePass("MSG_ID") -* RuleFail("MSG_ID") -* RulePotential("MSG_ID") -* RuleManual("MSG_ID") +* RulePass("pass_reason") +* RuleFail("fail_reason") +* RulePotential("potential_reason") +* RuleManual("manual_reason") Each of these can take message arguments as a string array in the second parameter. They may also pass parameters to other APIs as an array in the third argument. An example rule might look like: ``` { - id: "TRIGGER_ALL_BODY", + id: "body_all_trigger", context: "dom:body", help: { "en-US": { - 0: `TRIGGER_ALL_BODY.html`, - "Pass_0": `TRIGGER_ALL_BODY.html` + 0: `body_all_trigger.html`, + "Pass_0": `body_all_trigger.html` } }, messages: { "en-US": { "group": "Grouping label for the rule", - "Pass_0": "Check the body element for something" + "manual_always": "Check the body element for something" } }, rulesets: [{ @@ -49,7 +49,7 @@ An example rule might look like: const ruleContext = context["dom"].node as Element; const domAttrs = context["dom"].attributes; - return return RuleManual("Pass_0"); + return RuleManual("manual_always"); } } ``` @@ -69,19 +69,19 @@ Each rule may have one or more test cases. Test cases are located in [test/v2/ch