Scroll to navigation

SOURCE-HIGHLIGHT(1) User Commands SOURCE-HIGHLIGHT(1)

NAME

Source-highlight - convert source code to syntax highlighted document

SYNOPSIS

source-highlight [OPTIONS]... < input_file > output_file

DESCRIPTION

GNU GNU source-highlight 3.1.8

Highlight the syntax of a source file (e.g. Java) into a specific format (e.g. HTML)

source-highlight [OPTIONS]... -i input_file -o output_file source-highlight [OPTIONS]... [FILES]...
Print help and exit
Print help, including all details and hidden options, and exit
Print version and exit
input file. default std input
output file. default std output (when the third invocation form is used). If STDOUT is specified, the output is directed to standard output

you can simply specify some files at the command line and also use regular expressions (for instance *.java). In this case the name for the output files will be formed using the name of the source file with a .<ext> appended, where <ext> is the extension chosen according to the output format specified (for instance .html).

source language (use --lang-list to get the complete list). If not specified, the source language will be guessed from the file extension.
list all the supported language and associated language definition file
list all the supported output language and associated language definition file
output format (use --outlang-list to get the complete list) (default=`html')
create an output file that can be used as a stand alone document (e.g., not to be included in another one)
cancel the --doc option even if it is implied (e.g., when css is given)
the external style sheet filename. Implies --doc
give a title to the output document. Implies --doc
specify tab length. (default=`8')
file to insert as header
file to insert as footer
specify the file containing format options (default=`default.style')
css syntax)
options (default=`style.defaults')
output language definition file
output language map file (default=`outlang.map')
directory where language definition files and language maps are searched for. If not specified these files are searched for in the current directory and in the data dir installation directory
output directory
language definition file
language map file (default=`lang.map')
prints the language elements that are defined
in the language definition file
force to infer source script language (overriding given language specification)

Lines:

number all output lines, using the specified padding character (default=`0')
number all output lines and generate an anchor,
number (default=`line')

Filtering output:

Mode: linerange
specifying line ranges
generate only the lines in the specified range(s)
the optional separator to be printed among ranges (e.g., "...")
number of (context) lines generated even if not in range
Mode: regexrange
specifying regular expression delimited ranges
generate only the lines within the specified regular expressions

reference generation:

generate references (possible values="inline", "postline", "postdoc" default=`inline')
specify the file generated by ctags that will be used to generate references (default=`tags')
how to run the ctags command. If this option is not specified, ctags will be executed with the default value. If it is specified with an empty string, ctags will not be executed at all (default=`ctags --excmd=n --tag-relative=yes')

testing:

verbose mode on
print no progress information
write output files in binary mode
print some statistics (i.e., elapsed time)
put source-highlight version in the generated file (default=on)
only check the correctness of a language definition file
only check the correctness of an output language definition file
if no language definition is found for the input, it is simply copied to the output
debug a language definition. In dump mode just dumps all the steps; in interactive, at each step, waits for some input (press ENTER to step) (possible values="interactive", "dump" default=`dump')
show the regular expression automaton corresponding to a language definition file

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

REPORTING BUGS

Report bugs to <bug-source-highlight at gnu.org>

COPYRIGHT

Copyright © 1999-2008 Lorenzo Bettini <http://www.lorenzobettini.it> This program comes with ABSOLUTELY NO WARRANTY.
This is free software; you may redistribute copies of the program under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING.

SEE ALSO

The full documentation for Source-highlight is maintained as a Texinfo manual. If the info and Source-highlight programs are properly installed at your site, the command

info Source-highlight

should give you access to the complete manual.

March 2015 Source-highlight 3.1.8 (library: 4:1:0)