Arctus Blog: Syntax highlighting for C# and SQL (with CodeRay) tag:blog.arctus.co.uk,2005:Typo Typo 2007-05-04T10:11:22-04:00 Adrian O'Connor adrian@arctus.co.uk urn:uuid:2c7888f7-3983-425b-83bc-1c9f4a8c98a4 2007-04-24T09:33:00-04:00 2007-05-04T10:11:22-04:00 Syntax highlighting for C# and SQL (with CodeRay) <p>I am about to enable syntax highlighting for code extracts on the Arctus Blog.</p> <p>For those that are interested, we will be using a Ruby module called <a href="http://coderay.rubychan.de/">CodeRay</a> to generate the output. This will be done through a custom text filter in Typo.</p> <p>Because our primary audience is .NET, and CodeRay only supports Ruby and <span class="caps">HTML</span> languages out of the box, I have written language plug-ins for C# (.cs) and <span class="caps">SQL</span>. SQL is still effectively &#8216;beta&#8217; because I have made no attempt to verify that I have remembered all of the keywords, types and functions (using <span class="caps">SQL</span> Server 2005 as a base line). I think I have covered 95% of the most used features so I shall pick up the missing bits as they come to light.</p> <p>The required files are available below. You should place them in CodeRay&#8217;s \lib\coderay\scanners folder. CodeRay caches its scanners so you may need to reload your project. The two new languages are identified using &#8220;cs&#8221; and &#8220;sql&#8221;.</p> <div style="border:solid 1px #ddd;background:#eee;padding:5px;"> <h6 style="margin:0px;font-size:9pt;"><a href="/files/coderay-scanners-cs-sql.zip">coderay-scanners-cs-sql.zip</a></h6> </div>