Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a command-line tool, preferably available on both Windows and Linux, which will take a source code file as input, and generate the corresponding syntax-coloured HTML code ?

I'm looking for functionality similar to vim's TOhtml command, but which I could run from the command line, without having to open vim.

share|improve this question
up vote 3 down vote accepted

Highlight is pretty much exactly what you're looking for:

Highlight converts sourcecode to HTML, XHTML, RTF, LaTeX, TeX, SVG, BBCode and terminal escape sequences with coloured syntax highlighting. Language definitions and colour themes are customizable.

The website has downloads for Windows (cli & gui) and packages for various Linux/BSD distros.

share|improve this answer
    
yep, perfect match; thanx ! – Mihai Rotaru Nov 28 '11 at 19:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .