What's new? | Help | Directory | Sign in
Google
                
Search
for
Updated May 11, 2007 by alex.gorbatchev
Labels: Documentation
Brushes  
Brushes.

Brushes

What are they?

Brushes, is a term I made up to call highlighters scripts for individual languages. SyntaxHighlighter uses modular approach and consists of core library shCore.js and a number of brushes which look like shBrushXml.js, shBrushCss.js and so on.

How do they work?

Each brush describes a set of rules for a particular language. These rules are based on keywords, regular expressions and CSS styles. Most languages follow the same syntax and are parsed in the same way as long as you provider some basic rules for parsing strings, comments and so on.

Alternatively, you can write a completely custom brush and implement your own parsing. An example of such brush is shBrushXml.js. It provides formatting for XML/HTML code which doesn't follow same style as say C# or Java does.


Comment by bboy.mr.freeze, Mar 06, 2008

i coded a script for bash support, the file is here: http://bboy.mr.freeze.googlepages.com/shBrushBash.js

Comment by jasonm23, Mar 23, 2008

Typo there, top reference to shBrushXml.js should read shBrushJScript.sh

Comment by loretoparisi, May 31, 2008

I'm starting to brushing a new highlighter for Erlang language :)