using Sunlight;
public class Sunlight : IAmAwesome {
/// <summary>
/// Determines if <c cref="Sunlight">the Sunlight class</c> is awesome,
/// which it is
/// </summary>
public void DetermineIfAwesome(Sunlight sunlight) {
if (sunlight is Awesome) {
this.WriteXml("<halp nested="absolutely">I'm nested XML inside C#!</halp>
");
} else {
//should never get here: Sunlight is always awesome
throw new InvalidOperationException("Code should never be reached");
}
}
}
Download
-
Download (135KB)
v1.22.0 2014-01-06
-
Supported languages:
- 6502 Assembly
- ActionScript
- bash
- Brainfuck
- C/C++
- C♯
- CSS
- Diff
- DOS batch
- Erlang
- Haskell
- httpd (Apache)
- Java
- JavaScript
- Lisp
- Lua
- MySQL
- nginx
- Objective-C
- Perl
- PHP
- PowerShell
- Python
- Ruby
- Scala
- T-SQL
- VB.NET
- Visual Studio solution (.sln)
- XML
-
Features:
- Context-aware syntax highlighting
- Parses tabs correctly!
- Nested languages (e.g. MySQL within PHP within HTML)
- Automatically generated line numbers
- Customizable themes via CSS
-
Small footprint
- core is 6KB minified and gzipped
- core + 30 language definitions is 75KB minified and gzipped
- Easily extended via a plugin mechanism
-
Supported languages:
- Source code (162KB)
- Previous versions
About
Sunlight is written in JavaScript and provides automatic syntax highlighting to blocks of code contained within an HTML document. It can also serve as a plain text to HTML converter. It’s a lot smarter than other syntax highlighters that perform the same task.
Sunlight has been tested and confirmed to work properly in IE6+, Firefox 2+, Chrome 10, Safari 4 and Opera 11. Note that some features are disabled or not supported in IE6. See here for details. See here for reasons.
For usage and installation, see the documentation.
You can provide feedback and bug requests on the the Github page.