ColdFusion Color Code

This is a simple set of examples.

You can also Download all the code here.

Prety with Line Numbers

This version is suitable for prety display, it uses spaces to emulate tab size of 4 and shows line numbers.

   1: <!--- Simple Example to Color Code --->
   2: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN">
   3: <html>
   4:     <title>ColdFusion Color Code Examples and Code</title>
   5:     <style type="text/css">
   6:         .plain {
   7:             white-space: nowrap; width: 100%; height: 200px; font-family: courier new; font-size: 9pt; color: black;
   8:             background-color: ##FFFFFF; line-height: 14px; overflow: auto; padding-left: 4px; border: solid 1px #AAAAAA;
   9:         }
  10: 
  11:         .tabs {
  12:             white-space: nowrap; width: 100%; height: 200px; font-family: courier new; font-size: 9pt; color: black;
  13:             background-color: ##FFFFFF; line-height: 14px; overflow: auto; padding-left: 4px;
  14:         }
  15:     </style>
  16: 
  17:     <body>
  18:         <h2>ColdFusion Color Code</h2>
  19:         <p>
  20:             This is a simple set of examples.<br /><br />
  21:             You can also <a href="colorCode.zip">Download</a> all the code here.
  22:         </p>
  23: 
  24:         <!--- Prety with Line Numbers --->
  25:         <h2>Prety with Line Numbers</h2>
  26:         <p>This version is suitable for prety display, it uses spaces to emulate tab size of 4 and shows line numbers.</p>
  27:         <cfset me = createObject("component", "ColorCode") />
  28:         <cfoutput><div class="plain">#me.colorFile(expandPath("colorCode.cfm"), true)#</div></cfoutput>
  29: 
  30:         <!--- Plain with No Line Numbers --->
  31:         <h2>Plain with No Line Numbers</h2>
  32:         <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>
  33:         <cfset me = createObject("component", "ColorCode") />
  34:         <cfoutput><div class="plain">#me.colorFile(expandPath("colorCode.cfm"), false)#</div></cfoutput>
  35: 
  36:         <!--- Tabs Version --->
  37:         <h2>Tabs Version</h2>
  38:         <p>This version is more complex showing a tabbed interface of both prety and plain views</p>
  39:         <cflayout type="tab" tabheight="200">
  40:             <cflayoutarea source="colorCodeView.cfm?page=colorCode.cfm" title="Prety" overflow="visible" />
  41:             <cflayoutarea source="colorCodeView.cfm?page=colorCode.cfm&lineNumbers=false" title="Plain" overflow="visible" />
  42:         </cflayout>
  43: 
  44:         <!--- Code Version --->
  45:         <h2>Here's all the code</h2>
  46:         <p>This version is more complex showing a tabbed interface of both prety and plain views</p>
  47:         <cflayout type="tab" tabheight="200">
  48:             <cflayoutarea source="colorCodeView.cfm?page=colorCode.cfm&lineNumbers=false" title="colorCode.cfm" overflow="visible" />
  49:             <cflayoutarea source="colorCodeView.cfm?page=colorCodeView.cfm&lineNumbers=false" title="colorCodeView.cfm" overflow="visible" />
  50:             <cflayoutarea source="colorCodeView.cfm?page=colorCode.cfc&lineNumbers=false" title="colorCode.cfc" overflow="visible" />
  51:         </cflayout>
  52:     </body>
  53: </html>

Plain with No 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>

Tabs Version

This version is more complex showing a tabbed interface of both prety and plain views

Here's all the code

This version is more complex showing a tabbed interface of both prety and plain views