hscolour: Colourise Haskell code.

[ language, library, program ] [ Propose Tags ]

hscolour is a small Haskell script to colourise Haskell code. It currently has four output formats: ANSI terminal codes, HTML with font tags, HTML with CSS, and LaTeX.


[Skip to Readme]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 1.6, 1.9, 1.10, 1.10.1, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.20, 1.20.1, 1.20.2, 1.20.3, 1.21, 1.22, 1.23, 1.24, 1.24.1, 1.24.2, 1.24.3, 1.24.4, 1.25 (info)
Dependencies base (<4.4), haskell98 [details]
License LicenseRef-GPL
Copyright Malcolm Wallace, University of York, 2003-2005, Bjorn Bringert 2006
Author Malcolm Wallace
Maintainer Malcolm Wallace
Revised Revision 1 made by HerbertValerioRiedel at 2015-01-02T22:36:58Z
Home page http://www.cs.york.ac.uk/fp/darcs/hscolour/
Uploaded by DonaldStewart at 2007-01-25T07:34:08Z
Distributions Arch:1.25, Debian:1.24.4, Fedora:1.24.4, FreeBSD:1.23, LTSHaskell:1.25, NixOS:1.25, Stackage:1.25, openSUSE:1.25
Reverse Dependencies 38 direct, 68 indirect [details]
Executables HsColour
Downloads 127144 total (277 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for hscolour-1.6

[back to package description]
HsColour: A Haskell source-code colouriser.
-------------------------------------------
Copyright:  2003-2006, Malcolm Wallace, University of York
Licence:    GPL

Building:
    hmake HsColour
or
    ghc --make HsColour

Usage:
    HsColour [ -tty | -html | -css | -anchorHTML | -anchorCSS ] [file.hs]

The program can colourise a Haskell source file for either terminal
output (option -tty) or HTML output with font tags (option -html), or
HTML output with CSS (option -css).  The default is for terminal output,
which uses standard ANSI screen codes for the colours.

If no file argument is given, it reads standard input.  Output is
always written to standard output.

HsColour can add named anchors (with -anchorHTML or -anchorCSS) to
top-level definitions in the source file (functions, datatypes,
classes).  This enables you to make links to a specific location in the
generated file with the standard "file.html#anchor" notation.

You can configure the colours for different lexical entities by
editing a configuration file called .hscolour in the current directory.
(An example is included in the distribution.)  The file format is as
a simple Haskell value of type ColourPrefs, constructed using named
fields, as follows:

  data ColourPrefs = ColourPrefs
    { keyword, keyglyph, layout, comment
    , conid, varid, conop, varop
    , string, char, number
    , selection, variantselection :: [Highlight]
    }

  data Colour = Black | Red | Green | Yellow | Blue | Magenta | Cyan | White

  data Highlight =
      Normal
    | Bold
    | Dim
    | Underscore
    | Blink
    | ReverseVideo
    | Concealed
    | Foreground Colour
    | Background Colour

For CSS output, it is sufficient to edit the hscolour.css file, also in
the distribution.