JSyntaxHighlighter

This is a Joomla 2.5 plugin implementation based on SyntaxHighlighter by Alex Gorbatchev. It support syntax highlighting for over 20 languages including Applescript, ActionScript3, Bash/shell, ColdFusion, C#, C++, CSS, Delphi, Diff, Erlang, Groovy, JavaScript, Java, JavaFX, Perl, PHP, Plain Text, PowerShell, Python, Ruby, SCSS, Scala, SQL, Visual Basic, XML.

How to use this plugin

1. enable corresponding language in the plugin settings.

2. place any code within preformatted HTML element "<pre> ... </pre>"

3. add specially formatted class attribute with a brush alias to enable syntax highlighting for a selected language, ie <pre class="brush: js">. Full list of supported brushes is available at the following URL: http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/

If you use JCE you can add custom styles to Styles List which is found under Profiles => Profile name (ie Default) => Editor Parameters => Typography. Here is an example of the list I use on this site:

brush_sql = "brush: sql", brush_php = "brush: php", brush_xml = "brush: xml", brush_txt = "brush: text"

 Make sure to select pre Element when applying a style in the JCE editor

Attachments:
Download this file (jsyntaxhighlighter.zip)JSyntaxHighlighter.zip[JSyntaxHighlighter v1.0]78 kB

 

Would you like to contribute?



Free business joomla templates