highlight --version (return code: 0)
highlight version 3.38
Copyright (C) 2002-2017 Andre Simon <andre.simon1 at gmx.de>
Argparser class
Copyright (C) 2006-2008 Antonio Diaz Diaz <ant_diaz at teleline.es>
Artistic Style Classes (2.06)
Copyright (C) 2006-2016 by Jim Pattee <jimp03 at email.com>
Copyright (C) 1998-2002 by Tal Davidson
Diluculum Lua wrapper (1.0)
Copyright (C) 2005-2013 by Leandro Motta Barros
xterm 256 color matching functions
Copyright (C) 2006 Wolfgang Frisch <wf at frexx.de>
This software is released under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
highlight --help (return code: 0)
USAGE: highlight [OPTIONS]... [FILES]...
General options:
-B, --batch-recursive=<wc> convert all matching files, searches subdirs
(Example: -B '*.cpp')
-D, --data-dir=<directory> set path to data directory (deprecated)
--config-file=<file> set path to a lang or theme file
-d, --outdir=<directory> name of output directory
-h, --help print this help
-i, --input=<file> name of single input file
-o, --output=<file> name of single output file
-P, --progress print progress bar in batch mode
-q, --quiet supress progress info in batch mode
-S, --syntax=<type> specify type of source code
-v, --verbose print debug info
--force generate output if input syntax is unknown
--list-scripts=<type> list installed scripts
<type> = [langs, themes, plugins]
--plug-in=<script> execute Lua plug-in script; repeat option to
execute multiple plug-ins
--plug-in-param=<value> set plug-in input parameter
--print-config print path configuration
--print-style print stylesheet only (see --style-outfile)
--skip=<list> ignore listed unknown file types
(Example: --skip='bak;c~;h~')
--start-nested=<lang> define nested language which starts input
without opening delimiter
--stdout output to stdout (batch mode, --print-style)
--validate-input test if input is text, remove Unicode BOM
--version print version and copyright information
Output formatting options:
-O, --out-format=<format> output file in given format
<format>=[html, xhtml, latex, tex, odt, rtf,
ansi, xterm256, truecolor, bbcode, pango, svg]
-c, --style-outfile=<file> name of style file or print to stdout, if
'stdout' is given as file argument
-e, --style-infile=<file> to be included in style-outfile (deprecated)
use a plug-in file instead
-f, --fragment omit document header and footer
-F, --reformat=<style> reformats and indents output in given style
<style> = [allman, banner, gnu,
horstmann, java, kr, linux, mozilla, otbs, vtk,
stroustrup, whitesmith, google, pico, lisp]
-I, --include-style include style definition in output file
-J, --line-length=<num> line length before wrapping (see -V, -W)
-j, --line-number-length=<num> line number width incl. left padding (default: 5)
-k, --font=<font> set font (specific to output format)
-K, --font-size=<num?> set font size (specific to output format)
-l, --line-numbers print line numbers in output file
-m, --line-number-start=<cnt> start line numbering with cnt (assumes -l)
-s, --style=<style> set colour style (theme)
-t, --replace-tabs=<num> replace tabs by <num> spaces
-T, --doc-title=<title> document title
-u, --encoding=<enc> set output encoding which matches input file
encoding; omit encoding info if set to NONE
-V, --wrap-simple wrap lines after 80 (default) characters w/o
indenting function parameters and statements
-W, --wrap wrap lines after 80 (default) characters
--wrap-no-numbers omit line numbers of wrapped lines
(assumes -l)
-z, --zeroes pad line numbers with 0's
--delim-cr set CR as end-of-line delimiter (MacOS 9)
--keep-injections output plug-in injections in spite of -f
--kw-case=<case> change case of case insensitive keywords
<case> = [upper, lower, capitalize]
--no-trailing-nl omit trailing newline
(X)HTML output options:
-a, --anchors attach anchor to line numbers
-y, --anchor-prefix=<str> set anchor name prefix
-N, --anchor-filename use input file name as anchor prefix
-C, --print-index print index with hyperlinks to output files
-n, --ordered-list print lines as ordered list items
--class-name=<name> set CSS class name prefix;
omit class name if set to NONE
--inline-css output CSS within each tag (verbose output)
--enclose-pre enclose fragmented output with pre tag
(assumes -f)
LaTeX output options:
-b, --babel disable Babel package shorthands
-r, --replace-quotes replace double quotes by \dq{}
--pretty-symbols improve appearance of brackets and other symbols
RTF output options:
--page-color include page color attributes
-x, --page-size=<ps> set page size
<ps> = [a3, a4, a5, b4, b5, b6, letter]
--char-styles include character stylesheets
SVG output options:
--height set image height (units allowed)
--width set image width (see --height)
GNU source-highlight compatibility options:
--doc create stand alone document
--no-doc cancel the --doc option
--css=filename the external style sheet filename
--src-lang=STRING source language
-t, --tab=INT specify tab length
-n, --line-number[=0] number all output lines, optional padding
--line-number-ref[=p] number all output lines and generate an anchor,
made of the specified prefix p + the line
number (default='line')
--output-dir=path output directory
--failsafe if no language definition is found for the
input, it is simply copied to the output
If no in- or output files are specified, stdin and stdout will be used.
HTML will be generated unless an other output format is given. Style definitions
are stored in highlight.css (HTML, XHTML, SVG) or highlight.sty (LaTeX, TeX)
if neither -c nor -I is given.
Reformatting code (-F) will only work with C, C++, C# and Java input files.
Wrapping lines with -V or -W will cause faulty highlighting of long single
line comments and directives. Use with caution.
See README files how to apply plug-ins to customize the output.
Updates and information: http://www.andre-simon.de/