Skip to main content
Ben Nadel at InVision In Real Life (IRL) 2018 (Hollywood, CA) with: David Fraga and Clark Valberg
Ben Nadel at InVision In Real Life (IRL) 2018 (Hollywood, CA) with: David Fraga@davidfraga ) and Clark Valberg@clarkvalberg )

My Compromise On ColdFusion Code Snippet Color Coding

By on

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