Coder Social home page Coder Social logo

colorize's Introduction

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!

colorize's People

Contributors

kingcons avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.