Syntax Highlighting for Java

Seems there’s a wordpress plugin that uses enscript to highlight the syntax of code available, from this site.

Download the states-highlight.phps file from http://www.nextthing.org/code/wp-states-highlight/. Rename it states-highlight.php and put it in wordpress/plugins.

Also, get a copy of enscript.st from http://www.nextthing.org/code/enscript/ and put it in the same folder. Then enable the plugin in the admin thingy and it should work.

There is a readme in the folder of the first thing too, that tells you to put some CSS classes in various files. The admin one exists, but I couldnt find it in the layout one, so put it in the file of the theme.

Check there is enscript, too:
whereis enscript
on my fanny liberal mac it is in /usr/bin/enscript

Look at how fabulous it is:

Java:
import fixture.Fixture;
import junit.framework.TestCase;

public class Main {
public static void main(String[] args) {
Fixture f1 = new Fixture("Mac_500_Stage_Left_1");
Fixture f2 = new Fixture("Mac_500_Stage_Right_1");
}
}

C++:

#include
using namespace std;

int main(int argc, char*[] argv) {

while(true) {
cout << "John is a TERRBIBLE PINCHER" << endl;
}
cout << "Take that you most terrible pincher!" << endl;

return 0;
}

Leave a Reply