Refactor highlighting options [API Change]

A new command line option `--syntax-highlighting` is provided; it takes
the values `none`, `default`, `idiomatic`, a style name, or a path to a
theme file. It replaces the `--no-highlighting`, `--highlighting-style`,
and `--listings` options.

The `writerListings` and `writerHighlightStyle` fields of the
`WriterOptions` type are replaced with `writerHighlightStyle`.

Closes: #10525
This commit is contained in:
Albert Krewinkel
2025-09-02 17:50:47 +02:00
committed by John MacFarlane
parent 64757254ab
commit e0acb24528
23 changed files with 261 additions and 157 deletions
+19 -6
View File
@@ -203,15 +203,28 @@ the first one given is the default.
: Causes HTML comments to be stripped in Markdown or Textile
source, instead of being passed through to the output format.
`highlight-style` (string, leave unset for no highlighting)
`syntax-highlighting` (`"default"|"none"|"idiomatic"|style`)
: The method used for code syntax highlighting. Setting a
specific *style* causes highlighting to be performed with the
internal highlighting engine, using KDE syntax definitions and
styles. The `"idiomatic"` method uses a format-specific
highlighter if one is available, or the default style if the
target format has no idiomatic highlighting method. Setting
this option to `none` disables all syntax highlighting. The
`"default"` method uses a format-specific default.
: Specify the style to use for syntax highlighting of code.
Standard styles are `"pygments"` (the default), `"kate"`,
`"monochrome"`, `"breezeDark"`, `"espresso"`, `"zenburn"`,
`"haddock"`, and `"tango"`. Alternatively, the path of
a `.theme` with a KDE syntax theme may be used (in this
case, the relevant file contents must also be included
in `files`, see below).
`"haddock"`, and `"tango"`. Alternatively, the path of a
`.theme` with a KDE syntax theme may be used (in this case,
the relevant file contents must also be included in `files`,
see below).
The default for HTML, EPUB, Docx, Ms, Man, and LaTeX output is
to use the internal highlighter with the default style; Typst
output relies on Typst's own syntax highlighting system by
default.
`embed-resources`