PDA

View Full Version : Code Syntax Highlighting



Webnet
21 Feb 2007, 7:24 AM
I've hit a wall in development. I'm at a point where I need to provide syntax highlighting for code and I can't seem to find any good php/javascript highlighters. I ask for javascript highlighters because I want to have a code editor on the screen, so it will provide live syntax highlighting.

Anyone know of any good ones? I'm wondering how exactly http://pastebin.com provides highlighting for about 15-20 different languages, surely they're built in php functions or something.

PuritysDisciple
21 Feb 2007, 7:28 AM
here is the syntax highlighter that I use when I need to display code.

http://www.dreamprojections.com/syntaxhighlighter/?ref=about

hunkybill
21 Feb 2007, 8:17 AM
Hi,

If you can't adapt PuritysDisciple suggestion (a very nice one)... for PHP slackers there is http://qbnz.com/highlighter/ and it works fine. It can be hacked into almost any program without much effort (as long as yer coding PHP...)

jack.slocum
21 Feb 2007, 8:49 AM
Geishi or something like that? I have used it a few times.

indy
21 Feb 2007, 9:15 AM
Try this:

http://www.activestate.com/products/komodo_edit/

alindsay55661
21 Feb 2007, 11:27 AM
I use both of these and they provide custom syntax highlighting for any file type.

http://www.mpsoftware.dk/
http://www.zend.com/products/zend_studio

JeffHowden
21 Feb 2007, 11:43 AM
@alindsay55661 and @indy

The OP is asking about syntax highlighted code that's displayed on a webpage in a <pre> or <code> block.

Voldar
22 Feb 2007, 4:12 AM
Try to look at Highlight.js (http://softwaremaniacs.org/soft/highlight/en/) library.

jon.whitcraft
22 Feb 2007, 5:07 AM
here is the syntax highlighter that I use when I need to display code.

http://www.dreamprojections.com/syntaxhighlighter/?ref=about

I agree here. This is by far the best one that is JS Driven.

VinylFox
23 Feb 2007, 9:09 PM
I use dp syntax highlighter too...Its extremely easy to setup and use.

http://www.dreamprojections.com/syntaxhighlighter/

aconran
26 Feb 2007, 5:30 PM
Wow, the dream projections syntax highlighter looks really nice!! I was actually looking into using Chili 1.7 that was just released the other day:
http://www.mondotondo.com/aercolino/noteslog/?page_id=79

However, neither of these have support for coldfusion syntax highlighting. I would like CF/SQL/JS How challenging is it to add a language to the dreamprojections syntax highlighter? The Chili highlighter seems like it is pretty easy to just add the regular expressions for a language. Has anyone had any experience in adding a language to either of these syntax highlighters? Or know of a syntax highlighter which supports SQL, JS and CF?

Thanks,
Aaron

thepisu
27 Feb 2007, 7:35 AM
Look at this: http://codepress.fermads.net/

CodePress were recently integrated in JoomlaXplorer, and seems very good for real time editing highlighting.

PuritysDisciple
27 Feb 2007, 9:20 AM
I have to say Codepress is freaking SEXY! Great find!

aconran
27 Feb 2007, 10:56 AM
Work's great but nearly crashes the browser

I tried out the dreamprojections code on my personal blog divergingpath. both of which are dp's, hah :-)

Anyways, it works great but it nearly crashes the browser; firefox asks to stop a long running script and IE hangs for a second and then renders all the stuff:
here is an example, can anyone give me any suggestions for improving the performance?


http://www.divergingpath.com/index.cfm/2007/2/25/Ext-BookMgr-Extending-functionality-with-Extextend

Aaron

galdaka
27 Mar 2008, 12:03 PM
Work's great but nearly crashes the browser

I tried out the dreamprojections code on my personal blog divergingpath. both of which are dp's, hah :-)

Anyways, it works great but it nearly crashes the browser; firefox asks to stop a long running script and IE hangs for a second and then renders all the stuff:
here is an example, can anyone give me any suggestions for improving the performance?


http://www.divergingpath.com/index.cfm/2007/2/25/Ext-BookMgr-Extending-functionality-with-Extextend

Aaron

The link not work. What is the best code hightlight editor now?

Thanks in advance,