SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Related Sites

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

GNU Source-highlight

by Lorenzo Bettini <http://www.lorenzobettini.it>

This program, given a source file, produces a document with syntax highlighting.

The home page is http://www.gnu.org/software/src-highlite/

You can download it from GNU's ftp site: ftp://ftp.gnu.org/gnu/src-highlite/ or from one of its mirrors (see http://www.gnu.org/prep/ftp.html).

This project's CVS repository can be checked out through anonymous (pserver) CVS with the following instruction set. When prompted for a password for anoncvs, simply press the Enter key.

cvs -d:pserver:anoncvs@subversions.gnu.org:/cvsroot/src-highlite login

cvs -z3 -d:pserver:anoncvs@subversions.gnu.org:/cvsroot/src-highlite co src-highlite

Further instructions can be found at the address: http://savannah.gnu.org/projects/src-highlite.

Installation

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.

See the file INSTALL for detailed building and installation instructions; anyway if you're used to compiling Linux software that comes with sources you may simply follow the usual procedure:

cd /<source code main directory>
/./configure
make
make install

Note: unless you specify a different install directory by --prefix option of configure (e.g. ./configure --prefix=/<your home>/), you must be root to 'make install'.

It is also possible to specify as following option for /configure/:/--enable-input-chroot/ to hardcode in the program the path to prefix for input files.

Before you run 'make install' you may want to check that the programs have compiled fine, so you can run 'make check'.

Files will be installed in the following directories:

  • Executables -> /prefix/bin
  • docs and samples -> /prefix/share/doc/source-highlight
  • conf files -> /prefix/share/source-highlight

Default value for prefix is /usr/local but you may change it with --prefix option to configure (see above).

Building .rpm

Christian W. Zuckschwerdt added support for building an .rpm and an .rpm.src. You can issue the following command

rpm -tb source-highlight-1.9rc.tar.gz

for building an .rpm with binaries and

rpm -ts source-highlight-1.9rc.tar.gz

for building an .rpm.src with sources.

Patching from a previous version

If you downloaded a patch, say source-highlight-1.3-1.3.1-patch.gz(i.e. the patch to go from version 1.3 to version 1.3.1), cd to the directory with sources from the previous version (source-highlight-1.3) and type:

gunzip -cd ../source-highlight-1.3-1.3.1.patch.gz | patch -p1

and restart the compilation process (if you had already run configure a simple make will do).

Usage and examples

See the index.html in the doc directory for many examples.

Use source-highlight with less

This was suggested by Konstantine Serebriany. The script src-hilite-lesspipe.sh will be installed together with source-highlight.
You can use the following environment variables:

export LESSOPEN="| /path/to/src-hilite-lesspipe.sh %s" export LESS=' -R '

This way, when you use less to browse a file, if it is a source file handled by source-highlight, it will be automatically highlighted.

Credits

See CREDITS for detailed contributions and THANKS for a complete list of people that helped me with Source-highlight :-)

Feedback

Please tell me if you like this software :-)

Actually I want to extend it, so if you have some ideas... The most import one will be to make source-highlight more customizable :-)

Please send all bug reports by electronic mail to: bug-source-highlight at gnu.org

TODO

Here's the list of TODO stuff <TODO.txt>, if you'd like to contribute :-)

Mailing Lists

The following mailing lists are available:

if you want to subscribe to a mailing list just go to the URL and follow the instructions, or send me an e-mail and I'll subscribe you.

My home page is http://www.lorenzobettini.it

source-highlight is free software. See the file COPYING for copying conditions. Anyway I won't get offended if you send me a postcard :-)


Return to GNU's home page </home.html>.

Please send FSF & GNU inquiries & questions to /gnu@gnu.org <mailto:gnu@gnu.org>/. There are also other ways to contact <http://www.gnu.org/home.html#ContactInfo> the FSF.

Please send comments on these web pages to /webmasters@gnu.org <mailto:webmasters@gnu.org>/, send other questions to /gnu@gnu.org <mailto:gnu@gnu.org>/.

Copyright (C) 2001 Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA

Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.

Updated:9 Jan 2001 mhw



Other Sites

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.