Skip to main content
Ben Nadel at CFUNITED 2009 (Lansdowne, VA) with: Mike Brunt
Ben Nadel at CFUNITED 2009 (Lansdowne, VA) with: Mike Brunt ( @cfwhisperer )

My Compromise On ColdFusion Code Snippet Color Coding

By
Published in Comments (2)

That title is a mouth-full!

I have been battling with color-coding my ColdFusion blog entry code snippets. In my blog, all of my code is organized in unordered lists with a div wrapper. I love using lists for code layout because it give me greater control over the layout, the inline "framing" for scroll bars, and the way the code lines wrap. I have seen PRE tag usage all over the place and the code always looks junky to me. It wraps, the tabbing is poop, and the readability is non-existent for anything long.

Now, my DIV / UL combo makes color coding very hard. I have tried to go down that route and it is just a headache. BUT, color coding does add a ton of readability to the code. I have come up with a compromise: inline, I will continue to use the DIV / UL solution. However, at the beginning of every code snippet I am adding a link (at run time) that will allow you to pop the code snippet up into a new window. The code in this new window will use the PRE method with proper color coding.

I would love some feedback on how this solutions works for people. I think it leaves the main blog much more readable but gives the option to make a view of the code much more readable.

Reader Comments

I believe in love. I believe in compassion. I believe in human rights. I believe that we can afford to give more of these gifts to the world around us because it costs us nothing to be decent and kind and understanding. And, I want you to know that when you land on this site, you are accepted for who you are, no matter how you identify, what truths you live, or whatever kind of goofy shit makes you feel alive! Rock on with your bad self!
Ben Nadel