Edit highlighting style files manually

Introduction

In order to display the corresponding highlighting files, you must first select the "Markup" section in the preferences and then click the "Show Styles" button.
The highlighting styles are stored in plist files, also known as XML files. There are two different options for searching specific text patterns:
For both options, several parameters can be specified, which are grouped in arrays whose names are:
Each search parameter and its values ​​are summarized in so-called dictionaries. Each search parameter consists of the following key-value pairs:

Color namespace

The colors must be in hexadecimal notation, as is the case in CSS files or HTML. Most colors are in the following format: #FF33AA. It is also possible to use a short notation: #F3A. If the specified color value is not valid, no color is displayed.

To quickly test the edited style files, simply use the language selection in MarkMyWords. To reload a style simply select a different language and then go back to the language whose styles have been edited. A restart of MarkMyWords is not necessary.

If the structure of the highlight style files is broken, they will not load, but MarkMyWords will continue to work.

In the case that MarkMyWords should stop working, just delete the edited style files and restart MarkMyWords. In this case, MarkMyWords will copy the original style files to the appropriate application support directory to restore the highlighting feature.

Simple String Styles Code

sample code


<dict>
<key> searchFor </key>
<string> +quote+ </string>
<key> foregroundColor </key>
<string> #FF0000 </string>
<key> backgroundColor </key>
<string> #FFFFFF </string>
<key> useBackgroundColor </key>
<false/>
<key> useBold </key>
<true/>
<key> useItalic </key>
<false/>
</dict>

The searchFor parameter must be HTML valid, meaning that special characters must be declared in their HTML entity.

Example: Search for: <thisItem>; must be declared as follows &lt;thisItem&gt;

Complex Regular Expressions Styles

Code Example


<dict>
<key> searchFor </key>
<string> \*{2,5}(.*?)\*{2,5} </string>
<key> foregroundColor </key>
<string> #FF0000 </string>
<key> backgroundColor </key>
<string> #FFFFFF </string>
<key> useBackgroundColor </key>
<false/>
<key> useBold </key>
<true/>
<key> useItalic </key>
<false/>
</dict>

The regular expression code used is virtually identical to that for the normal strings. The big difference is the value for the searchFor property, which is a regular expression. As you can see in the code example, special characters have to be provided with a single \ as expected.