cfCodePress - Custom Tag For Real Time Code Coloring

Over the past few days I've thrown together a custom tag implementation of CodePress.

Here's an abbreviated description of CodePress taken from their site:

CodePress is web-based source code editor with syntax highlighting written in JavaScript that colors text in real time while it's being typed in the browser.

Features

  • Real-time syntax highlighting » just write some code
  • Code snippets » on PHP example type "if" and press [tab]
  • Auto completion » simple type " or ( or ' or [ or { on any example below (except Plain Text)

What makes this tag cool is that you can now drop a nicely formatted block of code or a real time syntax highlighting code editor into your application with a single line of code.

Check this out (go ahead, type some code):

Update: Arg...Demo appears to not work here after the first time I hit the page...

Check this demo instead...

Update 2: OK...it works intermittently here in the blog post...weird...


There are a few bugs with it - which is why I'm just previewing and not releasing the tag just yet. First and most obviously you see that when I drop my demo page as an include in BlogCFC the editor does not seem to be obeying the line breaks in the code I load initially into the editor. Check out the demo outside of my stylesheet to see a properly formatted block (anyone see anything in my stylesheet that could be goofing it?).

Secondly - I've integrated the CodePress SQL, HTML and CSS templates into the CF version - and it tends to get a little goofy. For example type a comment with an SQL keyword in it and it will highlight the SQL keyword. Anyone really good with RegEx that wants to take a look at overcoming these issues?

There is also an API to toggle line numbers, etc that I plan on exposing with the final release of the code.

Comments
Pretty neat...or at least on the way there, he he. You should talk to Ben Nadel about the RegEx - he is pretty damn good at it.
# Posted By Boyan | 7/5/07 3:50 PM
My ears are burning... did some mention my name???
# Posted By Ben Nadel | 7/5/07 4:38 PM
Hey Ben - did you get my email on this last night?
# Posted By todd sharp | 7/6/07 8:14 AM
You probably didn't get the email about this comment since it threw an SMTP error....

sheesh..
# Posted By todd sharp | 7/6/07 8:17 AM
I sent you a response... did you get that one? My GMail hosted email is funny sometimes I think.
# Posted By Ben Nadel | 7/6/07 9:45 AM
Yeah I got it - cool - thanks!
# Posted By todd sharp | 7/6/07 12:22 PM
very cool

thanks
# Posted By ivan | 7/6/07 2:42 PM

Calendar

Sun Mon Tue Wed Thu Fri Sat
     12
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31       

Subscribe

Enter your email address to subscribe to this blog.

Tags

actionscript ajax blogging cfsnippets coldfusion flash forms flex funny stuff misc model-glue off topic personal project learn slidesix sql

Recent Comments

Adding Auto Generated Code Downloads to BlogCFC
ada5fsa said: http://www.mountwashingto... http://extjs.com/forum/me... h... [More]

BlogCFC Survey #2
ada5fsa said: http://www.mountwashingto... http://extjs.com/forum/me... h... [More]

Most Difficult Captcha Of All Time
kokkooo said: [url=http://synchrophase.info/...]消費者金融 ブラック[/url] [url=http://geji-geji.com/]消費者金融ブラック[/url] [url=http... [More]

Most Difficult Captcha Of All Time
kokkooo said: <a href="http://synchrophase.info/...">消費者金融 ブラック</a> <a href="http://gej... [More]

Using A PlayStation 2 HDD In Your PC
Vodin said: Well dang. Thanks man, my uncle who owns a Video Game shop had a PS2 harddrive in the junk box, I sn... [More]

RSS


coldfusionbloggers

FullAsAGoog MXNA

Consumed By Feed-Squirrel.com