=== WP SyntaxHighlighter === Contributors: redcocker Donate link: http://www.near-mint.com/blog/donate Tags: syntaxhighlighter, sourcecode, code, syntax, highlight, highlighting, prettify, snippet, tinymce, button Requires at least: 2.8 Tested up to: 3.2.1 Stable tag: 1.6 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. * Easy to highlight code in comments using provided buttons.(WordPress 3.0 or higher) * Widget to show highlighted code. * Once your code is wrapped in `` tag, You can type "tabs" for indent. * 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 add following languages using bundled sample plugin. 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"). * "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://profiles.wordpress.org/users/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 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. **Usage: To 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: To 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: To 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: To 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 = **Usage: To 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'. 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: To 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. However, your codes **must be escape to HTML entities in HTML editor**. Just escape following 5 characters: <, >, &, ", ' `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 Code` * e.g. `Your Code` This plugin also can support `