Tagged: wordpress

SyntaxHighlighter plugin for WordPress

SyntaxHighlighter Evolved allows you to easily post syntax-highlighted code to your WordPress powered site. Download the plugin here.

Code is styled with what they call a “brush”. See a list of syntax brushes here.

[text collapse=”False”]
Ex: [c] code goes here [/c] for c code.
[/text]

An example of C code, formatted and highlighted by the plugin.

[c]
/* sample C code */
#include <stdio.h>

main()
{
printf ("SyntaxHighlighter Evolved for WordPress \n");
return 0;
}
[/c]

Example of a Python script , formatted and highlighted by SyntaxHighlighter, using the Python brush.
[py]
# Measure some strings:
a = [‘cat’, ‘window’, ‘defenestrate’]
for x in a:
print x, len(x)
[/py]

Example of a MEL script , formatted by SyntaxHighlighter, using the Plain Text brush, there is no MEL brush.
[text]
//random MEL script
string $myString = "some random MEL";
print ($myString +"\n");
print (size($myString));
[/text]