About Custom Highlighter Scripts to color a custom tag

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.

  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;

About Custom Highlighter Scripts to color a custom tag

Postby camilokawerin » Sun May 31, 2009 4:02 pm

Hi, IĀ´m evaluating Webuilder and IĀ´m interested in a feature I have using UltraEdit witch is the posibility of use a different color for a custom group of tags in a language. I work with a content management system where I use some code like this:

<block id="my_block">
<ul>
<row>
<li><a href="{function_link()}">{$title}</a></li>
</row>
</ul>
</block>

IĀ´d like to define a color for "block" and "row" tags, $variables and functions(). IĀ´ve been testing with Custom Highlighter Scripts to get this, but I didnĀ´t make it work. Is possible to do that with Webuilder? And what should I add to my custom script if itĀ´s possible?

Thanks in advance!
camilokawerin
 
Posts: 2
Joined: Sun May 31, 2009 3:42 pm

Re: About Custom Highlighter Scripts to color a custom tag

Postby Gatis » Sun May 31, 2009 8:33 pm

Yes, it is possible to have the highlighting to be customized, so that tags can have different colours.
Go to Main Menu; Options; Preferences; Text Editor; Colors; Advanced Tools; Custom Highlighter Scripts; select HTML; click Browse.
Browse to folder: "C:\Program Files\WeBuilder 2008\data\hscripts" and choose "MulticolorHTML.xs". Restart program.
This will load that file and you will be able to specify a color for <img > tag, for example (you can define color also under "Text Editor; Colors;").
Similarly you can achieve the desired effect for other tags, by carefully modifying the existing Highlighter Script or creating your own.
Kind regards,
Gatis Avots
Gatis
Blumentals Software Developer
 
Posts: 545
Joined: Sun Mar 05, 2006 12:30 am
Location: Latvia

Re: About Custom Highlighter Scripts to color a custom tag

Postby camilokawerin » Mon Jun 01, 2009 8:16 am

Great! IĀ´ve tried with a group of custom tags and it works perflectly.

Anyway, I donĀ´t understand at all what is the logic of the *.xs files.

For example, when you say:

snormal <form shtmlFO thtmlform
shtmlFO [^>^\"]* shtmlFO thtmlform
shtmlFO > snormal thtmlform

How should I read it?

Also, IĀ´ve tried a regular expression to fit all the portion of code between { and } at my templates and it didnĀ´t work. IĀ´ve tried with:

snormal \{[.]*\} snormal tcmsvals

Later, if you could clarify to me that issues, IĀ´ll try to apply a different color to $variables, functions() and 'literals' inside my code.

Thank you very much!
camilokawerin
 
Posts: 2
Joined: Sun May 31, 2009 3:42 pm

Re: About Custom Highlighter Scripts to color a custom tag

Postby Gatis » Tue Jun 02, 2009 5:36 pm

Unfortunately I can not give you very detailed explanation of how this works now.
>> snormal <form shtmlFO thtmlform

Basically first comes the current parser state - "snormal", then the text rule "<form" (regular expression or simple string) that should be checked, then the new parser state "shtmlFO", and finally the token's ID "thtmlform" (which you can then use to specify custom color).
In the upcoming Major version we will add more detailed explanation of how these things work (most likely this info will be added in the Knowledge Base in our web site).
Kind regards,
Gatis Avots
Gatis
Blumentals Software Developer
 
Posts: 545
Joined: Sun Mar 05, 2006 12:30 am
Location: Latvia


Return to HTMLPad / Rapid CSS / Rapid PHP / WeBuilder Support

Who is online

Users browsing this forum: No registered users and 14 guests