=== Crayon Syntax Highlighter ===
Contributors: akarmenia
Donate link: http://ak.net84.net/files/donate.php
Tags: syntax highlighter, syntax, highlighter, highlighting, crayon, code highlighter
Requires at least: 3.0
Tested up to: 3.3
Stable tag: trunk
Syntax Highlighter supporting multiple languages, themes, fonts, highlighting from a URL, local file or post text.
== Description ==
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
* Multiple 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)
* C
* C#
* C++
* CSS
* HTML (XML/XHTML)
* Java
* JavaScript
* Objective-C
* PHP
* Python
* 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**
* French
* German
* Italian
* Spanish
* Japanese (thanks to @west_323)
* Help from translators at improving/adding to this list greatly appreciated!
**Articles**
These are helpful for discovering new features.
* Mixed Language Highlighting in Crayon
* Mini Tags And Plain Tags In Crayon
**Planned Features**
* Highlighting priority
* Theme Editor
== Installation ==
Download the .zip of the plugin and extract the contents. Upload it to the Wordpress plugin directory and activate the plugin.
You can change settings and view help under Settings > Crayon in the Wordpress Admin.
== Frequently Asked Questions ==
= How do I use this thing? =
[crayon lang="php"] your code [/crayon]
[crayon url="http://example.com/code.txt" /]
[crayon url="/local-path-defined-in-settings/code.java" /]
You can use <pre>:
<pre lang="php"> your code </crayon>
You can also use Mini Tags:
[php theme="twilight"]your code[/php]
Please see the contextual help under Settings > Crayon for quick info about languages, themes, etc.
= I need help, now! =
Contact me at http://twitter.com/crayonsyntax or crayon.syntax@gmail.com.
== Screenshots ==
1. Classic theme in Live Preview under Settings > Crayon.
2. Twilight theme.
== Changelog ==
= 1.7.3 =
* Added Mini Tags and Plain Tags into Crayon. http://bit.ly/rRZuzk
* Fixed a bug causing RSS feeds to contain malformed HTML of Crayons, now it shows plain code with correct indentations. Thanks to Артём.
* Updated help in Settings and http://ak.net84.net/projects/crayon-syntax-highlighter/
= 1.7.2 =
* Fixed a bug that prevented foreign languages from being initialised and used. Thanks to @west_323 for finding it.
= 1.7.1 =
* Renamed Japanese GNU language code from ja_JP to ja.
= 1.7.0 =
* Added the ability to highlight multiple languages in a single Crayon! http://bit.ly/ukwts2
* A bunch of language improvements, a few CSS improvements, etc.
= 1.6.6 =
* Fixed a bug causing international Unicode characters being garbled in the title (thanks to simplelib.com!)
* Fixed a bug that prevented strings from being highlighted
= 1.6.5 =
* Fixed a bug causing international Unicode characters being garbled
= 1.6.4 =
* Added user submitted Japanese language support. Thanks to @west_323!
* <pre></pre> tags are now captured as Crayons. This can be turned off in Settings > Crayon > Code.
* You can remove prevent capturing individual <pre> tags the same way as Crayons: $<pre> ... </pre>
* This method of preventing the <pre> tag should be used if your code contains <pre> tags (nested <pre> tags) - otherwise it will cause conflicts.
* Keep in mind that <pre> tags should not be editted in Visual Mode. Crayon will display all code as it appears in the HTML view of the post editor, where you can make code changes and use the tab key etc. If you want to use the Visual editor reguarly and are running into problems, consider loading the code form a file using the 'url' attribute.
* I have removed the ability to have spacing between the starting and ending square brackets, so [crayon...] is valid but [ crayon ... ] is not.
The same applies to <pre> tags (not < pre >). The reason is to improve performance on posts without Crayons by using strpos and not regex functions like preg_match, and also it's better formed.
* Fixed a bug causing Plain Code to display characters as encoded HTML entities
* Removed jQuery 1.7 from /js folder. Now uses the version provided by WP.
= 1.6.3 =
* For those still having issues with CSS and JavaScript not laoding, I have added a new setting in Misc. that will allow you to either attempt to load these resources when needed if you have no issues with your theme or to force them to load on each page.
* Please see: http://ak.net84.net/php/loading-css-and-javascript-only-when-required-in-a-wordpress-plugin/
= 1.6.2 =
* Added ability to use and define language aliases. eg. XML -> XHTML, cpp -> c++, py -> python
= 1.6.1 =
* Avoided using $wp_query, $posts instead
* Updated contextual help to be compliant with WP 3.3
= 1.6.0 =
* Added internationalisation with 4 new languages: German, Spanish, French and Italian
* These were translated using Google Translate, so if you speak these languages and would like to improve them,
it's actually quite easy to edit - just contact me via email :)
* More languages will be added as they are demanded
= 1.5.4 =
* Recommended update for everyone
* Fixed a bug that caused the default theme not to load if was anything but "classic" - Thanks to Ralph!
= 1.5.3 =
* Fixed issue with incorrectly specified theme causing crash
* Email Developer improved
= 1.5.2 =
* Proper enquing of themes via wordpress, should cause no more issues with any themes
* Cached images for toolbar items, no delay on mouseover
* Fixed a minor regex bug in js preventing styles from being removed when in popup
= 1.5.1 =
* Fixed plain code toggle button update
= 1.5.0 =
* Added ability to cache remote code requests for a set period of time to reduce server load. See Settings > Crayon > Misc. You can clear the cache at any time in settings. Set the cache clearing interval to "Immediately" to prevent caching.
* Fixed a bug preventing dropdown settings from being set correctly
* Fixed AJAX settings bug
* Fixed CSS syntax bug for fonts
* Improved code popup, strips style atts
* Added preview code for shell, renamed to 'Shell'
* Code popup window now shows either highlighted or plain code, depending on which is currently visible
= 1.4.4 =
* Revised CSS style printing
* Fixed bugs with the "open in new window" and copy/paste actions
* Upgraded jQuery to 1.7
= 1.4.3 =
* Fixed a bug that caused the help info to remain visible after settings submit
= 1.4.2 =
* Huge overhaul of Crayon detection and highlighting
* IDs are now added to Crayons before detection
* No more identification issues possible
* Highlighting grabs the ID and uses it in JS
* Only detects Crayons in visible posts, performance improved
* This fixes issues with
= 1.4.1 =
* Fixed Preview in settings, wasn't loading code from different languages
* Fixed code toggle button updating for copy/paste
* Added some keywords to c++, changed sample code
= 1.4.0 =
* Added all other global settings for easy overriding: http://ak.net84.net/projects/crayon-settings/
* Fixed issues with variables and entites in language regex
* Added Epicgeeks theme made by Joe Newing of epicgeeks.net
* Help updated
* Fixed notice on missing jQuery string in settings
* Reduced number of setting reads
* Setting name cleanup
* Added a donate button, would appreciate any support offered and I hope you find Crayon useful
* String to boolean in util fixed
= 1.3.5 =
* Removed some leftover code from popupWindow
= 1.3.4 =
* Added the ability to open the Crayon in an external window for Mobile devices, originally thought it wouldn't show popup
= 1.3.3 =
* Added the ability to open the Crayon in an external window
= 1.3.2 =
* Added missing copy icon
= 1.3.1 =
* This fixes an issue that was not completely fixed in 1.3.0:
* Removed the lookbehind condition for escaping $ and \ for backreference bug
= 1.3.0 =
* Recommended upgrade for everyone.
* Major bug fix thanks to twitter.com/42dotno and twitter.com/eriras
* Fixed a bug causing attributes using single quotes to be undetected
* Fixed a bug causing code with dollar signs followed by numbers to be detected as backreferences and replace itself!
* Fixed a bug causing formatting to be totally disregarded.
* Fixed the tag in post_content and the_excerpt by placing crayon detection after all other formatting has taken place
* Added copy and paste, didn't use flash, selects text and asks user to copy (more elegant until they sort out clipboard access)
* Added shell script to languages - use with lang='sh'
* Removed certain usage of heredocs and replaced with string concatenation
* Added 'then' to default statements
* Cleaned up processing of post_queue used for Crayon detection and the_excerpt
* Added focus to plain text to allow easier copy-paste
= 1.2.3 =
* Prevented Crayons from appearing as plain text in excerpts
http://wordpress.org/support/topic/plugin-crayon-syntax-highlighter-this-plugin-breaks-the-tag
= 1.2.2 =
* Fixed the regex for detecting python docstrings. It's a killer, but it works!
(?:(?