ColourCode: Installation and Usage

This document will get you started using ColourCode

Installation

Before you install ColourCode you will need Ruby. Just grab the version for your platform.

Once Ruby is installed download the latest version of ColourCode from the homepage. Extract the archive to a suitable location. That's it, ColourCode is up and running!

Usage

Highlighting a file

To highlight a file just pass it to colourcode as an option to the "-i" parameter, like so:

$ ruby colourcode.rb -i amazing.py
    

ColourCode will automatically detect the language type from the extension and write out the highlighted HTML file to amazing.py.html.

If you want the output file to have a different name or location then specify it using the "-o" parameter.

$ ruby colourcode.rb -i amazing.py -o output/amazing_python_program.html
    

Line numbers

ColourCode can write out the line numbers for a file, for easy reference. To do this use the "-l" option

$ ruby colourcode.rb -i test.rb -l
    

Highlight entire directories

ColourCode can highlight an entire directory of files, even if they are written in different languages! Use the "-d" parameter followed by the directory name for this. Recursive directories are not supported at the moment, so all highlighting will be done only for files immediately in the directory. Also when highlighting directories you cannot decide output file names, they go to the default <filename.ext.html>. You can use the "-l" switch for line numbers.

$ ruby colourcode.rb -d mycode/ -l