Syntax Highlighter Wordpress Plugin
Easily highlight syntax!
Contents
Overview
This is a wordpress syntax highlighting plugin. It is simple and probably one of the best syntax highlighters in the market. This plugin integrates Alex Gorbatchev’s Syntax Highlighter Tool : Alex’s Site. Full Support for :
- Bash/shell
- C#
- C++
- CSS
- Delphi
- Diff
- Groovy
- JavaScript
- Java
- Perl
- PHP
- Plain Text
- Python
- Ruby
- Scala
- SQL
- Visual Basic
- XML
Download
Download and unzip in your wp-content/plugins Wordpress folder:
ZIP: Syntax Highlighter and Code Prettiffier Wordpress Plugin
Usage
Just surround your code like this:
<pre class="brush:[code-alias]"> …Your Code Here </pre>
replace the "[code-alias]" segment with the type of code you have. See all the available brush aliases. For Example, PHP would be like this:
<pre class="brush:php"> …Your PHP Code Here </pre>
Examples
C#
// Hello1.cs
public class Hello1
{
public static void Main()
{
System.Console.WriteLine("Hello, World!");
}
}
Java
class Dog
{
public Dog(String aType)
{
System.out.println("I am a Dog");
}
}
public class MainClass
{
public static void main(String[] a)
{
Dog d = new Dog("a");
Class objectType = d.getClass();
System.out.println(objectType.getName());
}
}
Bash / Shell
/usr/bin/svnadmin hotcopy /path/to/svn/repository /path/to/destination 2. 3.tar cvf /path/to/backup/svnbackup-`date +%Y-%m-%d`.tar /path/to/destination/* 4. 5./usr/local/bin/7z a -tbzip2 -v2g svnbackup-`date +%Y-%m-%d`.tar.bz2 /path/to/backup/svnbackup-`date +%Y-%m-%d`.tar
More Details
The Syntax Highlighter Plugin has more configurable options. Go to = http://alexgorbatchev.com/wiki/SyntaxHighlighter

[...] created a wordpress plugin to highlight syntax using the latest 2.0 SyntaxHighlighter by Alex Gorbatchev. It supports Bash/shell, C#, C++, CSS, [...]
Excellent!
But It make the time to load page is too low! So merge all shBush js file to one to load faster
[...] http://www.lastengine.com/syntax-highlighter-wordpress-plugin/ « Spark – an alternative view engine App Arch Guide 2.0 » [...]
[...] egy nagyon jó forráskód kiemelőt Wordpresshez. Syntax Highlighter and Code Colorizer for Wordpress [...]
[...] original post here: Syntax Highlighter Wordpress Plugin : The Last Engine Share and [...]
Wonderful plugin! Perfect for my needs.
Do you have any future plans to have a “copy code” button so users can just click once and the code is copied to their clipboards?
The code is directly from Alex Gorbatchev’s Syntax Highlighter. If he updates his end with the copy button, I’ll integrate that into Wordpress.
[...] are lots of plugins available for wordpress blogs to highlight codes in your posts but I will use syntax highlighter plugin by Vijesh Mehta in this [...]
This is a really nice plugin. Useful for everyone.
[...] are lots of plugins available for wordpress blogs to highlight codes in your posts but I found this syntax highlighter plugin by Vijesh Mehta is beautiful and [...]
[...] Por fim, caso alguém queira testá-lo, o site é http://www.lastengine.com/syntax-highlighter-wordpress-plugin [...]
[...] Found this. That makes the code not suck. Pasting code into this thing is still a PAIN, as it doesn’t [...]
I’m having some problems with bash code. I’m using > to redirect output to a file, but on the page this shows up as “>”. Replacing “>” with “>” in the source doesn’t help. Has anybody run into this?
Ugh. So the source has >, and the display is >.
[...] plugin Syntax Highlighter ini saya dapatkan disini, silahkan download lalu install seperti menginstall plugin wordpress pada umumnya. Untuk cara [...]
it is the best code highlighter ever. works like a charm.
i tried so many plug-ins but nothing works like this one.
unfortunately , i tried to make it work as bbcode like [php][/[php], but i got no luck, it always crashes.
is there any trick to work around this?
[...] installed a WordPress plugin for syntax highlighting of code blocks today. The plugin I installed uses JavaScript to do the highlighting and has a additional view source and print buttons, which is [...]
[...] Highlighter Wordpress Pluginをいれてみた。 詳しくは、ここ。 9月 3rd, 2009 | Category: [...]
Great Job!
I like it very much!
Thank you very much!
I am having a problem with the php brush. For some reason the code is looking like it was ran through htmlspecialchars(). When using “‘. and .’” I get “&27 any ideas?
[...] PS: This great syntax highlighting is done using the Syntax Highlighter Wordpress plugin. [...]
^^ wordpress when saving the post always removes the class=”brush:php” anyway around that?
Not that I know of yet.
[...] list of languages supported by worpdress plugin syntax highlighter [...]
I guess for Javascript brushes not worked.
When I use this plugin in Wordpress 2.8.4, it strips the class attribute off the pre tag. Any ideas?
I am having a problem with this plugin replacing “‘. with “%27. when viewing it. This has made the usage of this plugin useless for me. Any help to fix this would be appreciated, I just odn’t have the time to debug this myself anytime soon.
Thanks to any who can help.
An example of code being used to cause this is:
echo ‘‘.”\n”;
Release-Note-Tool…
Plugins Suche Multiple Category Selection Widget…
[...] Syntax Highlighter and Code Prettifier [...]
The plugin is not working on 2.8, any tips?
Found a solution, make SURE that the header.php of your templates includes this:
Thanks to:
http://thecssbug.com/syntaxhighlighter-plus-problem
[...] Syntax Highlighter and Code Colorizer for Wordpress こちらもSyntaxHighlighterのバージョンが古かったので、却下。 [...]
This is the plugin I was looking for! Took me ages to find it. Thanks!
[...] best code/syntax highlighter plugin for wordpress blogs that I could find is one called the “Syntax Highlighter and Code Colorizer for Wordpress” by a guy called Vijesh Mehta. All I can say Vijesh is that you [...]
[...] offers an easy to use graphical user interface for Syntax Highlighter and Code Colorizer for Wordpress. You can easily enter and modify source-code highlighted in your posts as well as specify options [...]
[...] Editor Plugins von , verfügt TinyMCE über ein grafisches User Interface für den Syntax Highlighteruand Code Colorizer für Wordpress. Man kann Sourcecode eingeben und dann in Postings einfügen. Share and [...]
[...] an easy to use graphical user interface for Syntax Highlighter and Code Colorizer for Wordpress. You can easily enter and modify source-code highlighted in your posts as well as specify options [...]
[...] un fácil utilizar el interfaz gráfico de usuario para el Resaltador de sintaxis y el Código Colorizer para Wordpress. Usted puede entrar y modificar el código fuente de relieve en sus mensajes, así como especificar [...]
[...] can install this plugin by looking for “Syntax Highlighter and Code Colorizer for Wordpress” By Vijesh Mehta from the Plugin section in your Wordpress administration panel. The plugin [...]
[...] include Alex Gorbatchev’s Syntax Highlighter Javascript on your blog template. For me, I’m using Wordpress, so I can simply add the reference by using this plugin: Syntax Highlighter and Code Prettifier Plugin for WordPress. [...]
[...] avoir choisi Syntax Highlighter and Code Prettifier Plugin for WordPress de Vijesh Mehta, Voila que j’ai un problème de saut à la ligne après chaque mot clés : Erreur de retour [...]
[...] I settled on using, for the time being at least, is Vijesh Mehta Syntax Highlighter Wordpress Plugin. The plugin still requires manual HTML editing, but avoids the stripping of the name attribute by [...]
Can we set the number of the code?
[...] 安装了一个插件: Syntax Highlighter Wordpress Plugin [...]
Hi,
I installed syntax-highlighter-and-code-prettifier at my blog version 2.8 based. The dashboard alert there are new version ready for upgrade. then i clicked to upgrade. After upgrade, i found all my Highlighter code can’t work now. and strange. I found the plugin website jumped to http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/. Why? thank you.
[...] Syntax Highlighter and Code Colorizer for Wordpress [...]
[...] http://www.lastengine.com/syntax-highlighter-wordpress-plugin/ [...]
If your WordPress MU site is stripping the class attribute from the PRE tag, then you can try using the Unfiltered MU plugin.
http://wordpress.org/extend/plugins/unfiltered-mu/installation/
Hi,
I have a problem using this plugin for highlight some HTML code. I see that is not listed as a brush but I try with the PHP as an alternative and dont works
This is the code:
{$lang->author}
{$lang->message}
Thanks.
Sorry have the same problem using the brush here.
Here is the code
{$lang->author}
{$lang->message}
Page Speed fin many of external javascript:
# shBrushBash.js
# shBrushCpp.js
# shBrushCSharp.js
# shBrushCss.js
# shBrushDelphi.js
# shBrushDiff.js
# shBrushGroovy.js
# shBrushJava.js
# shBrushJScript.js
# shBrushPerl.js
# shBrushPhp.js
# shBrushPlain.js
# shBrushPython.js
# shBrushRuby.js
# shBrushScala.js
# shBrushSql.js
# shBrushVb.js
# shBrushXml.js
is there a way to combine them in a future version?
[...] for Vijesh Mehta about this tutorial we just test for wordpress 2.9.1..and still working Posted under: Articles | Tags: code, display [...]
[...] Syntax Highlighter and Code Prettifier Plugin for WordPress. It has built in themes, installs in 35 seconds, and works like a champ. [...]
[...] wordpress代码着色 Taii 发表于 2010-02-17 23:23 | 来源: | 阅读 2 Views 1、安装插件: Syntax Highlighter Wordpress Plugin [...]
Can you provide more information on other wordpress plugins, or do you have some resources you can share with us where we can find such useful stuff? Thanks.
Thanks! This is what I was looking for. I like that you can specify the language, unlike prettify.js, and I love the line numbers since I’m always wanting to refer to specific lines.
Playing nice with Markdown:
I’ve found that I have to surround the whole block with or else markdown will sometimes modify the code.
Try #2:
With Markdown, make sure to surround you “pre” blocks with “div” tags or else Markdown may mess with your code.
It’s not wrapping properly for me in Safari. Long url and code strings are extending outside the code box. It only seems to break at hyphens. Any ideas?
Great extension but I have run to the bash > problem too…
echo “Something” > Somefile
desplays the redirection as > , shame.
I removed the ‘lt’ and ‘gt’ keywords from shBrushBash.js , therefore -lt and -gt operators will not be colorized, but that is still better than to replace redirections to > and <
[...] Syntax Highlighter [...]
[...] I found another great plugin that does its job: SyntaxHL Editor. This one need to install the Syntax Highlighter and Code Colorizer plugin. It had a little problem with my actual wordpress theme, so I discarded it earlier but [...]
[...] highlighter 就可以找到。 官方主页是:http://www.lastengine.com/syntax-highlighter-wordpress-plugin/, [...]
[...] Syntax Highlighter是一个能使文章中的代码段按照该代码语言的语法对其进行高亮的实用插件 插件官方地址:http://www.lastengine.com/syntax-highlighter-wordpress-plugin/ [...]
[...] The instructions for use are available here. [...]