SOURCE-HIGHLIGHT(1)

NAME
source-highlight - produce a document with syntax highlighting.

SYNOPSIS
source-highlight [OPTIONS...] [files]

DESCRIPTION
source-highlight given a source file, produces a document with syntax highlighting.

source-highlight supports the following source languages: Java, C/C++, Prolog, Perl and produces an HTML file with syntax highlighting.

source-highlight is a GNU program. See COPYING.

THIS MAN PAGE IS NOT COMPLETE.

Texinfo documentation will be released soon, but meanwhile please refer to README file or to the html documentation that you can find in /usr/local/share/doc/source-highlight.

OPTIONS
source-highlight accepts some options.

   -h         --help               Print help and exit
   -V         --version            Print version and exit
   -iSTRING   --input=STRING       input file. default std input
   -oSTRING   --output=STRING      output file. default std output
   -sSTRING   --src-lang=STRING    source language
                                   (e.g. java, cpp, prolog, perl)
   -fSTRING   --out-format=STRING  output format (e.g. html)
   -v         --verbose            verbose mode on
   -d         --doc                create html with title and header
   -cSTRING   --css=STRING         use a css for formatting. Implies --doc
   -TSTRING   --title=STRING       give a title to the html. Implies --doc
   -tINT      --tab=INT            specify tab length. default 8
   -HSTRING   --header=STRING      file to insert as header
   -FSTRING   --footer=STRING      file to insert as footer
              --tags-file=STRING   specify format options (def. tags.j2h)
   -n         --line-number        number all output lines
              --output-dir=STRING  output directory

REQUIRED OPTIONS

--src-lang (-s)
    java, cpp, prolog, perl.

--out-format (-f)
    html.

USAGE AND EXAMPLES
source-highlight only does a lexical analysis of the source code, so the program source is assumed to be correct ! here's how to run source-highlight (for this example we will use C/C++ input files, but this is valid also for other source-highlight input languages): source-highlight --src-lang cpp --out-format html --input <file (a C++ prog)> --output <file (an html)> [options] For input files you can also use regular expression. If you do not specify the name of the output file, the name will be the one of the source file with a .<ext> appended, where <ext> is the extension chosen according to the output format specified (in this example it would be .html).

FORMAT OPTION FILE

You may want to specify your options for syntax highlighting in the file tags.j2h. If this file is not present in the current directory, some default colors will be used. Here's the tags.j2h file that comes with this distribution:

keyword blue b ;      for language keywords
type darkgreen ;      for basic types
string red ;          for strings and chars
comment brown i ;     for comments
number purple ;       for literal numbers
preproc darkblue b ;  for preproc directives (e.g. #include, import)
symbol darkred ;      for simbols (e.g. <, >, +)
function black b;     for function calls and declarations
cbracket red;         for block brackets (e.g. {, })

tags2.j2h also specify the color of normal text, indeed it adds this line normal darkblue ; as you might see the syntax of this file is quite straightforward:
      b = bold
      i = italics
      u = underline You may also specify more than on of these options separated by commas e.g. keyword blue u, b ; you may see all possible colors in the file colors.html but you can also use the standard #<number> html syntax for specifying a color.

if something goes wrong with your options try to run source-highlight with --verbose option enabled.

SEE ALSO
HTML documentation in /usr/local/share/doc/source-highlight.

VERSION INFORMATION
This man page (partially) documents source-highlight, version 1.4. TexInfo documentation will be released soon.

AUTHOR
GNU Source-highlight (originally known as two separate programs, java2html and cpp2html) is developed by Lorenzo Bettini <bettini@gnu.org> the current maintainer. The Prolog scanner was written by Martin Gebert <Murphy.Gebert@gmx.de>. The Perl was written by Alain Barbet <alian@alianwebserver.com>

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

MAILING LISTS
The following mailing lists are available:
help-source-highlight@gnu.org, for generic discussions about the program and for asking for help about it (open mailing list), http://mail.gnu.org/mailman/listinfo/help-source-highlight
info-source-highlight@gnu.org, for receiving information about new releases and features (read-only mailing list), http://mail.gnu.org/mailman/listinfo/info-source-highlight