A Syntax Highlighting library
Common Lisp Shell
Latest commit fea6cd1 Jun 19, 2013 @kingcons Merge pull request #5 from ralph-moeritz/master
Line of semi-colons not recognized as comment. (Basic Lisp)
Permalink
Failed to load latest commit information.
docs Add docs and README, minor code cleanup. Aug 28, 2012
Mop_Sym.txt
README.md Add alpha-level Clojure support. Needs work on special forms, literal… Aug 29, 2012
abbrev.lisp Initial import of colorize. Dec 19, 2005
clhs-lookup.lisp Backport changes from lisppaste 2.3. (i.e. haskell, erlang, python, etc) Aug 27, 2012
coloring-css.lisp Backport changes from lisppaste 2.3. (i.e. haskell, erlang, python, etc) Aug 27, 2012
coloring-support.lisp
coloring-types.lisp Line of semi-colons not treated as comment. (Basic Lisp) Jun 18, 2013
colorize-package.lisp
colorize.asd Fixed issue with too many closing parenthesis. Apr 12, 2013
colorize.lisp Fix package-name thinko. Resolves Issue #2. Dec 4, 2012
elisp-lookup.lisp Backport changes from lisppaste 2.3. (i.e. haskell, erlang, python, etc) Aug 27, 2012
elisp-symbols.lisp-expr Initial import of colorize. Dec 19, 2005
gen-docs.sh Add docs and README, minor code cleanup. Aug 28, 2012
r5rs-lookup.lisp Backport changes from lisppaste 2.3. (i.e. haskell, erlang, python, etc) Aug 27, 2012
r5rs-symbols.lisp-expr Initial import of colorize. Dec 19, 2005

README.md

colorize

colorize is a lisp library for syntax highlighting supporting the following languages:

  • Common Lisp, :common-lisp
  • Emacs Lisp, :elisp
  • Scheme, :scheme
  • Clojure, :clojure alpha
  • C, :c
  • C++, :c++
  • Java, :java
  • Python, :python
  • Erlang, :erlang
  • Haskell, :haskell
  • Objective-C, :objective-c
  • Diff, :diff
  • Webkit, :webkit

Install

You are strongly encouraged to use this library via Quicklisp. Simply start your lisp and run: (ql:quickload 'colorize).

Getting Started

The API has three main entry points:

  1. COLORIZE-FILE which takes a language keyword and input file and writes the result to an html file in the same directory. An alternate path for the output file may be provided as a third argument.
  2. COLORIZE-FILE-TO-STREAM takes a keyword indicating the language, the path of a file to color, and a stream to write the result to. By default, it writes a complete self-contained page but if the :wrap keyword is given nil it only writes the colorized code snippet.
  3. HTML-COLORIZATION takes a keyword indicating the language and a string of code and returns the colorized html.

In addition, the COLORING-TYPES function takes no arguments and returns a list of the supported coloring types as keywords. Finally, the variable COLORING-CSS returns suggested css code for highlighting the produced html.

That's all for now. And remember, patches welcome!