Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Syntax Highlighter for Java

As you know there is a Syntax highlighter for PHP called GeSHi which supports a great number of Programming Languages or Code formats.

However, I couldn't find such a library for Java which supports programming languages that I need (ADA, ASP, BNF, Bash, Brainfuck, C, C++, C#, CSS, Cobol, ColdFusion, D, Fortran, Haskell, HTML, INI (Config), Java, JavaScript, Lisp, Make, Objective C, PASCAL, Perl, PHP, PLSQL, Prolog, Python, Ruby, Scheme, SQL, VB.NET, Verilog, VHDL, Visual Basic, XML.)

Do you know one or should I prefer inefficient way which is retrieving the highlighted code from a remote PHP server via http transaction? Any ideas?

Thanks.

like image 839
ahmet alp balkan Avatar asked Dec 05 '09 20:12

ahmet alp balkan


2 Answers

Two related questions:

What code highlighting libs are there for Java? Where can I find a syntax highlighting library for Java?

And one library I found: http://colorer.sourceforge.net/

like image 77
Bozho Avatar answered Oct 25 '22 21:10

Bozho


Have a look at JHighlighter or jEdit Syntax Package. All mentioned languages aren't supported out of the box. However, you have the sources, so I guess it should be possible to add language support.

Not a direct answer but, if client-side syntax highlighting is an option, the SyntaxHighlighter library from Alex Gorbatchev is an awesome javascript library, supports lots of languages and is highly extensible.

like image 24
Pascal Thivent Avatar answered Oct 25 '22 20:10

Pascal Thivent