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