Plugin Directory

Crayon Syntax Highlighter

Syntax Highlighter supporting multiple languages, themes, fonts, highlighting from a URL, local file or post text.

Download Version 1.8.1

Author: akarmenia

A Syntax Highlighter built in PHP and jQuery that supports customizable languages and themes. It can highlight from a URL, a local file or WordPress post text. Crayon makes it easy to manage Language files and define custom language elements with regular expressions. It also supports some neat features like:

  • Toggled plain code
  • Toggled line numbers
  • Copy/paste code
  • Open code in a new window (popup)
  • Remote request caching
  • Mixed Language Highlighting in a single Crayon
  • Mini Tags like [php][/php]
  • Plain Tag ([plain]...[/plain]) for quick <pre><code>...</code></pre>
  • <pre> tag support
  • Mobile/touchscreen device detection
  • Mouse event interaction (showing plain code on double click, toolbar on mouseover)
  • Tab sizes
  • Code title
  • Toggled toolbar
  • Striped lines
  • Line marking (for important lines)
  • Starting line number (default is 1)
  • Local directory to search for local files
  • File extension detection
  • Live Preview in settings
  • Dimensions, margins, alignment and CSS floating
  • Extensive error logging

Supported Languages

Languages are defined in language files using Regular Expressions to capture elements. See http://ak.net84.net/projects/crayon-language-file-specification/ to learn how to make your own.

  • Default Langauge (one size fits all, highlights generic code)
  • ActionScript
  • C
  • C#
  • C++
  • CSS
  • HTML (XML/XHTML)
  • Monkey
  • Java
  • JavaScript
  • Objective-C
  • PHP
  • PostgreSQL (thanks to http://bitorchestra.com/)
  • Python
  • Ruby
  • Shell (Unix)
  • Visual Basic

Live Demo: http://bit.ly/poKNqs

Short How-To: http://ak.net84.net/projects/crayon-syntax-highlighter/

Please Thank Me With Coffee!

International Languages

  • Chinese (Simplified, thanks to Dezhi Liu)
  • French
  • German (thanks to Stephan Knauß)
  • Italian
  • Spanish
  • Japanese (thanks to @west_323)
  • Russian (thanks to Minimus & Di_Skyer)
  • Turkish (thanks to Hakan)
  • Help from translators at improving/adding to this list greatly appreciated!

Articles

These are helpful for discovering new features.

Planned Features

  • AutoIt support
  • PowerShell support
  • LUA
  • YAML
  • Highlighting in sentences
  • Highlighting in comments
  • Visual Editor Support
  • Theme Editor

Requires: 3.0 or higher
Compatible up to: 3.3.1
Last Updated: 2012-2-18 Downloads: 10,351

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(25 ratings)

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

Log in to vote.

100,1,1
100,1,1 100,1,1 50,2,1 100,1,1 100,1,1 100,1,1 100,1,1 100,3,3 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 100,2,2 100,2,2 100,1,1 100,1,1 100,2,2
100,2,2 100,1,1 100,1,1 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,2,2 100,4,4