Question

I'd like them to be easy to bundle, with few dependencies and easy to use.

Was it helpful?

Solution

Do you want to highlight Java code or use a Java lib to highlight some other code?

I use these two: https://jhighlight.dev.java.net/ (server-side) for xml and http://code.google.com/p/syntaxhighlighter/ (js lib) for other stuff. The latter has something called 'brushes' which are "pluggable" .js for several langauges. If you are doing simple highlighting, I recommend the ,js approach.

OTHER TIPS

http://tohtml.com/ this one is good.

A little update, as we were recently looking for highlighting lib, we found the very good Jygments : http://code.google.com/p/jygments/ .

Available for Ant/Maven/SBT projects throught threecrickets repo, it's a Java port of Pygments ( http://pygments.org ), working for several major languages.

RSyntaxTextArea is worked for meHere

        RSyntaxTextArea textArea = new RSyntaxTextArea();
        textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
        textArea.setCodeFoldingEnabled(true);
        RTextScrollPane rs = new RTextScrollPane(textArea);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top