Syntax Highlighter

Highlight and nicely format your source code for easier online viewing.
Supports HTML, CSS, Pascal, Java, JS, PHP, Python, ROR, VB, SQL, XML, C and more!

CSS/JS files (add code to <HEAD> section):


<!-- jQuery Library (skip this step if already called on page ) -->
<script type="text/javascript" src="dreamcodes/jquery.min.js"></script> <!-- (do not call twice) -->

<!-- DC Syntax Highligher JS -->
<script type="text/javascript" src="dreamcodes/documentation/syntaxhighlighter/scripts/shCore.js"></script>
<script type="text/javascript" src="dreamcodes/documentation/syntaxhighlighter/scripts/shBrushJScript.js"></script>

<!-- DC Syntax Highligher Brushes -->
<script src="dreamcodes/documentation/syntaxhighlighter/scripts/shBrushXml.js" type='text/javascript'></script>
<script src="dreamcodes/documentation/syntaxhighlighter/scripts/shBrushJScript.js" type='text/javascript'></script>
<script src="dreamcodes/documentation/syntaxhighlighter/scripts/shBrushCss.js" type='text/javascript'></script>

<!-- DC Syntax Highligher CSS -->
<link type="text/css" rel="stylesheet" href="dreamcodes/documentation/syntaxhighlighter/styles/shCoreDefault.css" />

<!-- DC Syntax Highligher Settings -->
<script type="text/javascript">SyntaxHighlighter.all();</script>

          

Highlight Code

Tip: Double clicking on code window will switch to edit mode for easier copying of data to clipboard.


<!-- code highlighting begins -->
<html>
<head>
<link type="text/css" rel="stylesheet" href="css/sample.css" />
<script type="text/javascript" src="js/sample.js"></script>

	<style>
body { background:#fff; font: 12px;}
	</style>
</head>
<body>

<h1>My First Heading</h1>

<p>My first paragraph.</p>

</body>
</html>
<!-- code highlighting ends -->

View code:


<!-- DC Syntax Highligher Start -->
<pre class="brush: xml">
<!-- code highlighting begins -->
<html>
<head>
<link type="text/css" rel="stylesheet" href="css/sample.css" />
<script type="text/javascript" src="js/sample.js"></script>

	<style>
body { background:#fff; font: 12px;}
	</style>
</head>
<body>

<h1>My First Heading</h1>

<p>My first paragraph.</p>

</body>
</html>
<!-- code highlighting ends -->
</pre>
<!-- DC Syntax Highligher End -->


Parameters:
---------------------
brush: (value) - replace with language to highlight

Values
---------------------
xml - HTML/XML/XHTML
css - CSS
js - Javascript
java - Java
php - PHP
ror - Ruby on Rails
sql - SQL
cf - Cold Fusion
as3 - ActionScript 3
perl - Perl
delphi - Delphi/Pascal
vb - Visual Basic
bash - Bash/Shell
py - Python
text - Plain Text
c - C++
csharp - C#



© TemplateAccess