Just found this little thingy which according to me is quite impressive.
<cfset obj = createObject("java","coldfusion.util.FormatSource")>
<cfoutput>
#obj.formatFile(Expandpath('cfdirectory.cfm'))#
</cfoutput>
Now what that does is takes a file from your local folder and applies colored coding to it. Not the best colored code but a lot better than the heavy Regular expression.
Try it out !
#1 by Raymond Camden on February 14, 2008 - 6:25 pm
Quote
Just so you know, there is also a formatString() option. Don’t forget you can dump Java objects to see their methods.
#2 by Anuj Gakhar on February 14, 2008 - 6:56 pm
Quote
@Ray, yes thats right. Only after I dumped these , I found out about these 2 public methods. Very useful I think. Looks like there are lots of little hidden utilities out there.
#3 by Michael Sharman on February 15, 2008 - 4:04 am
Quote
Ah another gem!
Pingback: SitePoint Blogs » The Week in ColdFusion: 13-19 Feb: Hidden gems
#4 by Tracy Logan on October 14, 2008 - 4:34 pm
Quote
Thanks very much for posting this — it is exactly what I needed, a simple way to display tag-based source code.
#5 by Anuj Gakhar on October 14, 2008 - 5:29 pm
Quote
@Tracy, thanks.