21.6 Code Examples Syntax Highlighting in HTML

warning: Source highlighting is experimental, feedback is welcomed.

Support for source code syntax highlighting is available in texi2any for the HTML output, with the help of external software. This feature is turned on by setting HIGHLIGHT_SYNTAX. Source code highlighting is set up for @example blocks. The language specified for syntax highlighting is the first argument on the @example line (see @example: Example Text), or HIGHLIGHT_SYNTAX_DEFAULT_LANGUAGE if set and there is no first argument.

The HIGHLIGHT_SYNTAX value determines the command used for highlighting:

highlight

Use highlight from http://www.andre-simon.de/doku/highlight/en/highlight.php;

pygments

Use pygmentize from https://pygments.org/;

anything else

Use source-highlight (see GNU Source-highlight).

See Other Customization Variables.