Client-side syntax highlighter
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs markdownified the readme Aug 31, 2013
lib created build script and moved tests around and renamed language file… Apr 1, 2011
src release 1.22.0 Jan 6, 2014
tests
.gitignore ignore build Aug 29, 2013
CHANGELOG release 1.22.0 Jan 6, 2014
COPYING added COPYING and README Apr 9, 2011
README.md sexy demo! Aug 31, 2013
TODO
build.xml release 1.22.0 Jan 6, 2014

README.md

Sunlight

Sunlight is a context-aware, client-side syntax highlighter. It does as a good of a job as can be done highlighting code without performing static analysis. Check out the sexy demo!.

Highlighted C# code

Licensed under WTFPL: http://sam.zoy.org/wtfpl/

Installation

Download a pre-minified package from here.

  • Reference sunlight-all-min.js OR sunlight-min.js and language files of your choice.
  • Reference a theme stylesheet (in themes/) or provide your own stylesheet.
  • Place code inside an element with the class "sunlight-highlight-{language}" where language is the id of the language. e.g. "sunlight-highlight-csharp" for C#.

Refer to the excruciatingly detailed documentation for other options.

Supported languages

  • C#
  • PHP
  • JavaScript
  • MySQL
  • XML
  • CSS
  • bash
  • T-SQL
  • Java
  • Ruby
  • Python
  • Brainfuck
  • nginx
  • C/C++
  • 6502 assembler
  • Perl
  • VB.NET
  • httpd
  • Lisp
  • Visual Studio solution files (*.sln)
  • DOS batch
  • Haskell
  • Erlang
  • Diff (unified and context)
  • Scala
  • ActionScript
  • PowerShell
  • Objective-C
  • Lua

Plugins

  • sunlight-plugin.linenumbers.js (bundled)
  • sunlight-plugin.menu.js
  • sunlight-plugin.doclinks.js