$verbatim-syntax-highlighter

$verbatim-syntax-highlighter — Selects the syntax highlighter.

Parameter:
{}verbatim-syntax-highlighter
Defined in:
param.xsl
Used in:
main.xsl, param.xsl

Synopsis

$verbatim-syntax-highlighter as xs:string := 'pygments'

Description

This parameter specifies the syntax highlighter to use. Most of the parameters related to syntax highlighting only work if the pygments highlighter is selected. However, that requires running an external process which might not be available and which, even if it is available, has an impact on performance. Using Pygments has the advantage that the stylesheets have more control over the process and it is available both for online and paged media formats.

The alternative to running an external program is to use JavaScript to highlight the listing in the browser. This is faster at formatting time, but limits syntax highlighting to those environments where JavaScript is available.

The following options are supported:

pygments

This is the default highlighter.

highlight.js

Uses the highlight.js JavaScript library to perform syntax highlighting. The $highlight-js-head-elements variable determines what CSS stylesheets and JavaScript libraries are loaded for this option.

Version 11.10.0 of highlight.js is included, configured to highlight the following languages: abnf, apache, asciidoc, bash, c, cmake, coffeescript, cpp, csharp, css, diff, go, gradle, groovy, http, ini, java, javascript, json, kotlin, latex, less, lisp, lua, makefile, markdown, nginx, objectivec, perl, pgsql, php, php-template, plaintext, powershell, protobuf, python, python-repl, r, ruby, rust, scala, scheme, scss, shell, sql, swift, typescript, xml, yaml. Only the default CSS is included.

Version 2.9.0 of highlightjs-line-numbers.js is also included.

prism

Uses the Prism JavaScript library to perform syntax highlighting. The $prism-js-head-elements variable determines what CSS stylesheets and JavaScript libraries are loaded for this option.

none

Disables syntax highlighting but also suppresses messages about features that are not available because syntax highlighting is disabled.