=== WP SyntaxHighlighter === Contributors: redcocker Donate link: http://www.near-mint.com/blog/donate Tags: syntaxhighlighter, sourcecode, code, syntax, highlight, prettify, snippet, tinymce, quicktag, button, shortcode, widget Requires at least: 2.8 Tested up to: 3.3.1 Stable tag: 1.7.3 This plugin is code syntax highlighter based on SyntaxHighlighter ver. 3.0.83 and 2.1.382. == Description == This plugin is code syntax highlighter based on Alex Gorbatchev's SyntaxHighlighter ver. 3.0.83 and 2.1.382. = Features = * Based on Alex Gorbatchev's "[SyntaxHighlighter](http://alexgorbatchev.com/SyntaxHighlighter/ "SyntaxHighlighter")" JavaScript library. * Including both SyntaxHighlighter 3.0.83 and 2.1.382.(Can switch between 3.0.83 and 2.1.382.) * Built-in TinyMCE buttons and Quicktag button are easy to operate. * Easy to wrap your code in `
` tag and change options of previously-wrapped code.
* Support [shortcode](http://en.support.wordpress.com/code/posting-source-code/ "shortcode") also.
* Easy to highlight code in comments using buttons.(WordPress 3.0 or higher)
* Widget to show highlighted code.
* Support [bbPress](http://wordpress.org/extend/plugins/bbpress/ "bbPress") plugin 2.0 or higher.
* Support "[Dynamic Brush Loading](http://alexgorbatchev.com/SyntaxHighlighter/manual/api/autoloader.html "A key feature")" which allows to load only necessary brush files dynamically.
* Loading JavaScripts on only posts, pages, home, archives, search results and comments which have the code to highlight.
* Easy to configure features through the setting panel.
* Localization: English(Default), 日本語(Japanese, UTF-8).

= Supported languages =

AppleScript, ActionScript3, Bash, ColdFusion, C, C++, C#, CSS, Delphi, Diff, Erlang, Groovy, HTML, Java, Java FX, JavaScript, Pascal, Patch, Perl, PHP, Plain text, PowerShell, Python, Ruby, Ruby on Rails, Sass, SCSS, Shell, SQL, VB, VB NET, XHTML, XML and XSLT

Note: A part of languages are only for SyntaxHighlighter 3.0.

You can also use a bundled plugin to add following languages.

Biferno, Clojure, DOS batch file, F#, LISP, Lua(only for SyntaxHighlighter 3.0), MEL Script, Objective-C, PowerCLI, Processing, R, S, S-PLUS, Tcl, Verilog, Vim Script and YAML

For details, see "sample" directory.

There are many other languages for "SyntaxHighlighter". But I can't bundle them because they are not compatible with this plugin license. If you want, try to search.

= Recommended plugin =

* "[SyntaxHighlighter TinyMCE Button](http://wordpress.org/extend/plugins/syntaxhighlighter-tinymce-button/ "SyntaxHighlighter TinyMCE Button")" can provide feature-rich tinyMCE buttons for SyntaxHighlighter.
* "[CodeMirror for CodeEditor](http://wordpress.org/extend/plugins/codemirror-for-codeeditor/ "CodeMirror for CodeEditor")" can highlight sourcecodes in theme and plugin editor and provide a useful toolbar.

= Thanks =

* "SyntaxHighlighter" libraries was created by [Alex Gorbatchev](http://alexgorbatchev.com/SyntaxHighlighter/ "Alex Gorbatchev").
* "shBrushBiferno.js" was created by [Sandro Bilbeisi](http://www.sandrobilbeisi.org/wp/works/web-development/biferno-javascript-brush-for-syntaxhighlighter-shbrush-js/ "Sandro Bilbeisi").
* "shBrushClojure.js" was created by [Daniel Solano Gómez](https://github.com/sattvik/sh-clojure "Daniel Solano Gómez").
* "shBrushDosBatch-V2.js" and "shBrushDosBatch-V3.js" were created by [Andreas Breitschopp](http://www.ab-tools.com/en/ "Andreas Breitschopp"). He also developed [nice plugins](http://wordpress.org/extend/plugins/profile/ab-tools "nice plugins").
* F# brush was written by [Steve Gilham](http://stevegilham.blogspot.com/2009/10/syntaxhighlighter-20-brushes-for-f-and.html "Steve Gilham").
* "shBrushLisp.js" was created by [Knut Haugen](http://blog.knuthaugen.no/2009/10/a-syntaxhighlighter-brush-for-lisp.html "Knut Haugen").
* "shBrushLua.js" was created by [최익필](http://ikpil.com/1191 "최익필").
* "shBrushMel.js" was created by [Skye Book](http://www.skyebook.net/blog/2011/02/syntaxhighlighter-brush-for-mel-script/ "Skye Book").
* "shBrushObjC.js" was created by [Matej Bukovinski](http://www.bukovinski.com "Matej Bukovinski").
* "shBrushPowerCLI.js" was created by [Dan J](http://vm-pro.com/vmware-powercli-syntax-highlighter-brush/ "Dan J").
* "shBrushProcessing.js" was created by [Sebastian Korczak](http://en.myinventions.pl/index.php?page=ProcessingSyntaxHighlighting "Sebastian Korczak").
* The css for "shBrushProcessing.js" was written by [Sebastian Korczak](http://en.myinventions.pl/index.php?page=ProcessingSyntaxHighlighting "Sebastian Korczak").
* "shBrushR.js" was created by [Yihui Xie](http://yihui.name/en/2010/09/syntaxhighlighter-brush-for-the-r-language "Yihui Xie").
* "shBrushTcl.js" was created by [henix](http://www.henix-blog.co.cc/blog/tcl-syntaxhighlighter-brush.html "henix").
* "shBrushVerilog.js" was created by [Hanly De Los Santos](http://www.hdelossantos.com/2010/05/20/verilog-syntaxhighlighter-brush/ "Hanly De Los Santos").
* "shBrushVimscript.js" was created by [nelstrom(Drew Neil)](http://vimcasts.org/blog/2010/04/syntaxhighlighter-vimscript-brush-and-blackboard-theme/ "nelstrom(Drew Neil)").
* "shBrushYaml.js" was created by [Nicolas Perriault](http://prendreuncafe.com/blog/post/2009/07/26/YAML-Brush-for-the-SyntaxHighlighter-Javascript-Library "Nicolas Perriault").
* [Judah](http://www.judahfrangipane.com/blog/ "Judah") revised the awkward descriptive text that was shown before comment form.

== Installation ==

= Installation =

1. Upload plugin folder to the `/wp-content/plugins/` directory.
1. Activate the plugin through the "Plugins" menu in WordPress.
1. If you need, go to "Settings" -> "WP SyntaxHighlighter" to configure.

= Usage in Visual editor =

Note: The build-in "SH TinyMCE Button" can work only with the default visual editor(TinyMCE). Other visual editors(e.g. CKEditor etc.) are not supported.

Note: If you don't have "[unfiltered_html](http://codex.wordpress.org/Roles_and_Capabilities "unfiltered_html")" capability, `` can't be included in your code.

XXXX = 2-4 letter character string including 0-9, A-F or a-f.

**Usage: Wrap your code in `
` tag with "SH TinyMCE Button".**

If you have previously-written code on your post or page, by this way, you can wrap your code in `
` tag for 'SyntaxHighlighter'.

1. With the mouse, select and highlight your code where you want to aplly "SyntaxHighlighter".
1. Click "pre" button.
1. Select language and options.
1. Click "Insert" button.

**Usage: Paste your code into the post or page with "SH TinyMCE Button".**

If you want to copy the code from the other document and paste into your post or page, this way is best. Your pasted code will be warpped in `
` tag automatically.

1. Click "CODE" button.
1. Select language and options and paste your code into textbox.
1. Click "Insert" button.

**Usage: Change language and options of previously-markuped code with "SH TinyMCE Button".**

1. With the mouse, select and highlight your code.
1. Click "pre" button.
1. Change language and options.
1. Click "Update" button.

**Usage: Indent by tabs.**

1. Just type tab in your code. But till your code is wrapped in `
` tag, you can not type any tabs.

= Usage in HTML editor =

Note: If you don't have "[unfiltered_html](http://codex.wordpress.org/Roles_and_Capabilities "unfiltered_html")" capability, `` can't be included in your code.

XXXX = 2-4 letter character string including 0-9, A-F or a-f.

**Usage: Wrap your code in `
` tag with "SH pre" button.**

If you have previously-written code on your post or page, by this way, you can wrap your code in `
` tag for 'SyntaxHighlighter'.

Note: Before you use "SH pre" button, you may need to go to setting panel and activate "Add Quicktag Button" option in "HTML Editor Settings" section.

1. With the mouse, select and highlight your code where you want to aplly "SyntaxHighlighter".
1. Click "SH pre" button.
1. Select language and options.
1. Click "OK" button. Then your code will be wrapped in `
` tag and escape to HTML entities.

**Usage: Wrap your code in `
` tag without "SH pre" button.**

1. Just wrap Your Code in `
` tag with the class attribute as below in HTML editor or using the "Preformatted" style in Visual editor.

You do not need to escape your code to HTML entities. This plugin will escape your code to HTML entities automatically after saving. However, To prevent destroying your code after switching to "Visual editor", You had better escape your code to HTML entities or save it before switching to "Visual editor".

Note: If `
` tags are included in your code, replace `
` with ``. `
Your Code
` *"lang" = your language * e.g. `
Your PHP Code
` * e.g. `
Your XHTML Code
` See "[Available languages](http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/ "Brushes")". *"Brush aliases" means "lang". You can also use some options with `
` tag.

See "[Options](http://alexgorbatchev.com/SyntaxHighlighter/manual/configuration/ "Class value")".

* e.g. `
Your XHTML Code
` * e.g. `
Your PHP Code
` This plugin also can support `