Crayon Syntax Highlighter

By : akarmenia

A Syntax Highlighter built in PHP and jQuery that supports customizable languages and themes. It can highlight from a URL, 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:

  • Integrated Theme Editor!
  • Tag Editor in both Visual & HTML editors
  • Toggled plain code
  • Toggled line numbers
  • Copy/paste code
  • Open code in a new window (popup)
  • Line wrapping
  • Code expanding
  • Minimizing
  • bbPress 2 support
  • Converting legacy code in blog posts/comments to <pre>
  • Remote request caching
  • Mixed Language Highlighting in a single Crayon
  • Mini Tags like [php][/php]
  • Inline Tags floating in sentences
  • Crayons in comments
  • `Backquotes` become <code>
  • <pre> tag support, option to use setting-value in the class attribute
  • Valid HTML 5 markup
  • Visual & HTML editor compatible
  • Mobile/touchscreen device detection
  • Mouse event interaction (showing plain code on double click, toolbar on mouseover)
  • Tab sizes
  • Code title
  • Toggled toolbar
  • Retina buttons
  • Striped lines
  • Line marking (for important lines)
  • Line ranges (showing only parts of the code)
  • Starting line number (default is 1)
  • File extension detection
  • Live Preview in settings
  • Dimensions, margins, alignment, font-size, line-height, float
  • Extensive error logging

Links

  • Beta Releases
  • Themes Demo
  • GitHub Project

Contributions

There are many ways you can help!

  • Make a Theme and share
  • Add support for your favourite Language
  • Write a post about your pastel experiences and share
  • Donate to the project

Supported Languages

Languages are defined in language files using Regular Expressions to capture elements. See the Crayon Language File Specification to learn how to make your own.

  • Default Language (one size fits all, highlights generic code)
  • C1 (thanks to Oparin Pavel)
  • ABAP
  • ActionScript
  • AmigaDOS (thanks to amigalog.com)
  • Apache
  • AppleScript
  • Arduino
  • Assembly (x86)
  • AutoIt
  • C
  • C#
  • C++
  • Clojure (thanks to )
  • CoffeeScript (thanks to Dai Akatsuka)
  • CSS
  • Delphi/Pascal (thanks to Chris McClenny)
  • Delphi Web Script (thanks to smartmobilestudio)
  • Diff (thanks to omniavin)
  • Erlang (thanks to Daniel)
  • Go
  • Haskell
  • HTML (XML/XHTML)
  • INI
  • Lisp
  • Lua
  • Microsoft Registry (thanks to techexplored.com)
  • MIVA Script
  • Monkey (thanks to Devolonter)
  • MS-DOS (thanks to http://www.amigalog.com/?p=334)
  • MySQL (thanks to AssemblySys.com and ansas-meyer.de)
  • Java
  • JavaScript
  • Objective-C
  • Papyrus
  • Perl
  • PHP
  • PL/SQL
  • PostgreSQL (thanks to Bitorchestra)
  • PowerShell
  • Python
  • R
  • Ruby
  • Rust (thanks to Stibbons)
  • Scheme (thanks to Harry75369)
  • Shell (Unix)
  • Swift (thanks to weyhan)
  • Transact-SQL
  • TeX
  • Vim
  • Visual Basic
  • Visual Basic .NET (thanks to Kevin Gardthausen)
  • YAML
  • ZSH (thanks to Stibbons)
  • Others will be added when requested

International Languages

  • Arabic (thanks to Djennad Hamza)
  • Chinese Simplified (thanks to Dezhi Liu & Jash Yin)
  • Chinese Traditional (thanks to Arefly)
  • Dutch (thanks to Robin Roelofsen & Chilion Snoek)
  • Finnish (thanks to vahalan)
  • French (thanks to Victor Felder)
  • German (thanks to Stephan Knauß)
  • Italian (thanks to Federico Bellucci)
  • Japanese (thanks to @west_323)
  • Korean (thanks to dokenzy)
  • Lithuanian (thanks to Vincent G)
  • Persian (thanks to MahdiY)
  • Polish (thanks to Bartosz Romanowski)
  • Portuguese (thanks to Adonai S. Canez)
  • Russian (thanks to Minimus & Di_Skyer)
  • Slovak (thanks to Branco, webhostgeeks/)
  • Slovenian (thanks to Jan Sušnik, http://jodlajodla.si/)
  • Spanish (thanks to Hermann Bravo)
  • Tamil (thanks to KKS21199)
  • Turkish (thanks to Hakan)
  • Ukrainian (thanks to Michael Yunat)
  • Help from translators at improving/adding to this list greatly appreciated!

Articles

These are helpful for discovering new features.

  • Internal Post Management in Crayon
  • Converting Legacy Tags to <pre>
  • Crayon with bbPress
  • Line Ranges in Crayon
  • Crayon Tag Editor
  • Mixed Language Highlighting in Crayon
  • Mini Tags And Plain Tags In Crayon
  • Inline Tags
  • Enqueuing Themes and Fonts in Crayon

The Press

A handful of articles from others written about Crayon, thanks guys!

  • Crayon Syntax Highlighter Plugin Theme Color Previews
  • Using Crayon Syntax Highlighter WordPress plugin to post code snippets on your blog
  • How to post source code on WordPress
  • Syntax highlighter switched to Crayon
  • 5 Best Syntax Highlighter Plugins for WordPress
  • How To Post Source Code In WordPress
  • Top 5 Syntax Highlighter WordPress Plugins
  • Crayon Syntax Highlighter � Plugin
  • State of syntax highlighter support in bbPress 2
  • The ultimate plugin for displaying code in WordPress (French)
  • Finally!, A WordPress code syntax highlighting that works
  • Crayon Syntax Highlighter (and its studly author)
  • Add Code To Your WordPress Posts With Crayon Syntax Highlighter
  • 15 Best Syntax Highlighter WordPress Plugins
  • Displaying Code in WordPress with Crayon
  • ABAP Syntax Highlighting in WordPress (German)
  • Crayon Syntax Highlighter plugin
  • Crayon Syntax Highlighter (Russian)
  • Crayon Syntax Highlighter (also Russian)
  • How To Post Source Code
  • http://wp-best-practices.asdf573189.com/home/good-plugins/crayon-syntax-highlighter/
  • http://www.wplover.com/2155/crayon-syntax-highlighter-plugin/
  • http://www.htmlandphp.com/scripts/crayon-syntax-highlighter.html

Donations

Thanks to all those who donate to the project:

  • Christian Martens, (http://insgesamt.net/), Germany
  • Nilesh Govindrajan, (http://nileshgr.com/), India
  • ZengChun Yang, China
  • Alan Kaplan, (http://www.akaplan.com/blog), US
  • Christopher Yarbrough, (http://chrisyarbrough.com/), Germany
  • Johann Weiher, (http://codequartett.de/), Germany
  • Samuel Deering, Australia
  • Billiard Greg, (http://billiardgreg.com/), USA
  • Performance Simulations, (http://www.performancesimulations.com/), USA
  • Lindsay Ross, (http://gravelrash.com), New Zealand
  • Ruperto Coronado Muñoz, Mexico
  • Stefan Onderka, (http://www.onderka.com), Germany
  • Peter Kellner, (http://peterkellner.net), USA
  • Open Hardware Design Group LLC, (http://opensourcehardwaregroup.com/), USA
  • Helen McManus, (http://invisiblepixels.org/InvisibleWords/), Netherlands
  • Thomas Fee, UK
  • Julie Knowles, (http://knowlesfamily.com/), USA
  • Peter Kriegel, (http://www.powershell-group.eu/), Germany
  • Geo My WP, (http://geomywp.com), USA
  • Raffael Vogler, Germany
  • Erdal Cicek, Turkey
  • Cloud-VPS, Poland
  • Łukasz Bereza, Poland
  • Laurence Scotford, UK
  • Goretity Árpád László, (http://h2co3.org/blog), Hungary
  • AdsProvider, USA
  • Alicia Ramirez, (http://aliciaramirez.com/), Canada
  • William Eisert, USA
  • Inappix Development, (http://www.inappix.com/), Switzerland
  • Stephen Sant, (http://thesantfamily.net/), UK
  • David Rodriguez, (http://davidarodriguez.com/), USA
  • Chris Moore, (http://moorecreativeideas.com/), USA
  • Sohail Ahmed, (http://sohail.io.com/), USA
  • Vanessa Garcia Espin, Spain
  • Samad Malik, (http://samadmalik.com/), USA
  • Wabbit Wanch Design, (http://www.wabbitwanch.com/), Canada
  • Inopox Ltd, (http://inopox.com/), Cyprus
  • Kho Minh Vi, (http://khominhvi.com/), UK
  • Ivan Churakov, Russia
  • Carla Macías González, Mexico
  • Saulius Stonys, Lithuania
  • Konstantin Sabel, Germany
  • Luigi Massa, (http://bwlab.it/), Italy
  • Anthony Steiner, (http://steinerd.com/), USA
  • Alexander Harvey, (http://alexharvey.eu/), UK
  • Minhazul Haque Shawon, Cyprus
  • Raam Dev, (http://raamdev.com/), USA
  • Scot Ranney, (http://scotsscripts.com/), USA
  • Nico Hartung, (http://www.loggn.de/), Germany
  • Joseph DeVenuta, USA
  • Iván Prego García, Spain
  • Johannes Luijten, (http://www.tweaking4all.com/, http://www.weethet.nl/), USA
  • Jack Fruh, (http://basementjack.com/), USA
  • Ross Barbieri, USA
  • Will, Simple Phishing Toolkit (http://www.sptoolkit.com/), USA
  • Tricia Aanderud, USA
  • Tarek Sakr, (http://centrivision.com/), USA
  • Jeff Benshetler, (http://branchpoint.net/), USA
  • Oldrich Strachota, (http://www.strachota.net/), Czech Republic
  • Dividend Ninja, (http://dividendninja.com/), Canada
  • Chris Wiegman, (http://bit51.com/), USA
  • Sven Meier, (http://www.codesix.net/), Germany
  • Christy Wiggins, (http://www.jinxyisms.com/), USA
  • eSnipe, Inc. (http://esnipe.com/), USA (again!)
  • Aliseya Wright, (http://blog.xoxothemes.com/), USA
  • Jeremy Worboys (http://complexcompulsions.com/), Australia
  • Steve McGough, Spider Creations, LLC. (http://spidercreations.net/), USA
  • eSnipe, Inc. (http://esnipe.com/), USA
  • Gerald Drouillard (http://www.drouillard.biz/), USA
  • Greg Pettit (http://blog.monkey-house.ca/), Canada
  • Waimanu Solutions (http://daveblog.waimanu.web44.net/), USA
  • Andrew McDonnell (http://blog.oldcomputerjunk.net/), Australia
  • Perry Bonewell (http://pointatthemoon.co.uk/), United Kingdom
  • Nick Weisser (http://www.openstream.ch/), Switzerland

Lite Syntax Highlighting

The Plugin makes it easy to add syntax highlighting of code in your blog posts. It adds some buttons to editor, which generate special html tags to turn on syntax highlighting: <pre class="html"></pre> for example. The plugin supports highlighting: PHP HTML CSS JavaScript C Language.........

Similar: 84%

Sau Syntax

Please use SyntaxHighlighter Evolved instead. Recommended WordPress Plugins SB Paginate SB TBFA ...

Similar: 80%

APH Prism Highlighter

Prism is one of the most popular syntax highlighters that widely used by a lot of blog or websites, some of them are popular websites, such as Mozilla, drupal, and SitePoint. One reason why a lot of websites prefer to use this highlighter is because it's ability to do custom builds of the language.........

Similar: 60%

Prism Syntax Highlighter for WordPress

Despite two plugins already on wordpress.org I decided to write my own from scratch. The result is a minimalistic but powerful plugin with only ~250 lines of PHP. Supports every possible Prism configuration. Does not load prism on every page, only when needed. Supports automatic detection of prism.........

Similar: 46%

Pygments for WordPress

This WordPress plugin is a syntax highlighter for many different computer languages, including HTML, Python, PHP, Javascript, CSS, and many others. It uses the Pygments syntax highlighter from Python. See http://derek.simkowiak.net/pygments-for-wordpress/ for full documentation....

Similar: 43%

SyntaxHighlighter Evolved: Swift Brush

This simple WordPress plugin adds support for the Swift Programming Language to the SyntaxHighlighter Evolved plugin. Requires SyntaxHighlighter Evolved plugin to be installed first....

Similar: 38%

Short Syntax Highlighter Shortcode

Short Syntax Highlighter allows you to easily post syntax-highlighted code to your site without losing it's formatting or making any manual changes. Without adding any JS or css file in your theme. This plugin will help you to highlight the code systax. Step by step installation instructions >&.........

Similar: 31%

rtSyntax

Uses highlight.js. 26 themes included. 55 languages supported (54 from highlight.js + 1 for nginx commands). Auto-detects language. Super-optimised, only loads js for the language. Adds buttons to tinyMCE for ease of adding code blocks. Optimised code with minimal overheads. All code on Github. ...

Similar: 28%

Plum Code Box

Do you ever have a really hard getting your code formatted correctly in a post? Or do you ever have issues preserving tabs? Plum Code Box makes it easy to insert and manage code blocks using the Chili javascript syntax highlighter. The plugin adds option boxes to post and page editors. There are al.........

Similar: 25%

SmartAss Highlighter

SmartAss Highlighter is a simple and easy to use code prettifier for wordpress. The code between <pre> and </pre> tags is highlighted. Almost all languages are supported, no need to mention the code language. Customizable for each post, use [highlighter] shortcode to enable for particul.........

Similar: 15%