Menu

Smart Highlighter

March 21st, 2012

Smart Highlighter is a code highlighter, utilising Syntax Highlighter from http://alexgorbatchev.com/SyntaxHighlighter/, that is available in a free and paid version. Smart Highlighter intelligently detects what languages are required on a given page, and loads only the javascript and CSS files required, ensuring optimal performance.

Features:
– Loads required CSS and javascript files intelligently when needed.
– Usage notes in the plugin’s settings page for easy reference.
– Can select from either v2 or v3 of Syntax Highlighter.
– Includes 7 theme choices.
– Multiple options for setting Syntax Highlighter’s global defaults.
– (Paid version) Multiple options for setting Syntax Highlighter’s global strings (eg. ‘expand source’ text)
– (Paid version) Multiple options for setting display colours (eg. Gutter border colour)
– (Paid version) Includes a tool for converting < and > to &lt; and &gt; before pasting code sample into article.

Once Smart Highlighter is enabled, all you need to do is add your code sample to any article, and Smart Highlighter will add the required files (and only the required files) to the page. To add a code sample to an article, simply add the code within a pre html tag, specifying the correct language in the pre tag’s class attribute. Smart Highlighter’s settings page indicates the correct format for this, as well as a list of language aliases for easy reference.

There is a free version available with all the essential options. Upgrade to the paid version to have access to several more options (click on Documentation above for details), including a handy tool for instantly converting all angled brackets to html-escaped equivalents.