GNU Source-highlight 3.1.8

This program, given a source file, produces a
document with
syntax highlighting. It also provides a C++ highlight library(new)
(since version 3.0).

Source-highlight reads source language specifications
dynamically, thus it can be easily extended (without recompiling
the sources) for handling new languages. It also reads output format
specifications dynamically, and
thus it can be easily extended (without recompiling
the sources) for handling new output formats.
The syntax for these specifications is quite easy (take a look at the
manual).

Source-highlight is a command line program, and it can also be
used as a CGI.

Notice that source-highlight can also be used as a formatter
(i.e.,
without highlighting): you can, for instance, format a txt file in HTML
(and it will take care of translating special characters, such as,
<, >, &).

Since version 2.2, source-highlight can also generate cross
references; in order to do this it relies on
GNU Ctags,
http://ctags.sourceforge.net.

NOTICE: now the name of the
program is source-highlight:
there are no two separate programs, namely java2html
and cpp2html,
anymore. However there are two shell scripts with the same
name
in order to facilitate the migration (however their use is not
advised).

GNU Source-highlight is free
software.
Please see the file COPYING
for details. For
documentation, please read this file.

Download

I do not distribute Windows binaries anymore; since, they can be built
by using Cygnus C/C++ compiler, available at
http://www.cygwin.com. However, if you don't feel like
downloading such compiler or you experience problems with the Boost
Regex library (please also keep in mind that if you don't have these libraries
installed, and your C/C++ compiler distribution does not provide a
prebuilt package, it might take some time, even hours, to build the
Boost libraries from sources), you can request such binaries directly to
me, by e-mail (find my e-mail at my home page) and I'll be happy to send
them to you. An MS-Windows port of Source-highlight is available from
http://gnuwin32.sourceforge.net; however, I don't maintain those
binaries personally, and they might be out of date.

Language definition files and output language definition files,
which are part of source-highlight distribution, can also be downloaded
independently from, respectively:

However, note that the files you find at the above urls are tested with the
latest version of source-highlight (thus, e.g., they may require features
that are not present in an earlier version of source-highlight);

Anonymous Git Checkout

This project's git repository can be checked out through the following
clone instruction:

NOTE: Since version 3.1.2 of Source-highlight the
CVS repository was dismissed in favor of Git
(http://git-scm.com/).

Please notice that this way you will get the latest
development sources
of Source-highlight, which may also be unstable. This solution is the
best if you intend to correct/extend this program: you should send me
patches against the latest git repository sources.

If, on the contrary, you want to get the sources of a given
release,
through git, say, e.g., version X.Y.Z, you must specify the git tag
rel_X_Y_Z.

When you compile the sources that you get from the git
repository,
before running the configure and make
commands, you must run the command:

autoreconf -i

This will run the autotools commands in the correct order, and
also copy
possibly missing files. You should have installed recent versions of
automake, autoconf and libtool
in order for this to succeed.

We strongly suggest to use shadow builds, thus, create a build
directory, say build and run configuration and make in that
directory. To summarize, the steps to get the sources from git and make the first build
are:

What
you need to build source-highlight

Since version 2.0 Source-highlight relies on regular expressions as
provided by boost (http://www.boost.org),
so you need to install at least the regex library from boost.
Most GNU/Linux distributions provide this library already in a compiled
form.

Related
Software and Links

Here we list some software related to source-highlight in the
sense that
it uses it as a backend (i.e., provides an interface to
source-highlight) or it uses some of its features (e.g., definition
files):

Source-highlight-qt is a library for performing syntax highlighting in
Qt documents by relying on GNU Source-Highlight library. This library
provides an implementation of the qt abstract class QSyntaxHighlighter
class, and it deals both with Qt3 and Qt4.

QSource-Highlight is a Qt4 front-end for GNU Source-Highlight (it relies
on the library Source-Highlight-Qt). You can highlight your code on the
fly, and have the highlighted output in all the formats supported by
source-highlight (e.g., HTML, LaTeX, Texinfo, etc.). You can then copy
the formatted output and paste it (e.g., in your blog), or save it to a
file. A preview of the highlighted output is available for some output
formats (e.g., HTML, XHTML, etc.).

SHJS is a JavaScript program that highlights source code
passages in
HTML documents. Documents using SHJS are highlighted on the client side
by the web browser. SHJS uses language definitions from
Source-highlight.

Roger Nilsson wrote a frontend for source-highlight that is
used in a
popular webdesign app for OSX called RapidWeaver. The frontend is
called
High-Light and allows users to easily add syntax-colored code inside
RapidWeaver.