source-highlight1
Convert source code to syntax highlighted document
Usage
source-highlight [OPTIONS] ...
<
INPUT_FILE
>
OUTPUT_FILE
Overview
GNU GNU source-highlight 3.1.9
Highlight the syntax of a source file (e.g. Java) into a specific format (e.g. HTML)
-
source-highlight [OPTIONS]...
-iINPUT_FILE-oOUTPUT_FILE source-highlight [OPTIONS]... [FILES]...
-
-h, --help -
Print help and exit
-
--detailed-help -
Print help, including all details and hidden options, and exit
-
-V, --version -
Print version and exit
-
-i, --input=FILENAME -
Input file (default=stdin)
-
-o, --output=FILENAME -
Output file (default=stdout, 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).
-
-s, --src-lang=STRING -
source language (use
--lang-listto get the complete list). If not specified, the source language will be guessed from the file extension.
-
--lang-list -
list all the supported language and associated language definition file
-
--outlang-list -
list all the supported output language and associated language definition file
-
-f, --out-format=STRING -
output format (use
--outlang-listto get the complete list) (default=`html')
-
-d, --doc -
create an output file that can be used as a stand alone document (e.g., not to be included in another one)
-
--no-doc -
cancel the
--docoption even if it is implied (e.g., when css is given)
-
-c, --css=FILENAME -
the external style sheet filename. Implies
--doc
-
-T, --title=STRING -
give a title to the output document. Implies
--doc
-
-t, --tab=INT -
specify tab length. (default=`8')
-
-H, --header=FILENAME -
file to insert as header
-
-F, --footer=FILENAME -
file to insert as footer
-
--style-file=FILENAME -
specify the file containing format options (default=`default.style')
--style-css-file=FILENAME specify the file containing format options (in-
css syntax)
--style-defaults=FILENAME specify the file containing defaults for format-
options (default=`style.defaults')
-
--outlang-def=FILENAME -
output language definition file
-
--outlang-map=FILENAME -
output language map file (default=`outlang.map')
-
--data-dir=PATH -
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-dir=PATH -
output directory
-
--lang-def=FILENAME -
language definition file
-
--lang-map=FILENAME -
language map file (default=`lang.map')
-
--show-lang-elements=FILENAME -
prints the language elements that are defined
-
in the language definition file
-
--infer-lang -
force to infer source script language (overriding given language specification)
Lines:
-
-n, --line-number[=PADDING] -
number all output lines, using the specified padding character (default=`0')
-
--line-number-ref[=PREFIX] -
number all output lines and generate an anchor,
- made of the specified prefix + the line
-
number (default=`line')
Filtering output:
-
Mode: linerange
-
specifying line ranges
-
--line-range=STRING -
generate only the lines in the specified range(s)
-
--range-separator=STRING -
the optional separator to be printed among ranges (e.g., "...")
-
--range-context=INT -
number of (context) lines generated even if not in range
-
Mode: regexrange
-
specifying regular expression delimited ranges
-
--regex-range=STRING -
generate only the lines within the specified regular expressions
reference generation:
-
--gen-references=STRING -
generate references (possible values="inline", "postline", "postdoc" default=`inline')
-
--ctags-file=FILENAME -
specify the file generated by ctags that will be used to generate references (default=`tags')
-
--ctags=CMD -
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:
-
-v, --verbose -
verbose mode on
-
-q, --quiet -
print no progress information
-
--binary-output -
write output files in binary mode
-
--statistics -
print some statistics (i.e., elapsed time)
-
--gen-version -
put source-highlight version in the generated file (default=on)
-
--check-lang=FILENAME -
only check the correctness of a language definition file
-
--check-outlang=FILENAME -
only check the correctness of an output language definition file
-
--failsafe -
if no language definition is found for the input, it is simply copied to the output
-
-g, --debug-langdef[=TYPE] -
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-regex=FILENAME -
show the regular expression automaton corresponding to a language definition file
Maintained by Lorenzo Bettini <http://www.lorenzobettini.it>
History
- Arch Linux 2026-11-01 to Debian 11 (Bullseye): the text shown here
- Debian 10 (Buster) to Debian 9 (Stretch)
- Debian 8 (Jessie)
- Debian 7 (Wheezy)
- Debian 6.0 (Squeeze)
- Debian 5.0 (Lenny) to Debian 4.0 (Etch)
- Debian 3.1 (Sarge)
--binary-output since Debian 6.0 (Squeeze);
--check-lang since Debian 4.0 (Etch);
--check-outlang since Debian 4.0 (Etch);
--css since Debian 4.0 (Etch);
--ctags since Debian 4.0 (Etch);
--ctags-file since Debian 4.0 (Etch);
--data-dir since Debian 4.0 (Etch);
--debug-langdef since Debian 4.0 (Etch);
--detailed-help since Debian 6.0 (Squeeze);
--doc since Debian 4.0 (Etch);
--failsafe since Debian 4.0 (Etch);
--footer since Debian 4.0 (Etch);
--gen-references since Debian 4.0 (Etch);
--gen-version since Debian 4.0 (Etch);
--header since Debian 4.0 (Etch);
--help since Debian 4.0 (Etch);
--infer-lang since Debian 6.0 (Squeeze);
--input since Debian 4.0 (Etch);
--lang-def since Debian 4.0 (Etch);
--lang-list since Debian 4.0 (Etch);
--lang-map since Debian 4.0 (Etch);
--line-number since Debian 4.0 (Etch);
--line-number-ref since Debian 4.0 (Etch);
--line-range since Debian 6.0 (Squeeze);
--no-doc since Debian 4.0 (Etch);
--outlang-def since Debian 4.0 (Etch);
--outlang-list since Debian 4.0 (Etch);
--outlang-map since Debian 4.0 (Etch);
--output since Debian 4.0 (Etch);
--output-dir since Debian 4.0 (Etch);
--quiet since Debian 6.0 (Squeeze);
--range-context since Debian 6.0 (Squeeze);
--range-separator since Debian 6.0 (Squeeze);
--regex-range since Debian 6.0 (Squeeze);
--show-lang-elements since Debian 4.0 (Etch);
--show-regex since Debian 4.0 (Etch);
--statistics since Debian 6.0 (Squeeze);
--style-file since Debian 4.0 (Etch);
--tab since Debian 4.0 (Etch);
--title since Debian 4.0 (Etch);
--verbose since Debian 4.0 (Etch);
--version since Debian 4.0 (Etch);
-F since Debian 4.0 (Etch);
-H since Debian 4.0 (Etch);
-T since Debian 4.0 (Etch);
-V since Debian 4.0 (Etch);
-c since Debian 4.0 (Etch);
-d since Debian 4.0 (Etch);
-f since Debian 4.0 (Etch);
-g since Debian 6.0 (Squeeze);
-h since Debian 4.0 (Etch);
-i since Debian 4.0 (Etch);
-n since Debian 4.0 (Etch);
-o since Debian 4.0 (Etch);
-q since Debian 6.0 (Squeeze);
-s since Debian 4.0 (Etch);
-t since Debian 4.0 (Etch);
-v since Debian 4.0 (Etch).