= HIGHLIGHT MANUAL André Simon v3.58, August 2020 :lang: en :toc: left :toc-title: Contents :toclevels: 4 :sectnums: :sectnumlevels: 2 :sectanchors: // Misc Settings: :experimental: true :icons: font :linkattrs: true
// =====================================
// Custom Attributes for Reference Links
// =====================================
// Highlight Docs (asciidoc):
:README_DE: pass:q[link:README_DE.adoc[README_DE
]]
:README_LANGLIST: pass:q[link:README_LANGLIST.adoc[README_LANGLIST
]]
:README_PLUGINS: pass:q[link:README_PLUGINS.adoc[README_PLUGINS
]]
:README_REGEX: pass:q[link:README_REGEX.adoc[README_REGEX
]]
:README_TESTCASES: pass:q[link:README_TESTCASES.adoc[README_TESTCASES
]]
// Highlight Docs (uncovenrted):
:INSTALL: pass:q[link:INSTALL[INSTALL
]]
// Source files:
:cpp_qt_lua: pass:q[link:plugins/cpp_qt.lua[cpp_qt.lua
^]]
:filetypes_conf: pass:q[link:filetypes.conf[filetypes.conf
^]]
:fileopenfilter_conf: pass:q[link:gui_files/ext/fileopenfilter.conf[gui_files/ext/fileopenfilter.conf
^]]
:makefile: pass:q[link:makefile[makefile
^]]
// Folders:
:langDefs: pass:q[link:langDefs/[langDefs/
^]]
:themes: pass:q[link:themes/[themes/
^]]
:themes_base16: pass:q[link:themes/base16/[themes/base16/
^]]
// Extras Folder:
:extras: pass:q[link:extras/[extras/
]]
:extras_swig: pass:q[link:extras/swig/[extras/swig/
]]
:README_SWIG: pass:q[link:extras/swig/README_SWIG[README_SWIG
]]
:extras_pandoc: pass:q[link:extras/pandoc/[extras/pandoc/
]]
:README_pandoc: pass:q[link:extras/pandoc/README.html[README.html
]]
:extras_tcl: pass:q[link:extras/tcl/[extras/tcl/
]]
:README_TCL: pass:q[link:extras/tcl/README_TCL[README_TCL
]]
:extras_web_plugins: pass:q[link:extras/web_plugins/[extras/web_plugins/
]]
// External Links:
:source-highlight: pass:[http://www.gnu.org/software/src-highlite/[source-highlight^]]
:andre-simon_de: pass:[http://www.andre-simon.de[www.andre-simon.de^]]
OSI Certified Open Source Software
Deutsche Anleitung: {README_DE}
== OVERVIEW
Highlight converts sourcecode to HTML, XHTML, RTF, ODT, LaTeX, TeX, SVG, BBCode, Pango markup and terminal escape sequences with coloured syntax highlighting. Syntax definitions and colour themes are customizable.
=== INTENDED PURPOSE
Highlight was designed to offer a flexible but easy to use syntax highlighter for several output formats. No syntax or colouring information is hardcoded, instead all relevant data is stored in configuration scripts. These Lua scripts may be altered and enhanced with plug-ins.
=== FEATURE LIST
=== SUPPORTED PROGRAMMING AND MARKUP LANGUAGES
Please see {README_LANGLIST} for the current set of supported languages. To get a list and associated file extensions you may also run:
.............................. highlight --list-scripts=langs ..............................
== USAGE AND OPTIONS
=== QUICK INTRODUCTION
The following examples show how to produce a highlighted C++ file, using
main.cpp
as input file:
Generate HTML::
+
.................................................
highlight -i main.cpp -o main.cpp.html
highlight < main.cpp > main.cpp.html --syntax cpp
highlight < source.tmp > main.cpp.html --syntax-by-name main.cpp
.................................................
+
You will find the HTML file and highlight.css
in the working directory.
If you use IO redirection (2nd example), you must define the programming
language with --syntax
or --syntax-by-name
.
Generate HTML with embedded CSS definitions and line numbers:: + ..................................................................... highlight -i main.cpp -o main.cpp.html --include-style --line-numbers .....................................................................
Generate HTML with inline CSS definitions:: + ................................................... highlight -i main.cpp -o main.cpp.html --inline-css ...................................................
Generate LaTeX using "horstmann
" source formatting style and "neon
" colour theme::
+
................................................................................
highlight -O latex -i main.cpp -o main.cpp.tex --reformat horstmann --style neon
................................................................................
+
The following output formats may be defined with --out-format
:
+
[horizontal]
html
::: HTML5 (default)
xhtml
::: XHTML 1.1
tex
::: Plain TeX
latex
::: LaTeX
rtf
::: RTF
odt
::: OpenDocument Text (Flat XML)
svg
::: SVG
bbcode
::: BBCode
pango
::: Pango markup
ansi
::: Terminal 16 color escape codes
xterm256
::: Terminal 256 color escape codes
truecolor
::: Terminal 16m color escape codes
Customize font settings:: + .......................................................................... highlight --syntax ada --font-size 12 --font "'Courier New',monospace" highlight --syntax ada --out-format=latex --font-size tiny --font sffamily ..........................................................................
Define an output directory:: + ....................................... highlight -d some/target/dir/ .cpp .h .......................................
See highlight --help
or man highlight
for more details.
=== CLI OPTIONS
The command line version of highlight offers the following options:
................................................................................ USAGE: highlight [OPTIONS]... [FILES]...
General options:
-B, --batch-recursive=