<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><html><head><title>The Mandala Centre - Syntax Highlighting</title><meta name="description" content="The Mandala Centre - Syntax Highlighting"><meta name="keywords" content="The Mandala Centre Tim Tyler Syntax Highlighting"></head><body background="../bg/fstsml.jpg" text="#000000" bgcolor="#E8E8E8" link="#20209F" vlink="#008000" alink="#FF2020"><CENTER><TABLE WIDTH="95%"><TR><TD ALIGN=left WIDTH="100%"><h1 Align=Center>Syntax Highlighting</H1><H3>Syntax Highlighting</H3>This is a syntax-colourer for HTML and PHP, written in PHP.<p>It dynamically produces coloured, styled HTML output fromplain HTML/PHP source code on the server.<p><H3>Colour categories</H3>There are 25 configurable colour categories:<p><CENTER><TABLE><TR><TH>PHP</TH><TH>HTML</TH></TR><TR valign="top"><TD valign="top"><UL><LI>Method<LI>Keyword<LI>String<LI>Comment<LI>Tags<LI>Tags (background)<LI>Punctuation<LI>Brackets<LI>Braces<LI>Escaped character<LI>Operator<LI>Number<LI>Variable<LI>Constant</UL></TD><TD valign="top"><UL><LI>Text<LI>Comment<LI>Equals<LI>String<LI>Number<LI>Entity<LI>Argument<LI>Parameter<LI>Angle bracket<LI>Tag Open<LI>Tag Close</UL></TD></TR></TABLE></CENTER>You can change the colours and font weights fairly easily.Look at the top of the source of the script and it should befairly clear how to do this.<p><H3>Resources</H3>The script will highlight HTML from arbirary URLs.<p>However it will only highlight PHP scripts from beneath itsparent directory.  This limitation has been imposed forsecurity reasons - it is important not to let visitorsaccess arbitrary text files from your server.<p><H3>Demonstrations</H3><a href="../highlight/?file=photograph_album/demonstration/image/index.php">Page 1</a>;<p><a href="../highlight/?file=photograph_album/demonstration/image/index.php">Page 1</a>;<p><a href="../highlight/?file=syntax_highlighting/index.html">This page</a>;<p><a href="../highlight/?file=index.html">This site's front page</a>;<p><a href="../highlight/?file=syntax_highlighting/test.html">Test page</a>;<p><a href="../highlight/?url=http://mandala.co.uk/index.html">Test URL</a>;<p><a href="../highlight/?url=http://localhost/~Mandala/index.html">Test URL</a> (offline).<p><H3>To do</H3>A great many things still need doing.<p>If you find bugs, please report them.  If you know PHP, feel free to muck in.<p><H3>Source code</H3>The program renders its own <a href="../highlight/?file=highlight/index.php">source code</a>.<p><H3>License</H3>This program and its source code have been placed in the public domain.<p></TD></TR></TABLE></center><P><hr align=center width="25%"><P><CENTER><a href="../index.html">Index</a> |<a href="../links/index.html">Links</a></CENTER><P><hr align=center width="25%"><P></body><address><center><em><a href="mailto:tim@tt1.org">tim@tt1.org</a></em> | <em><a href="http://mandala.co.uk/">http://mandala.co.uk/</a></em></center></address></html>