This is a simple set of examples.
You can also Download all the code here.
This version is suitable for prety display, it uses spaces to emulate tab size of 4 and shows line numbers.
This version is suitable for copy and paste as the tabs are real tabs and there are no line numbers to get in the way
<!--- Simple Example to Color Code ---> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"> <html> <title>ColdFusion Color Code Examples and Code</title> <style type="text/css"> .plain { white-space: nowrap; width: 100%; height: 200px; font-family: courier new; font-size: 9pt; color: black; background-color: ##FFFFFF; line-height: 14px; overflow: auto; padding-left: 4px; border: solid 1px #AAAAAA; } .tabs { white-space: nowrap; width: 100%; height: 200px; font-family: courier new; font-size: 9pt; color: black; background-color: ##FFFFFF; line-height: 14px; overflow: auto; padding-left: 4px; } </style> <body> <h2>ColdFusion Color Code</h2> <p> This is a simple set of examples.<br /><br /> You can also <a href="colorCode.zip">Download</a> all the code here. </p> <!--- Prety with Line Numbers ---> <h2>Prety with Line Numbers</h2> <p>This version is suitable for prety display, it uses spaces to emulate tab size of 4 and shows line numbers.</p> <cfset me = createObject("component", "ColorCode") /> <cfoutput><div class="plain">#me.colorFile(expandPath("colorCode.cfm"), true)#</div></cfoutput> <!--- Plain with No Line Numbers ---> <h2>Plain with No Line Numbers</h2> <p>This version is suitable for copy and paste as the tabs are real tabs and there are no line numbers to get in the way</p> <cfset me = createObject("component", "ColorCode") /> <cfoutput><div class="plain">#me.colorFile(expandPath("colorCode.cfm"), false)#</div></cfoutput> <!--- Tabs Version ---> <h2>Tabs Version</h2> <p>This version is more complex showing a tabbed interface of both prety and plain views</p> <cflayout type="tab" tabheight="200"> <cflayoutarea source="colorCodeView.cfm?page=colorCode.cfm" title="Prety" overflow="visible" /> <cflayoutarea source="colorCodeView.cfm?page=colorCode.cfm&lineNumbers=false" title="Plain" overflow="visible" /> </cflayout> <!--- Code Version ---> <h2>Here's all the code</h2> <p>This version is more complex showing a tabbed interface of both prety and plain views</p> <cflayout type="tab" tabheight="200"> <cflayoutarea source="colorCodeView.cfm?page=colorCode.cfm&lineNumbers=false" title="colorCode.cfm" overflow="visible" /> <cflayoutarea source="colorCodeView.cfm?page=colorCodeView.cfm&lineNumbers=false" title="colorCodeView.cfm" overflow="visible" /> <cflayoutarea source="colorCodeView.cfm?page=colorCode.cfc&lineNumbers=false" title="colorCode.cfc" overflow="visible" /> </cflayout> </body> </html>
This version is more complex showing a tabbed interface of both prety and plain views
This version is more complex showing a tabbed interface of both prety and plain views