Word Rules

Word rules are applied to the document first. They are applied to groups of characters that are letters (the case does not matter).

You cannot use word highlighting rules to apply highlighting to numbers or non-letter (for example $ % & # @ .....)

All word rules must sit with the <wordRules></wordRules> tags within the XML file.

The following is an example of a word rule definition:

    <rule acitve="true" bold="false" underline="true" italic="true" color="blue">
      <words>
        <!--space seperated list of words-->
        <![CDATA[the quick brown fox jumped over the lazy dog]]>
      </words>
    </rule>

Rule Attributes

The attributes for the rule are all optional and are as follows:

active if true then this rule is applied, if false then this rule is ignored. If not specified then it defaults to "true"

bold if true then any words that match this rule are made bold. If not specified then it defaults to "false"

underline if true then any words that match this rule are underlines. If not specified then it defaults to "false"

italic if true then any words that match this rule are made italic. If not specified then it defaults to "false"

color if true then any words that match this rule have their fore colour set to this value. It can either be a word for the most common colours (blue, red, green, darkblue, etc) or it can be a hex code. If not specified then it defaults to "black". If you specify an invalid colour name or code then ChromaCode will throw an exception when the rule file is loaded and parsed

Rule Words

The list of words that the rule should apply to are placed within the <words></words> tags. The list of words should be space seperated or on seperate lines. You do not need to place then in the <![CDATA[]]> tag but this is recommeded to ensure that the XML parser does not try to validate any of your words and will just read the data "as is".

Last edited May 3, 2011 at 10:59 PM by NybbleUK, version 2

Comments

No comments yet.