Can someone please point me to some tutorial on creating my own coloring schemes? I wanted to highlight a specific file format I use in my application, which is basically a number of lines with a pretty fixed format like this:
Code: Select all
command filename filesize filedate filehash [extra]
So I extracted
filesbbc.hrc from Colorer's
common.jar and updated the regexp definitions. That seemed straightforward enough, but now I am uncertain how to make Far Colorer to actually use this definition on my files. I tried adding a link to this file to
catalog.xml, but no success. I updated my file to include a
<prototype> section with a
<filename> definition, and now I can see my scheme in Colorer's "Scheme settings", but I still can't get colored text for my file.
The HRC file is:
Code: Select all
<?xml version="1.0" encoding="windows-1251"?>
<!DOCTYPE hrc PUBLIC "-//Cail Lomecb//DTD Colorer HRC take5//EN"
"http://colorer.sf.net/2003/hrc.dtd">
<hrc version="take5" xmlns="http://colorer.sf.net/2003/hrc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://colorer.sf.net/2003/hrc http://colorer.sf.net/2003/hrc.xsd">
<type name="vfy">
<import type="def"/>
<region name="VfyOperator" parent="Keyword" description="VFY operator" />
<region name="VfyFileName" parent="Path" description="Path" />
<region name="VfyFileSize" parent="Number" description="Size of file" />
<region name="VfyFileDate" parent="Date" description="Date/time of file" />
<region name="VfyFileHash" parent="Comment" description="Hash of file" />
<scheme name="vfy">
<regexp match="/^(MATCHED|ADDED|CHANGED|DELETED|COPIED|RENAMED)\t/i" region0="VfyOperator"/>
<regexp match="/^(\".*?\")/i" region0="VfyFileName"/>
<regexp match="/(?<=\s)(\d+)/" region0="VfyFileSize"/>
<regexp match="/(?<=\s)(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(.\d{3})?)(?=\s)/i" region0="VfyFileDate"/>
<regexp match="/(?<=\s)([a-zA-Z0-9+/]{22})==/" region0="VfyFileHash"/>
</scheme>
</type>
<prototype name="vfy" group="other" description="vfy (pepak)">
<filename>/(.*\.(hashlist|changes))$/i</filename>
</prototype>
</hrc>
And the relevant lines in catalog.xml:
Code: Select all
<hrc-sets log-location="">
<location link="&hrc;/proto.hrc"/>
<location link="&hrc;/pepak/vfy.hrc"/>
<location link="&hrc;/auto"/>
</hrc-sets>